This project is a Role-Based Access Control (RBAC) web application built using the MERN stack (MongoDB, Express, React, Node.js). The application includes user authentication, role-based authorization, and secured routes.
It demonstrates scalable, secure, and efficient handling of user roles and permissions.
- User Registration: Users can register with a username, email, password, and role (e.g., User, Admin, Moderator).
- User Login: Secure login using JWT-based authentication.
- Role-Based Access Control:
- Admin can access and manage all routes.
- Users have limited access based on their roles.
- Logout: Users can securely log out from the application.
- Protected Routes: Role-specific routes are implemented for secure navigation.
- Dynamic Role Selection: Role assignment during registration.
- Admin:
- Full access to all routes.
- Moderator:
- Limited access based on business requirements.
- User:
- Basic access to user-specific routes.
- React: Component-based UI development.
- Axios: For API requests.
- React Router: For route management.
- Bootstrap: For styling and responsiveness.
- Node.js: Backend runtime environment.
- Express.js: Lightweight web framework.
- MongoDB: Database to store user data and roles.
- Mongoose: ODM for MongoDB.
- JWT: JSON Web Tokens for secure authentication and authorization.
- Node.js (v16 or higher)
- MongoDB (Local/Cloud Instance)
- A package manager (npm or yarn)
- Navigate to the
backenddirectory:cd backend