A scalable REST API with JWT Authentication, Role-Based Access Control (RBAC), and CRUD functionality, along with a basic frontend interface to interact with the APIs.
- Node.js
- Express.js
- MongoDB
- JWT Authentication
- Bcrypt (Password Hashing)
- React.js
- Axios
- Protected Routes using JWT
- User Registration
- User Login
- Password Hashing using bcrypt
- JWT Token Generation & Verification
- User role
- Admin role
- Protected routes based on role
- Create, Read, Update, Delete for secondary entity (Tasks)
- Proper HTTP status codes
- Centralized error handling
- Secure JWT handling
- Input validation
- Protected API routes
- Environment variable protection
auth-crud-api/ β βββ backend/ β βββ config/ β β βββ db.js β β βββ token.js β β β βββ controllers/ β β βββ auth.controller.js β β β βββ model/ β β βββ user.model.js β β β βββ routes/ β β βββ auth.route.js β β β βββ .env β βββ index.js β βββ package.json β βββ package-lock.json β βββ frontend/ β βββ public/ β βββ node_modules/ β β β βββ src/ β βββ assets/ β β β βββ Component/ β β βββ Nav.jsx β β β βββ Context/ β β βββ AuthContext.jsx β β β βββ pages/ β β βββ Home.jsx β β βββ Login.jsx β β βββ SignUp.jsx β β β βββ App.jsx β βββ App.css β βββ index.css β βββ main.jsx β βββ .gitignore βββ README.md