Skip to content

Yogabut/task-manager

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

31 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Task & Project Management System

A complete, modern task and project management application with separate Admin and User interfaces. Built with React (Frontend) and Node.js + Express + MongoDB (Backend).

🌟 Features

🎯 Project Management

  • Create & Manage Projects: Organize work into distinct projects
  • Project Dashboard: Track progress, budget, and team members
  • Project Statistics: View task completion rates and project status
  • Team Assignment: Assign multiple users to projects

βœ… Task Management

  • Task CRUD Operations: Create, Read, Update, Delete tasks
  • Task Assignment: Assign tasks to specific team members
  • Task Status Tracking: Track tasks through their lifecycle (Pending β†’ In Progress β†’ Completed)
  • Priority Levels: Set task priorities (Low, Medium, High)
  • Due Dates: Set and track task deadlines
  • Todo Checklists: Break tasks into subtasks with checkable items
  • File Attachments: Attach files and images to tasks
  • Progress Tracking: Automatic progress calculation based on checklist completion

πŸ‘₯ User Management

  • Role-Based Access Control: Admin and Member roles
  • User Profiles: Manage user information and profiles
  • Team Assignment: Assign users to projects and tasks
  • Activity Tracking: Track user task counts and performance

πŸ“Š Dashboard & Reports

  • Admin Dashboard: Overview of all projects, tasks, and team performance
  • User Dashboard: Personal task overview and statistics
  • Task Statistics: View task distribution by status and priority
  • Project Stats: Track project completion and progress
  • Export Reports: Export task and user reports to Excel

πŸ” Authentication & Security

  • JWT Authentication: Secure token-based authentication
  • Protected Routes: Role-based access control
  • Password Hashing: Secure password storage with bcrypt
  • Admin Token: Special token for admin registration

πŸ“ Project Structure

β”œβ”€β”€ backend/
β”‚   β”œβ”€β”€ config/
β”‚   β”‚   └── db.js                    # MongoDB connection
β”‚   β”œβ”€β”€ controllers/
β”‚   β”‚   β”œβ”€β”€ authController.js        # Authentication logic
β”‚   β”‚   β”œβ”€β”€ projectController.js     # Project CRUD operations
β”‚   β”‚   β”œβ”€β”€ taskController.js        # Task CRUD operations
β”‚   β”‚   β”œβ”€β”€ userController.js        # User management
β”‚   β”‚   └── reportController.js      # Export reports
β”‚   β”œβ”€β”€ middlewares/
β”‚   β”‚   β”œβ”€β”€ authMiddleware.js        # JWT verification & role checking
β”‚   β”‚   └── uploadMiddleware.js      # File upload handling
β”‚   β”œβ”€β”€ models/
β”‚   β”‚   β”œβ”€β”€ User.js                  # User schema
β”‚   β”‚   β”œβ”€β”€ Project.js               # Project schema
β”‚   β”‚   └── Task.js                  # Task schema
β”‚   β”œβ”€β”€ routes/
β”‚   β”‚   β”œβ”€β”€ authRoutes.js            # Auth endpoints
β”‚   β”‚   β”œβ”€β”€ projectRoutes.js         # Project endpoints
β”‚   β”‚   β”œβ”€β”€ taskRoutes.js            # Task endpoints
β”‚   β”‚   β”œβ”€β”€ userRoutes.js            # User endpoints
β”‚   β”‚   └── reportRoutes.js          # Report endpoints
β”‚   β”œβ”€β”€ uploads/                     # Uploaded files directory
β”‚   β”œβ”€β”€ .env                         # Environment variables
β”‚   β”œβ”€β”€ package.json
β”‚   └── server.js                    # Express server
β”‚
└── frontend/Task-Manager/
    β”œβ”€β”€ src/
    β”‚   β”œβ”€β”€ components/
    β”‚   β”‚   β”œβ”€β”€ Sidebar.jsx          # Navigation sidebar
    β”‚   β”‚   └── ProjectCard.jsx      # Project card component
    β”‚   β”œβ”€β”€ pages/
    β”‚   β”‚   β”œβ”€β”€ Admin/
    β”‚   β”‚   β”‚   β”œβ”€β”€ Dashboard.jsx     # Admin dashboard
    β”‚   β”‚   β”‚   β”œβ”€β”€ Projects.jsx      # Project list
    β”‚   β”‚   β”‚   β”œβ”€β”€ ProjectDetails.jsx # Project details
    β”‚   β”‚   β”‚   β”œβ”€β”€ ProjectForm.jsx   # Create/Edit project
    β”‚   β”‚   β”‚   β”œβ”€β”€ ManageTask.jsx    # Task list
    β”‚   β”‚   β”‚   β”œβ”€β”€ CreateTask.jsx    # Create/Edit task
    β”‚   β”‚   β”‚   └── ManageUsers.jsx   # User management
    β”‚   β”‚   β”œβ”€β”€ Users/
    β”‚   β”‚   β”‚   β”œβ”€β”€ UserDashboard.jsx # User dashboard
    β”‚   β”‚   β”‚   β”œβ”€β”€ MyTasks.jsx       # User's tasks
    β”‚   β”‚   β”‚   └── ViewTaskDetails.jsx # Task details
    β”‚   β”‚   └── Auth/
    β”‚   β”‚       β”œβ”€β”€ Login.jsx          # Login page
    β”‚   β”‚       └── SignUp.jsx         # Registration page
    β”‚   β”œβ”€β”€ services/
    β”‚   β”‚   β”œβ”€β”€ projectService.js     # Project API calls
    β”‚   β”‚   └── taskService.js        # Task API calls
    β”‚   β”œβ”€β”€ utils/
    β”‚   β”‚   β”œβ”€β”€ axiosInstance.js      # Axios configuration
    β”‚   β”‚   └── apiPaths.js           # API endpoints
    β”‚   β”œβ”€β”€ App.jsx                    # Main app component
    β”‚   └── main.jsx                   # React entry point
    └── package.json

πŸš€ Getting Started

Prerequisites

  • Node.js (v16 or higher)
  • MongoDB (v4.4 or higher)
  • npm or yarn

πŸ”§ Backend Setup

  1. Navigate to backend directory:

    cd backend
  2. Install dependencies:

    npm install
  3. Create .env file:

    # Server Configuration
    PORT=5000
    
    # MongoDB Configuration
    MONGO_URI=mongodb://localhost:27017/task-manager
    
    # JWT Configuration
    JWT_SECRET=your_super_secret_jwt_key_here
    
    # Admin Configuration
    ADMIN_INVITE_TOKEN=admin_secret_token_123
    
    # Client Configuration
    CLIENT_URL=http://localhost:5173
  4. Start the server:

    npm start

    Server will run on http://localhost:5000

🎨 Frontend Setup

  1. Navigate to frontend directory:

    cd frontend/Task-Manager
  2. Install dependencies:

    npm install
  3. Create .env file (if needed):

    VITE_API_URL=http://localhost:5000/api
  4. Start the development server:

    npm run dev

    Frontend will run on http://localhost:5173


πŸ“Š API Documentation

πŸ” Authentication Endpoints

Method Endpoint Description Access
POST /api/auth/register Register new user Public
POST /api/auth/login User login Public
GET /api/auth/profile Get user profile Private
PUT /api/auth/profile Update profile Private

πŸ“ Project Endpoints

Method Endpoint Description Access
GET /api/projects Get all projects Private
GET /api/projects/:id Get project details Private
POST /api/projects Create new project Admin
PUT /api/projects/:id Update project Admin
DELETE /api/projects/:id Delete project Admin
GET /api/projects/:id/tasks Get project tasks Private
GET /api/projects/:id/stats Get project statistics Private

πŸ“‹ Task Endpoints

Method Endpoint Description Access
GET /api/tasks Get all tasks Private
GET /api/tasks/:id Get task by ID Private
POST /api/tasks Create new task Admin
PUT /api/tasks/:id Update task Private
DELETE /api/tasks/:id Delete task Admin
PUT /api/tasks/:id/status Update task status Private
PUT /api/tasks/:id/todo Update task checklist Private
GET /api/tasks/dashboard-data Get dashboard data Admin
GET /api/tasks/user-dashboard-data Get user dashboard Private

πŸ‘₯ User Endpoints

Method Endpoint Description Access
GET /api/users Get all users Admin
GET /api/users/:id Get user by ID Admin

πŸ“Š Report Endpoints

Method Endpoint Description Access
GET /api/reports/export/tasks Export tasks to Excel Admin
GET /api/reports/export/user Export user report Private

πŸ”‘ Environment Variables

Backend (.env)

Variable Description Required Example
PORT Server port No 5000
MONGO_URI MongoDB connection string Yes mongodb://localhost:27017/task-manager
JWT_SECRET JWT signing secret Yes your_secret_key
ADMIN_INVITE_TOKEN Token for admin registration Yes admin_secret_123
CLIENT_URL Frontend URL for CORS No http://localhost:5173

Frontend (.env)

Variable Description Required Example
VITE_API_URL Backend API URL No http://localhost:5000/api

🎯 Usage Guide

Creating a Project (Admin Only)

  1. Login as Admin

    • Use admin credentials
    • Navigate to Projects page
  2. Create New Project

    • Click "New Project" button
    • Fill in project details:
      • Project name (required)
      • Description (required)
      • Start and end dates (required)
      • Priority (Low/Medium/High)
      • Budget
      • Status (Planning/Active/On-Hold/Completed/Cancelled)
    • Click "Create Project"
  3. Manage Project

    • View project details
    • Edit project information
    • Track project progress
    • View all project tasks

Creating Tasks (Admin Only)

  1. Navigate to Tasks

    • Go to Tasks page OR
    • Click "Add Task" from a Project
  2. Fill Task Details

    • Project (required) - Select the project
    • Title (required) - Task name
    • Description - Task details
    • Priority - Low/Medium/High
    • Due Date (required)
    • Assign To - Select team members
    • Todo Checklist - Add subtasks
    • Attachments - Upload files
  3. Task Status

    • Tasks start as "Pending"
    • Update to "In-Progress" when working
    • Mark as "Completed" when done

User Workflow

  1. Login

    • Use member credentials
    • View personal dashboard
  2. View Projects

    • See all projects you're assigned to
    • View project details and tasks
  3. Manage Tasks

    • View all your assigned tasks
    • Update task status
    • Check off todo items
    • View task details

πŸ” User Roles & Permissions

Admin Permissions

  • βœ… Create, edit, delete projects
  • βœ… Create, edit, delete tasks
  • βœ… Assign tasks to users
  • βœ… View all projects and tasks
  • βœ… Manage users
  • βœ… Export reports
  • βœ… Access admin dashboard

Member (User) Permissions

  • βœ… View assigned projects
  • βœ… View assigned tasks
  • βœ… Update task status
  • βœ… Update task checklists
  • βœ… View task details
  • ❌ Create/delete projects
  • ❌ Create/delete tasks
  • ❌ Manage users

πŸ“¦ Key Dependencies

Backend

  • express - Web framework
  • mongoose - MongoDB ODM
  • jsonwebtoken - JWT authentication
  • bcryptjs - Password hashing
  • cors - Cross-origin resource sharing
  • dotenv - Environment variables
  • multer - File upload handling
  • exceljs - Excel report generation

Frontend

  • react - UI library
  • react-router-dom - Routing
  • axios - HTTP client
  • react-hot-toast - Toast notifications
  • react-icons - Icon library
  • moment - Date formatting
  • recharts - Charts and graphs
  • tailwindcss - Utility-first CSS

🎨 UI Features

  • Modern Design - Clean, professional interface
  • Responsive Layout - Works on desktop, tablet, and mobile
  • Dark Sidebar - Elegant navigation
  • Color-Coded Status - Easy visual status identification
  • Real-time Updates - Instant feedback on actions
  • Loading States - Smooth loading indicators
  • Form Validation - Client-side validation
  • Toast Notifications - User-friendly alerts

πŸ” Security Features

  • JWT Authentication - Secure token-based auth
  • Password Hashing - bcrypt encryption
  • Protected Routes - Role-based access control
  • Input Validation - Server-side validation
  • CORS Configuration - Secure cross-origin requests
  • HTTP-Only Tokens - Secure token storage

πŸš€ Deployment

Backend Deployment (Render, Heroku, Railway, etc.)

  1. Set environment variables on hosting platform
  2. Update MONGO_URI to production MongoDB (MongoDB Atlas)
  3. Set CLIENT_URL to production frontend URL
  4. Deploy backend code

Frontend Deployment (Vercel, Netlify, etc.)

  1. Update VITE_API_URL to production backend URL
  2. Build the project: npm run build
  3. Deploy the dist folder

πŸ› Troubleshooting

Common Issues

MongoDB Connection Error

  • Ensure MongoDB is running
  • Check MONGO_URI in .env
  • Verify network connectivity

CORS Error

  • Set correct CLIENT_URL in backend .env
  • Check frontend API URL configuration

JWT Token Error

  • Clear browser local storage
  • Re-login to get a new token

Tasks Require Project Error

  • Ensure all tasks have a project assigned
  • Check that project exists before creating tasks

πŸ“ To-Do / Future Enhancements

  • Real-time notifications (Socket.io)
  • Email notifications
  • Task comments and activity log
  • File preview for attachments
  • Drag-and-drop task management
  • Calendar view for tasks
  • Team chat/messaging
  • Time tracking
  • Project templates
  • Advanced analytics dashboard

πŸ‘¨β€πŸ’» Author

Created with ❀️ by [Your Name]


πŸ“„ License

This project is MIT licensed.


🀝 Contributing

Contributions, issues, and feature requests are welcome!

  1. Fork the project
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

πŸ“ž Support

If you have any questions or need help, please open an issue in the repository.


⭐ Show Your Support

Give a ⭐️ if this project helped you!


Happy Coding! πŸš€

Releases

No releases published

Packages

No packages published