A Node.js backend application for managing projects, tasks, and team collaboration. Built with Express.js, MongoDB, and JWT authentication.
- User Authentication: Register, login, email verification, password reset, JWT-based authentication
- Project Management: Create, update, delete projects; manage project members with roles (Admin, Project Admin, Member)
- Task Management: Create tasks within projects, update status (Todo, In Progress, Done), attach files, manage subtasks
- Email Notifications: Integrated email service for verification and notifications
- File Uploads: Support for attaching files to tasks
- Role-Based Access Control: Different permissions based on user roles
- Backend: Node.js, Express.js
- Database: MongoDB with Mongoose ODM
- Authentication: JWT (JSON Web Tokens)
- Email: Nodemailer with Mailtrap
- File Uploads: Multer
- Validation: Express Validator
- Password Hashing: bcrypt
- CORS: Enabled for cross-origin requests
-
Clone the repository:
git clone <repository-url> cd projectmanagementplatform
-
Install dependencies:
npm install
-
Set up environment variables: Create a
.envfile in the root directory with the following variables:PORT=8000 MONGO_URI=mongodb://localhost:27017/projectmanagement CORS_ORIGIN=http://localhost:5173 ACCESS_TOKEN_SECRET=your_access_token_secret REFRESH_TOKEN_SECRET=your_refresh_token_secret MAILTRAP_SMTP_HOST=smtp.mailtrap.io MAILTRAP_SMTP_PORT=2525 MAILTRAP_SMTP_USER=your_mailtrap_user MAILTRAP_SMTP_PASS=your_mailtrap_pass
-
Start the development server:
npm run dev
The server will start on
http://localhost:8000.
POST /api/v1/auth/register- Register a new userPOST /api/v1/auth/login- Login userPOST /api/v1/auth/logout- Logout userGET /api/v1/auth/verify-email/:verificationToken- Verify emailPOST /api/v1/auth/refresh-token- Refresh access tokenPOST /api/v1/auth/forgotPassword- Request password resetPOST /api/v1/auth/reset-password/:resetToken- Reset passwordPOST /api/v1/auth/current-user- Get current user infoPOST /api/v1/auth/change-password- Change passwordPOST /api/v1/auth/resend-email-verification- Resend verification email
GET /api/v1/projects- Get all projects for userPOST /api/v1/projects- Create a new projectGET /api/v1/projects/:projectId- Get project by IDPUT /api/v1/projects/:projectId- Update projectDELETE /api/v1/projects/:projectId- Delete projectGET /api/v1/projects/:projectId/members- Get project membersPOST /api/v1/projects/:projectId/members- Add members to projectPUT /api/v1/projects/:projectId/members/:memberId- Update member roleDELETE /api/v1/projects/:projectId/members/:memberId- Remove member
GET /api/v1/projects/:projectId/tasks- Get tasks for projectPOST /api/v1/projects/:projectId/tasks- Create a new taskGET /api/v1/projects/:projectId/tasks/:taskId- Get task by IDPUT /api/v1/projects/:projectId/tasks/:taskId- Update taskDELETE /api/v1/projects/:projectId/tasks/:taskId- Delete taskPUT /api/v1/projects/:projectId/tasks/:taskId/subtasks/:subtaskId- Update subtaskDELETE /api/v1/projects/:projectId/tasks/:taskId/subtasks/:subtaskId- Delete subtask
GET /api/v1/healthcheck- Health check endpoint
src/
├── app.js # Express app setup
├── index.js # Server entry point
├── controllers/ # Route handlers
├── db/ # Database connection
├── middlewares/ # Custom middlewares (auth, validation, multer)
├── models/ # Mongoose models
├── routes/ # API routes
├── utils/ # Utility functions (mail, constants, etc.)
└── validators/ # Input validation schemas