A simple dockerized todo application with React frontend, Node.js backend, and MongoDB database.
- Add new todos
- View all todos
- Mark todos as complete/incomplete
- Delete todos
- Fully dockerized with Docker Compose
GET /api/todos- Get all todosPOST /api/todos- Add a new todoPOST /api/todos/delete- Delete a todoPOST /api/todos/modify- Modify/update a todo
- Make sure you have Docker and Docker Compose installed
- Clone this repository
- Run the application:
docker-compose up --build- Access the application:
- Frontend: http://localhost:3000
- Backend API: http://localhost:5000
- MongoDB: mongodb://localhost:27017
You can test the API endpoints directly using Postman:
GET http://localhost:5000/api/todos
POST http://localhost:5000/api/todos
Content-Type: application/json
{
"title": "Learn Docker",
"description": "Complete the Docker tutorial"
}
POST http://localhost:5000/api/todos/delete
Content-Type: application/json
{
"id": "todo_id_here"
}
POST http://localhost:5000/api/todos/modify
Content-Type: application/json
{
"id": "todo_id_here",
"title": "Updated title",
"description": "Updated description",
"completed": true
}
To run in development mode:
cd server
npm install
npm run devcd client
npm install
npm run dev- Build and start all services:
docker-compose up --build - Start services in background:
docker-compose up -d - Stop services:
docker-compose down - View logs:
docker-compose logs - Rebuild specific service:
docker-compose build server
- Client: React app built with Vite, served by Nginx
- Server: Node.js Express API with Mongoose ODM
- Database: MongoDB for data persistence
- Networking: All services communicate through a Docker bridge network