A full-stack task management application built using the MERN stack with Role-Based Access Control (RBAC). It enables users to create, assign, filter, and update tasks securely based on their roles (Admin, Manager, Member).
-
User Authentication (JWT-based)
-
RBAC Enforcement
- Admin: Full access
- Manager: Can create, update, view all tasks
- Member: Can view and update only assigned tasks
-
Task Operations
- Create / Update / Delete / Filter Tasks
- Assign tasks to users
-
User Management (Admins only)
- Change user roles
- Delete users
-
Responsive UI with Material UI
-
Global Error Toast Handling
- React (Vite)
- Axios
- React Router
- Material UI
- Node.js
- Express.js
- MongoDB
- Mongoose
- Zod (Validation)
- JWT
git clone https://github.com/swami-hai-ham/RBAC.git
cd RBACPORT=5000
MONGO_URI=your_mongo_connection_string
JWT_SECRET=your_jwt_secret
VITE_API_BASE_URL=https://your-backend-url.com/api
# Backend
cd backend
npm install
# Frontend
cd ../frontend
npm install# Backend
npm run dev
# Frontend
npm run devPOST /api/v1/auth/register- Register userPOST /api/v1/auth/login- LoginGET /api/v1/auth/me- Get current user
GET /api/v1/users- List usersPUT /api/v1/users/:id- Change roleDELETE /api/v1/users/:id- Delete user
GET /api/v1/tasks- List tasks (filtered by role/query)POST /api/v1/tasks- Create taskPATCH /api/v1/tasks/:id- Update status or assignee (based on role)
| Role | View Tasks | Create Tasks | Update Task | Reassign | Manage Users |
|---|---|---|---|---|---|
| Admin | All | ✅ | ✅ | ✅ | ✅ |
| Manager | All | ✅ | ✅ | ✅ | ❌ |
| Member | Assigned | ❌ | ✅ (only own) | ❌ | ❌ |
- Errors are caught by Axios interceptor
- Dispatched to global snackbar via
window.dispatchEvent
- Frontend: Vercel
- Backend: Render