A modern, full-stack task management application built with the MERN stack. TaskPilot enables seamless collaboration between administrators and employees, featuring AI-powered task generation, real-time analytics, and an intuitive user interface.
- User Authentication & Authorization - Secure JWT-based authentication with role-based access control
- Role-Based Dashboards - Separate interfaces for administrators and employees
- Task Management - Complete CRUD operations for task creation, editing, deletion, and tracking
- Task Status Tracking - Monitor tasks with statuses: assigned, completed, and failed
- Automatic Task Failure Detection - Tasks automatically marked as failed when past due date
- Employee Assignment - Assign tasks to specific employees with due dates and priorities
- AI-Powered Task Descriptions - Automatically generate professional task descriptions using Google Gemini AI
- Smart Categorization - AI suggests appropriate categories (General, Design, Development, Debugging) and priorities (General, Average, High) based on task titles
- Task Status Distribution - Visual pie chart showing task status breakdown
- Employee Performance Metrics - Bar chart displaying tasks completed per employee
- Responsive Charts - Interactive charts built with Recharts, optimized for all screen sizes
- Modern UI/UX - Beautiful, responsive design built with Tailwind CSS
- Interactive Alerts - User-friendly notifications using SweetAlert2
- Real-time Updates with Socket.IO - Live task status updates and instant notifications without page refresh. Admins can push tasks in real-time, and employees receive instant updates. When employees mark tasks as complete, admins see the changes immediately in their dashboard
- React 19 - Modern React with latest features
- Vite - Fast build tool and development server
- Tailwind CSS - Utility-first CSS framework for rapid UI development
- React Icons - Comprehensive icon library
- Recharts - Composable charting library for React
- SweetAlert2 - Beautiful, responsive, customizable popup boxes
- Node.js - JavaScript runtime environment
- Express.js - Fast, unopinionated web framework
- MongoDB Atlas - Cloud-hosted MongoDB database
- Mongoose - MongoDB object modeling for Node.js
- JWT (jsonwebtoken) - Secure token-based authentication
- bcryptjs - Password hashing for secure authentication
- Google Generative AI - AI integration for task enhancement
- CORS - Cross-origin resource sharing support
- Cookie Parser - HTTP cookie parsing middleware
- Socket.IO - Real-time bidirectional communication for live task updates
- Nodemon - Automatic server restart during development
- ESLint - Code linting and quality assurance
- dotenv - Environment variable management
Before you begin, ensure you have the following installed:
- Node.js (v16 or higher)
- npm (v8 or higher) or yarn
- MongoDB Atlas account (or local MongoDB instance)
- Google Gemini API Key (for AI features)
git clone https://github.com/your-username/taskpilot.git
cd taskpilotcd server
npm installCreate a .env file in the server directory:
PORT=5000
MONGODB_URI=your_mongodb_atlas_connection_string
JWT_SECRET=your_jwt_secret_key_here
GEMINI_API_KEY=your_google_gemini_api_keyStart the backend server:
npm run devThe server will run on http://localhost:5000
Open a new terminal and navigate to the client directory:
cd client
npm installStart the development server:
npm run devThe frontend will run on http://localhost:5173
taskpilot/
β
βββ client/ # React frontend application
β βββ public/ # Static assets
β βββ src/
β β βββ components/ # React components
β β β βββ Analytics/ # Dashboard charts and analytics
β β β βββ Auth/ # Authentication components
β β β βββ Dashboard/ # Admin and Employee dashboards
β β β βββ Footer/ # Footer component
β β β βββ Header/ # Header component
β β β βββ Task Boxes/ # Task management components
β β βββ context/ # React Context providers
β β βββ services/ # API service functions
β β βββ App.jsx # Main application component
β β βββ main.jsx # Application entry point
β βββ package.json
β βββ vite.config.js
β
βββ server/ # Express backend application
β βββ config/ # Configuration files
β β βββ db.js # MongoDB connection
β β βββ gemini.service.js # AI service integration
β βββ controllers/ # Route controllers
β β βββ adminController.js
β β βββ authController.js
β β βββ employeeController.js
β β βββ geminiController.js
β β βββ taskController.js
β βββ middleware/ # Custom middleware
β β βββ authCheck.middleware.js
β β βββ errorHandler.middleware.js
β β βββ logger.middleware.js
β β βββ roleCheck.middleware.js
β βββ models/ # Mongoose data models
β β βββ admin.model.js
β β βββ employee.model.js
β β βββ task.model.js
β βββ routes/ # API routes
β β βββ adminRoutes.js
β β βββ authRoutes.js
β β βββ employeeRoutes.js
β β βββ geminiRoutes.js
β β βββ taskRoutes.js
β βββ index.js # Server entry point
β βββ package.json
β
βββ README.md
POST /api/auth/login- User loginPOST /api/auth/logout- User logoutGET /api/auth/me- Get current authenticated user
GET /api/tasks- Get all tasks (Admin & Employee)POST /api/tasks- Create a new task (Admin only)PATCH /api/tasks/:taskId/complete- Mark task as completed (Employee only)PATCH /api/tasks/:taskId/edit- Edit a task (Admin only)DELETE /api/tasks/:taskId/delete- Delete a task (Admin only)
GET /api/allemployees- Get all employees (for task assignment dropdown)
POST /api/ai/gendesc- Generate task description using AI (requires task title in request body)POST /api/ai/gencatpri- Generate category and priority suggestions (requires task title in request body)
GET /healthcheck- Server health check endpoint
The application uses JWT (JSON Web Tokens) for authentication. Tokens are stored in HTTP-only cookies for enhanced security.
- Admin: Full access to all features including task creation, editing, deletion, and analytics
- Employee: Access to assigned tasks, ability to mark tasks as completed, view personal task list
All task management routes require authentication. Role-based middleware ensures that only authorized users can perform specific actions.
- Assigned: Newly created tasks assigned to employees
- Completed: Tasks marked as completed by employees
- Failed: Tasks automatically marked as failed when past their due date
The application leverages Google Gemini AI to:
- Generate professional task descriptions from task titles
- Automatically categorize tasks (General, Design, Development, Debugging)
- Suggest appropriate priority levels (General, Average, High)
The admin dashboard includes:
- Task Status Distribution: Visual representation of task completion rates
- Employee Performance: Track tasks completed by each employee
- Real-time data updates as tasks are created and completed
TaskPilot leverages Socket.IO for seamless real-time collaboration:
- Admin Task Push: Admins can create and push tasks, which are instantly delivered to assigned employees without page refresh
- Live Employee Dashboard Updates: Employees receive instant notifications when new tasks are assigned and their dashboard updates in real-time
- Instant Task Completion Feedback: When an employee marks a task as complete, the admin dashboard updates immediately, allowing admins to monitor progress without refreshing
- Bidirectional Communication: Enables seamless communication between admin and employee interfaces, ensuring all users are always viewing the latest data
The frontend is configured for deployment on platforms like Netlify or Vercel. Update the CORS configuration in server/index.js to include your production frontend URL.
The backend can be deployed on platforms like:
- Heroku
- Railway
- Render
- AWS EC2
- DigitalOcean
Ensure environment variables are properly configured in your deployment platform.
Backend:
cd server
npm run devFrontend:
cd client
npm run devFrontend:
cd client
npm run buildBackend:
cd server
npm startPORT=5000
MONGODB_URI=mongodb+srv://username:password@cluster.mongodb.net/dbname
JWT_SECRET=your_super_secret_jwt_key_here
GEMINI_API_KEY=your_google_gemini_api_keytitle(String, required)description(String)category(String, required)priority(String: Low, Medium, High, Average, General)status(String: assigned, completed)dueDate(Date, required)assignedTo(ObjectId, reference to Employee)assignedBy(String)createdAt(Date, auto-generated)updatedAt(Date, auto-generated)
name(String, required)email(String, required, unique)password(String, required, hashed)role(String, default: "employee")
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.