A full-stack collaborative web application built with the MERN stack (MongoDB, Express, React, Node.js) that enables multiple users to manage tasks efficiently within teams.
- User Authentication: Secure signup and login with JWT tokens
- Project Management: Create projects, add/remove team members with role-based access (Admin/Member)
- Task Management: Create, assign, and track tasks with status updates (To Do, In Progress, Done)
- Dashboard: View task metrics including total tasks, status breakdown, assignee distribution, and overdue tasks
- Role-Based Access Control: Admins can manage projects and tasks, Members can update their assigned tasks
- Node.js with Express.js framework
- MongoDB with Mongoose ODM
- JWT for authentication
- bcrypt for password hashing
- express-validator for input validation
- CORS for cross-origin requests
- React 18+ with React Router
- Axios for HTTP requests
- Tailwind CSS for styling
- Vite for build tooling
- Node.js (v16 or higher)
- MongoDB (local installation or MongoDB Atlas account)
- npm or yarn package manager
git clone <repository-url>
cd team-task-managercd backend
npm installCreate a .env file in the backend directory:
# Database Configuration
MONGODB_URI=mongodb://localhost:27017/team-task-manager
# JWT Configuration
JWT_SECRET=your-secret-key-here-change-in-production
JWT_EXPIRES_IN=7d
# Server Configuration
PORT=3000
NODE_ENV=development
# CORS Configuration
FRONTEND_URL=http://localhost:3001cd frontend
npm installCreate a .env file in the frontend directory:
# API Configuration
VITE_API_URL=http://localhost:3000/apiMake sure MongoDB is running locally or you have a connection to MongoDB Atlas.
cd backend
npm run devThe backend API will run on http://localhost:3000
cd frontend
npm run devThe frontend will run on http://localhost:3001 (or the port shown in terminal)
POST /api/auth/register- Register a new userPOST /api/auth/login- Login and get JWT tokenGET /api/auth/me- Get current user info (requires authentication)
POST /api/projects- Create a new project (requires authentication)GET /api/projects- Get all user's projects (requires authentication)POST /api/projects/:projectId/members- Add member to project (requires admin)DELETE /api/projects/:projectId/members/:userId- Remove member from project (requires admin)
POST /api/tasks- Create a new task (requires admin)GET /api/tasks- Get user's assigned tasks (requires authentication)GET /api/tasks?projectId=<id>- Get project tasks (requires project access)PUT /api/tasks/:taskId/assign- Assign task to user (requires admin)PUT /api/tasks/:taskId/status- Update task status (requires admin or assignee)
GET /api/dashboard/metrics- Get dashboard metrics (requires authentication)
GET /api/health- Check API and database health
{
_id: ObjectId,
name: String,
email: String (unique, indexed),
passwordHash: String,
createdAt: Date,
updatedAt: Date
}{
_id: ObjectId,
name: String,
adminId: ObjectId (ref: User),
members: [ObjectId] (ref: User),
createdAt: Date,
updatedAt: Date
}{
_id: ObjectId,
title: String,
description: String,
dueDate: Date,
priority: String (enum: Low, Medium, High),
status: String (enum: To Do, In Progress, Done),
projectId: ObjectId (ref: Project),
assigneeId: ObjectId (ref: User),
createdAt: Date,
updatedAt: Date
}cd backend
npm testcd backend
npm startcd frontend
npm run build
npm run start- GitHub repository
- Railway account
- Push code to GitHub
git add .
git commit -m "Initial commit"
git push origin main-
Create Railway Project
- Go to Railway.app
- Click "New Project"
- Select "Deploy from GitHub repo"
- Choose your repository
-
Add MongoDB
- In Railway dashboard, click "New"
- Select "Database" β "Add MongoDB"
- Or use MongoDB Atlas and add connection string to environment variables
-
Configure Environment Variables
Backend service:
MONGODB_URI=<your-mongodb-connection-string>
JWT_SECRET=<your-secret-key>
JWT_EXPIRES_IN=7d
PORT=3000
NODE_ENV=production
FRONTEND_URL=<your-frontend-url>
Frontend service:
VITE_API_URL=<your-backend-url>/api
- Deploy
- Railway will automatically deploy on push to main branch
- Access your app via the generated Railway URL
- MongoDB connection and configuration
- Mongoose models (User, Project, Task)
- Authentication service with JWT
- Project service with role-based access
- Task service with assignment and status management
- Dashboard service with metrics calculation
- All API routes and endpoints
- Input validation and error handling
- Health check endpoint
- React application setup
- Authentication UI (Login/Register pages)
- Project management UI
- Task management UI
- Dashboard UI
- API integration with Axios
- State management with Context API
- Routing with React Router
- Responsive design with Tailwind CSS
-
Complete Frontend Implementation (Tasks 18-25)
- Set up React project structure
- Create authentication pages
- Build project and task management interfaces
- Implement dashboard with metrics visualization
-
Add Security Middleware (Task 15.3)
- Implement helmet for security headers
- Add rate limiting
- Configure CORS properly
-
Testing (Optional tasks marked with *)
- Write unit tests for services
- Write integration tests for API endpoints
- Write property-based tests for validation functions
-
Documentation (Task 28)
- Complete API documentation
- Add deployment guide
- Create demo video
This is a coding assignment project. For production use, consider adding:
- Comprehensive test coverage
- CI/CD pipeline
- Logging and monitoring
- Rate limiting and security hardening
- Email verification
- Password reset functionality
- Real-time updates with WebSockets
ISC
Your Name
Note: This application was built as part of a full-stack coding assignment. The backend is fully functional and ready for frontend integration.