A comprehensive project management backend with authentication, role-based authorization, team management, and file uploads.
This project management system provides a robust backend for managing teams, coordinating projects, and handling file uploads. It supports two distinct user roles with different permissions and capabilities.
- 👥 User Management: Separate authentication for Students and Coordinators
- 🔐 Role-Based Access: Granular permissions based on user roles
- 🏢 Team Management: Create, join, and manage project teams
- 📁 File Handling: Upload and organize project files
- 🌐 Web Interface: Simple EJS-based views for user interaction
| Technology | Purpose | 
|---|---|
| Node.js | Runtime Environment | 
| Express.js | Web Framework | 
| MongoDB | Database | 
| Mongoose | ODM | 
| EJS | Template Engine | 
| JWT | Authentication | 
| Multer | File Uploads | 
| Cookie Parser | Cookie Handling | 
- Student Roles: LEADERorMEMBER
- Coordinator Access: Full system management
- JWT-based Security: Secure token-based authentication
- Cookie Management: Automatic session handling
- Team Creation: Leaders can create new teams
- Team Joining: Students can join existing teams
- Member Management: Track team membership and roles
- Coordinator Oversight: View all teams under their supervision
- File Uploads: Associate files with specific teams
- Static Serving: Direct access to uploaded files
- Metadata Tracking: File descriptions and upload history
- Team Association: Files linked to team projects
Before you begin, ensure you have the following installed:
- Node.js (version 18 or higher)
- MongoDB (running locally or accessible connection string)
- Git (for cloning the repository)
- 
Clone the repository git clone <your-repo-url> cd "Project Management" 
- 
Install dependencies npm install 
- 
Configure environment variables Create a .envfile in the project root:PORT=8001 MONGODB_URI=mongodb://localhost:27017/Project-Management JWT_SECRET=your-super-secret-jwt-key-here COOKIE_NAME=token UPLOAD_DIR=uploads/ 
- 
Start the application # Development mode (with auto-restart) npm run dev # Production mode npm start 
- 
Access the application Open your browser and navigate to: http://localhost:8001/
| Variable | Description | Default Value | 
|---|---|---|
| PORT | Server port number | 8001 | 
| MONGODB_URI | MongoDB connection string | mongodb://localhost:27017/Project-Management | 
| JWT_SECRET | Secret key for JWT tokens | Required | 
| COOKIE_NAME | Name of the authentication cookie | token | 
| UPLOAD_DIR | Directory for file uploads | uploads/ | 
- 
Start MongoDB (if running locally) net start MongoDB 
- 
Start the server npm run dev 
- 
Verify installation - Check console for: MongoDB ConnectedandServer Started at PORT:8001
- Visit http://localhost:8001/in your browser
- Static files are served from /uploads
 
- Check console for: 
- JWT Tokens: Secure authentication using JSON Web Tokens
- Cookie Storage: Tokens stored in HTTP-only cookies named token
- Middleware: checkForAuthenticationautomatically parses cookies and setsreq.user
- Role-Based Access: Different permissions for different user types
| Role | Permissions | 
|---|---|
| LEADER | Create teams, join teams, upload files | 
| MEMBER | Join teams, upload files | 
| Coordinator | View all teams, manage system | 
- isLeader: Restricts access to students with- LEADERrole
- isCoordinator: Restricts access to coordinator users only
Base URL: http://localhost:8001
Unless noted, endpoints require authentication via token cookie.
- GET /— Render home page
- GET /coordinator/signup— Render coordinator signup page
- POST /coordinator/signup— Create coordinator account (body:- { fullName, email, password })
- POST /coordinator/signin— Coordinator login (body:- { email, password })
- GET /coordinator/details?id=<mongoId>— Get coordinator details
- POST /student/signup— Create student account (body:- { fullName, email, password, role })
- POST /student/signin— Student login (body:- { email, password })
- GET /student/details?id=<mongoId>— Get student details
- POST /team/create— Create team (LEADER only; body:- { name, coordinatorId, body })
- POST /team/join— Join team (body:- { teamId })
- GET /team/all— List all teams (Coordinator only)
- GET /team/homepage?teamId=<teamId>— Get team details and files
- POST /file/upload— Upload file (multipart/form-data:- file,- teamId,- uploadBy,- body)
This project is licensed under the ISC License - see the LICENSE file for details.