https://github.com/the-wee-lad/multi-role-project-management-system
A secure and scalable REST API for managing users, projects, and tasks with multi-tenancy and role-based access control (Admin, Manager, Member). Built with Node.js, Express, MongoDB, and JWT authentication.
https://github.com/the-wee-lad/multi-role-project-management-system
internship-project internship-task project-management
Last synced: 12 months ago
JSON representation
A secure and scalable REST API for managing users, projects, and tasks with multi-tenancy and role-based access control (Admin, Manager, Member). Built with Node.js, Express, MongoDB, and JWT authentication.
- Host: GitHub
- URL: https://github.com/the-wee-lad/multi-role-project-management-system
- Owner: The-Wee-Lad
- Created: 2025-05-10T14:07:36.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-05-11T21:40:36.000Z (about 1 year ago)
- Last Synced: 2025-07-01T18:52:17.634Z (about 1 year ago)
- Topics: internship-project, internship-task, project-management
- Language: TypeScript
- Homepage: https://multi-role-project-management-system.onrender.com/healthCheck
- Size: 92.8 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# Multi-Role Project Management System
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
## π Features
- π 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
---
## π οΈ Tech Stack
- Node.js + Express.js
- MongoDB + Mongoose
- JWT (access + refresh)
- Joi for validation
- express-rate-limit
---
## π API Endpoints Overview
### π’ Company Routes (`/users/company`)
| Method | Endpoint | Description |
| ------ | ---------------- | ------------------ |
| POST | `/users/company` | Register a company |
---
### π€ Auth & User Routes (`/users`)
| 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 |
---
### π Project Routes (`/projects/:id`)
| 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 |
---
### β
Task Routes (`/tasks`)
| 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) |
---
## π Roles & Permissions
| 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 |
---
## π Task Filters
Pass filters in body of `POST /tasks/getAllTasks`:
```json
{
"status": "In Progress",
"assignedTo": "user_id"
}
```
---
## π Project Structure
```
src/
βββ controllers/
βββ routes/
βββ models/
βββ services/
βββ middlewares/
βββ validators/
βββ utils/
βββ app.js
```
---
## π¦ Setup Instructions
1. **Clone the repo:**
```bash
git clone https://github.com/The-Wee-Lad/Multi-Role-Project-Management-System
cd multi-role-project-mgmt
```
2. **Install dependencies:**
```bash
npm install
```
3. **Create `.env` from `.env.example` and configure**
4. **Run the server:**
```bash
npm run dev
```
---
## π¬ Postman Collection
[Postman link for 15+ endpoints
](https://www.postman.com/payload-participant-73420966/workspace/the-wee-lad-public-workspace/collection/40788084-a02e4e27-3d7f-4645-8a55-59b06a1acdeb?action=share&creator=40788084&active-environment=40788084-e4e66640-3fbc-43f6-a930-3b861f6afc56)