A modern, full-stack task management application built with the MERN stack, featuring a clean UI, drag-and-drop functionality, and real-time updates.
- User Authentication: Secure JWT-based authentication with refresh tokens
- Task Management: Full CRUD operations for tasks with priority levels
- Priority Board: Visual Kanban-style board with color-coded priorities
- Real-time Updates: Optimistic updates with React Query
- Responsive Design: Mobile-friendly interface with Tailwind CSS
- Modern UI: Clean components using shadcn/ui
- TypeScript: Full type safety across frontend and backend
- React 18 with TypeScript
- Vite for fast development and building
- Tailwind CSS for styling
- shadcn/ui for beautiful, accessible components
- React Query for server state management
- React Hook Form with Zod validation
- React Router for navigation
- Axios for API calls
- Node.js with Express
- MongoDB with Mongoose ODM
- JWT authentication with refresh tokens
- bcrypt for password hashing
- Express Rate Limiting for security
- Comprehensive validation with express-validator
Task Manager/
βββ backend/ # Node.js/Express API
β βββ src/
β β βββ config/ # Database configuration
β β βββ controllers/ # Route controllers
β β βββ middleware/ # Auth, validation, error handling
β β βββ models/ # Mongoose schemas
β β βββ routes/ # API routes
β β βββ utils/ # Utilities (JWT, colors)
β β βββ server.js # Express app entry point
β βββ package.json
β βββ .env.example
βββ frontend/ # React application
β βββ src/
β β βββ components/ # Reusable UI components
β β βββ contexts/ # React contexts (Auth)
β β βββ hooks/ # Custom hooks (React Query)
β β βββ lib/ # API client and utilities
β β βββ pages/ # Page components
β β βββ types/ # TypeScript type definitions
β β βββ main.tsx # React entry point
β βββ package.json
β βββ .env.local
βββ package.json # Workspace configuration
βββ README.md
- Node.js (v18 or higher)
- MongoDB (local or MongoDB Atlas)
- npm or yarn
git clone <repository-url>
cd "Task Manager"# Install workspace dependencies
npm install
# Install backend dependencies
cd backend
npm install
# Install frontend dependencies
cd ../frontend
npm installCreate backend/.env file (copy from .env.example):
NODE_ENV=development
PORT=5000
# Database
MONGODB_URI=mongodb://localhost:27017/cleaner-task-manager
# JWT Secrets (Change these in production!)
JWT_ACCESS_SECRET=your-super-secret-access-token-here-change-in-production
JWT_REFRESH_SECRET=your-super-secret-refresh-token-here-change-in-production
# Token Expiration
JWT_ACCESS_EXPIRES_IN=15m
JWT_REFRESH_EXPIRES_IN=7d
# CORS
FRONTEND_URL=http://localhost:5173Create frontend/.env.local file:
VITE_API_URL=http://localhost:5000/api# From the root directory
npm run devBackend:
cd backend
npm run devFrontend:
cd frontend
npm run dev- Frontend: http://localhost:5173
- Backend API: http://localhost:5000/api
- Health Check: http://localhost:5000/api/health
- Register a new account or Login with existing credentials
- Create tasks using the "Add Task" button
- Organize tasks by priority (High, Medium, Low, Backlog)
- Update task status by clicking the status icon
- View task details by clicking on any task card
- Edit or delete tasks using the action buttons
- Priority Levels: High (Red), Medium (Amber), Low (Green), Backlog (Indigo)
- Status Types: Pending, In Progress, Completed
- Due Dates: Optional with overdue indicators
- Tags: Categorize tasks with custom tags
- Assignees: Assign tasks to team members
POST /api/auth/register # Register new user
POST /api/auth/login # Login user
POST /api/auth/refresh # Refresh access token
POST /api/auth/logout # Logout user
GET /api/auth/me # Get current user
PUT /api/auth/me # Update user profile
GET /api/tasks # Get tasks with filters
POST /api/tasks # Create new task
GET /api/tasks/:id # Get task by ID
PUT /api/tasks/:id # Update task
DELETE /api/tasks/:id # Delete task
PATCH /api/tasks/:id/status # Update task status
PATCH /api/tasks/:id/priority # Update task priority
GET /api/tasks/stats # Get task statistics
GET /api/users # Get users (for assignee dropdown)
GET /api/users/:id # Get user by ID
- Environment Variables: Set all required environment variables
- Database: Use MongoDB Atlas or hosted MongoDB
- Security: Use strong JWT secrets and enable rate limiting
- Platform: Deploy to Heroku, Railway, or similar
- Build: Run
npm run buildin frontend directory - Environment: Set
VITE_API_URLto production API URL - Platform: Deploy to Vercel, Netlify, or similar
# Example Dockerfile for backend
FROM node:18-alpine
WORKDIR /app
COPY package*.json ./
RUN npm ci --only=production
COPY . .
EXPOSE 5000
CMD ["npm", "start"]# Backend tests
cd backend
npm test
# Frontend tests
cd frontend
npm test- Authentication Flow: Register β Login β Logout
- Task Operations: Create β Read β Update β Delete
- Real-time Updates: Multiple browser tabs
- Responsive Design: Different screen sizes
- Error Handling: Network failures, validation errors
- Access Tokens: Short-lived (15 minutes) for API requests
- Refresh Tokens: Long-lived (7 days) stored in httpOnly cookies
- Automatic Refresh: Seamless token renewal on expiry
- Visual Indicators: Color-coded priority levels
- Board Layout: Kanban-style columns for each priority
- Drag & Drop: Move tasks between priorities (coming soon)
- Optimistic Updates: Instant UI feedback
- Cache Management: Smart cache invalidation
- Error Recovery: Automatic rollback on failures
-
MongoDB Connection Error
- Ensure MongoDB is running
- Check MONGODB_URI in .env file
- Verify network connectivity
-
JWT Token Errors
- Check JWT secrets in .env
- Clear browser localStorage
- Restart the server
-
CORS Issues
- Verify FRONTEND_URL in backend .env
- Check if both servers are running
-
Port Already in Use
- Change PORT in backend .env
- Kill existing processes:
lsof -ti:5000 | xargs kill
Enable detailed logging:
NODE_ENV=development
DEBUG=true- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Commit changes:
git commit -m 'Add amazing feature' - Push to branch:
git push origin feature/amazing-feature - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- shadcn/ui for beautiful UI components
- Tailwind CSS for utility-first styling
- React Query for excellent server state management
- MongoDB for flexible document storage
For support and questions:
- Create an issue on GitHub
- Check the troubleshooting section
- Review the API documentation
Happy Task Managing! π