Skip to content

Sumukhapb/Project-Management-System

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🚀 Project Management System

A comprehensive project management backend with authentication, role-based authorization, team management, and file uploads.

Node.js Express MongoDB License

📋 Description

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.

🎯 Key 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

🛠️ Tech Stack

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

✨ Features

🔑 Authentication & Authorization

  • Student Roles: LEADER or MEMBER
  • Coordinator Access: Full system management
  • JWT-based Security: Secure token-based authentication
  • Cookie Management: Automatic session handling

👥 Team Management

  • 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 Management

  • 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

🚀 Quick Start

📋 Prerequisites

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)

⚡ Installation

  1. Clone the repository

    git clone <your-repo-url>
    cd "Project Management"
  2. Install dependencies

    npm install
  3. Configure environment variables Create a .env file 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/
  4. Start the application

    # Development mode (with auto-restart)
    npm run dev
    
    # Production mode
    npm start
  5. Access the application Open your browser and navigate to: http://localhost:8001/

🔧 Environment Variables

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/

🏃‍♂️ Running the Application

  1. Start MongoDB (if running locally)

    net start MongoDB
  2. Start the server

    npm run dev
  3. Verify installation

    • Check console for: MongoDB Connected and Server Started at PORT:8001
    • Visit http://localhost:8001/ in your browser
    • Static files are served from /uploads

🔐 Authentication & Authorization

🔑 How Authentication Works

  • JWT Tokens: Secure authentication using JSON Web Tokens
  • Cookie Storage: Tokens stored in HTTP-only cookies named token
  • Middleware: checkForAuthentication automatically parses cookies and sets req.user
  • Role-Based Access: Different permissions for different user types

👥 User Roles & Permissions

Role Permissions
LEADER Create teams, join teams, upload files
MEMBER Join teams, upload files
Coordinator View all teams, manage system

🛡️ Authorization Middleware

  • isLeader: Restricts access to students with LEADER role
  • isCoordinator: Restricts access to coordinator users only

🔗 API Endpoints

Base URL: http://localhost:8001
Unless noted, endpoints require authentication via token cookie.

Auth

  • 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

Teams

  • 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

Files

  • POST /file/upload — Upload file (multipart/form-data: file, teamId, uploadBy, body)

📄 License

This project is licensed under the ISC License - see the LICENSE file for details.


About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published