A fully containerized full-stack task management application
- API Gateway: Node.js, Express, Http-Proxy-Middleware (Port 5000)
- User Service: Node.js, Express, Mongoose, JWT Authentication (Port 5001)
- Task Service: Node.js, Express, Mongoose (Port 5002)
- Notification Service: Node.js, Express, EmailJS API (Port 5003)
- User Database: MongoDB (Isolated Container: mongo-user)
- Task Database: MongoDB (Isolated Container: mongo-task)
- User Frontend: React, Vite, CSS (Port 5173)
- Admin Frontend: React, Vite, CSS (Port 3000)
- Containerization: Docker
- Orchestration: Docker Compose
- Web Server: Nginx (serving frontends inside containers)
task-manager-api/
├── .gitignore # Project-wide git exclusion file
├── docker-compose.yml # Central Docker Compose orchestration file
├── api-gateway/ # Express gateway proxy on Port 5000
│ ├── Dockerfile
│ └── server.js
├── user-service/ # Manages auth, user profiles, and admin accounts (Port 5001)
│ ├── controllers/
│ ├── models/ # Contains isolated User schema
│ ├── routes/
│ └── Dockerfile
├── task-service/ # Manages task lifecycles and assignments (Port 5002)
│ ├── controllers/
│ ├── models/ # Contains isolated Task schema
│ ├── routes/
│ └── Dockerfile
├── notification-service/ # Handles automated email alerts via EmailJS (Port 5003)
│ ├── utils/ # Email client configurations
│ ├── server.js
│ └── Dockerfile
├── task-manager-user-frontend/ # React application for general task users (Port 5173)
│ ├── src/
│ ├── nginx.conf # Production routing proxy configuration
│ └── Dockerfile
└── task-manager-frontend/ # React application for system administrators (Port 3000)
├── src/
├── nginx.conf # Production routing proxy configuration
└── Dockerfile
Docker Compose is the only supported and required method to build and run the entire application stack.
- Docker Desktop must be installed and running on your system.
- Git must be installed.
You must verify and configure the environment files for each service. Sample or pre-configured .env files must be populated prior to startup. Key env files include:
user-service/.env(contains MONGO_URI, JWT_SECRET, ADMIN_EMAIL, ADMIN_PASSWORD)task-service/.env(contains MONGO_URI, JWT_SECRET)notification-service/.env(contains EMAILJS_PRIVATE_KEY, EMAILJS_PUBLIC_KEY, EMAILJS_SERVICE_ID, EMAILJS_TEMPLATE_ID)task-manager-user-frontend/.env(contains VITE_API_URL pointing to the API Gateway)task-manager-frontend/.env(contains VITE_API_URL pointing to the API Gateway)
Note: In the local microservice environment, the User and Task service databases are automatically hosted by the local MongoDB containers on mongodb://mongo-user:27017/TaskManagerUser and mongodb://mongo-task:27017/TaskManager respectively.
Open a terminal in the root directory and run the following command to compile the code, pull the base images, and initialize the containers:
docker-compose up --build -dOnce execution completes, all 8 containers will be running in the background.
- User Interface: http://localhost:5173
- Admin Dashboard: http://localhost:3000
- API Gateway Entrypoint: http://localhost:5000
Common commands used during developer cycles:
docker-compose psTo inspect system logs globally:
docker-compose logs -fTo tail logs for a specific service (e.g., user-service):
docker-compose logs -f user-serviceIf you modify source code in one of the backend services or static frontends, you must force a rebuild and update the active container:
docker-compose stop <service-name>
docker-compose rm -f <service-name>
docker-compose up -d --build <service-name>Example for task-service:
docker-compose stop task-service; docker-compose rm -f task-service; docker-compose up -d --build task-serviceTo suspend execution and stop all microservice containers:
docker-compose downTo tear down all microservices, networks, and clear persistent volumes:
docker-compose down -v