A full-stack task management application built with React, Express, MongoDB, and Docker.
- User registration and login with JWT authentication
- Create, view, update, and delete tasks
- Filter tasks by status (All, Active, Completed)
- Task attributes: title, description, status, priority, creation date, user ID
- Responsive UI with Tailwind CSS
- Dockerized for easy setup
- Frontend: React 19, React Router, Tailwind CSS, Vite
- Backend: Express, MongoDB, Mongoose, JWT, bcrypt
- DevOps: Docker, Docker Compose
- State Management: React Context for auth, local state for tasks
- Custom Hook:
useAuthfor authentication
- Frontend: Single-page React app with routes for login, register, and tasks. Uses Context API for auth state and a custom hook for auth operations.
- Backend: RESTful API with endpoints for auth (
/api/auth) and tasks (/api/tasks). Secured with JWT. - Database: MongoDB with schemas for users (email, password) and tasks (title, description, status, priority, userId, createdAt).
- Docker: Three services (frontend, backend, MongoDB) connected via a bridge network.
{
email: String (required, unique, lowercase),
password: String (required, hashed),
createdAt: Date,
updatedAt: Date
}{
title: String (required),
description: String,
status: String (enum: ['incomplete', 'complete'], default: 'incomplete'),
priority: String (enum: ['Low', 'Medium', 'High'], default: 'Low'),
userId: ObjectId (ref: 'User', required),
createdAt: Date,
updatedAt: Date
}- Docker and Docker Compose
- Node.js (optional for local development without Docker)
- Clone the repository:
git clone <repository-url> cd task-management
- Create a
.envfile intask-management-backendwith:PORT=5001 MONGODB_URI=mongodb://admin:admin123@mongodb:27017/taskdb?authSource=admin JWT_SECRET=your_jwt_secret_key_123
- Start the services:
docker-compose up --build
- Access the app:
- Frontend:
http://localhost:5173 - Backend API:
http://localhost:5001/api
- Frontend:
- Seed the database with test data:
docker-compose exec backend node seed.js
- Backend:
cd task-management-backend npm install node seed.js npm start - Frontend:
cd task-management-frontend npm install npm run dev
- User 1:
user1@example.com/password1 - User 2:
user2@example.com/password2
- React with Vite: Fast development and build times.
- Tailwind CSS: Utility-first CSS for rapid UI development.
- JWT Authentication: Secure and stateless auth mechanism.
- MongoDB: Flexible NoSQL database for rapid prototyping.
- Docker Compose: Simplifies multi-container setup and ensures consistency.
- Context API: Lightweight state management for auth.
- Custom Hook: Encapsulates auth logic for reusability.
- The backend runs on port 5001 to avoid conflicts on macOS.
- Error handling is implemented for API requests and user input.
- PropTypes are used for prop validation in React components.
- Seed script provides sample data for testing.