A robust, secure, and scalable REST API for managing projects, tasks, and users within companies using strict role-based access control and multi-tenancy.
Deployed at render https://multi-role-project-management-system.onrender.com/healthCheck
- 🔒 JWT-based Authentication (with Refresh Token support)
- 🛂 Role-based Authorization (Admin, Manager, Member)
- 🏢 Multi-Tenancy (Data isolation per company)
- 📁 CRUD for Users, Projects, and Tasks
- 🔍 Task Filtering & Pagination
- 🚧 Centralized Error Handling
- 🛡️ Rate Limiting per IP
- 📋 Modular code structure
- Node.js + Express.js
- MongoDB + Mongoose
- JWT (access + refresh)
- Joi for validation
- express-rate-limit
| Method | Endpoint | Description |
|---|---|---|
| POST | /users/company |
Register a company |
| Method | Endpoint | Description |
|---|---|---|
| POST | /users/login |
Login and receive tokens |
| POST | /users/refresh-access-token |
Refresh access token |
| POST | /users/logout |
Logout user |
| POST | /users/ |
Create new user (Admin only) |
| PATCH | /users/ |
Update current user |
| GET | /users/ |
Get current user info |
| DELETE | /users/ |
Delete current user |
| GET | /users/list |
List users in company (Admin) |
| POST | /users/updateTask/:taskId |
Update task assigned to user |
| GET | /users/get-user-tasks |
Get user’s assigned tasks |
| Method | Endpoint | Description |
|---|---|---|
| POST | /projects/:id |
Create a new project |
| GET | /projects/:id |
Get all projects |
| PATCH | /projects/:id |
Update a project |
| DELETE | /projects/:id |
Delete a project |
| Method | Endpoint | Description |
|---|---|---|
| POST | /tasks/create |
Create a new task |
| PATCH | /tasks/:taskId |
Update an existing task |
| DELETE | /tasks/:taskId |
Delete a task |
| POST | /tasks/assign/:taskId |
Assign user to task |
| POST | /tasks/unassign/:taskId |
Unassign user from task |
| POST | /tasks/getAllTasks |
Get tasks (with filters) |
| Role | Users | Projects | Tasks |
|---|---|---|---|
| Admin | Full access | Full access | Full access |
| Manager | View only | Full access | Full access |
| Member | No access | No access | View & update own |
Pass filters in body of POST /tasks/getAllTasks:
{
"status": "In Progress",
"assignedTo": "user_id"
}src/
├── controllers/
├── routes/
├── models/
├── services/
├── middlewares/
├── validators/
├── utils/
└── app.js
-
Clone the repo:
git clone https://github.com/The-Wee-Lad/Multi-Role-Project-Management-System cd multi-role-project-mgmt -
Install dependencies:
npm install
-
Create
.envfrom.env.exampleand configure -
Run the server:
npm run dev