Skip to content

The-Wee-Lad/Multi-Role-Project-Management-System

Repository files navigation

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:

{
  "status": "In Progress",
  "assignedTo": "user_id"
}

📂 Project Structure

src/
├── controllers/
├── routes/
├── models/
├── services/
├── middlewares/
├── validators/
├── utils/
└── app.js

📦 Setup Instructions

  1. Clone the repo:

    git clone https://github.com/The-Wee-Lad/Multi-Role-Project-Management-System
    cd multi-role-project-mgmt
  2. Install dependencies:

    npm install
  3. Create .env from .env.example and configure

  4. Run the server:

    npm run dev

📬 Postman Collection

Postman link for 15+ endpoints Run In Postman

About

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.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors