{"id":26364961,"url":"https://github.com/kaalpanikh/multi-container-service","last_synced_at":"2026-04-11T10:32:49.892Z","repository":{"id":276911289,"uuid":"930300823","full_name":"kaalpanikh/multi-container-service","owner":"kaalpanikh","description":"Production-ready Todo API with Docker, MongoDB \u0026 Nginx, deployed on AWS EC2 via GitHub Actions CI/CD 🚀","archived":false,"fork":false,"pushed_at":"2025-04-26T04:44:23.000Z","size":111,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-03T14:32:45.595Z","etag":null,"topics":["ansible","aws","aws-ec2","cicd","containerization","devops","docker","docker-compose","express","github-actions","microservices","mongodb","multicontainer","nginx","nodejs","production-ready","rest-api","reverse-proxy","roadmap-sh","todoapp"],"latest_commit_sha":null,"homepage":"http://mca.nikhilmishra.live","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kaalpanikh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-02-10T12:14:42.000Z","updated_at":"2025-04-26T04:44:25.000Z","dependencies_parsed_at":"2025-03-27T09:37:13.642Z","dependency_job_id":"52ff7d64-a810-4175-9020-87740069becc","html_url":"https://github.com/kaalpanikh/multi-container-service","commit_stats":null,"previous_names":["kaalpanikh/multi-container-service"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/kaalpanikh/multi-container-service","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaalpanikh%2Fmulti-container-service","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaalpanikh%2Fmulti-container-service/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaalpanikh%2Fmulti-container-service/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaalpanikh%2Fmulti-container-service/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kaalpanikh","download_url":"https://codeload.github.com/kaalpanikh/multi-container-service/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaalpanikh%2Fmulti-container-service/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31677813,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-11T08:18:19.405Z","status":"ssl_error","status_checked_at":"2026-04-11T08:17:08.892Z","response_time":54,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ansible","aws","aws-ec2","cicd","containerization","devops","docker","docker-compose","express","github-actions","microservices","mongodb","multicontainer","nginx","nodejs","production-ready","rest-api","reverse-proxy","roadmap-sh","todoapp"],"created_at":"2025-03-16T19:28:50.064Z","updated_at":"2026-04-11T10:32:49.858Z","avatar_url":"https://github.com/kaalpanikh.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Multi-Container Todo Application\n\nA production-ready multi-container application deployed on AWS EC2 with automated CI/CD pipeline. The application consists of a Node.js Todo API, MongoDB database, and Nginx reverse proxy, all orchestrated using Docker Compose.\n\n## Project Page\nThis project is part of the [DevOps Project Based Learning](https://roadmap.sh/projects/multi-container-service) curriculum\n\n## Live Demo\n- **URL**: [http://mca.nikhilmishra.live](http://mca.nikhilmishra.live)\n- **API Endpoints**: \n  - `GET /health` - Health check endpoint\n  - `GET /api/todos` - List all todos\n  - `POST /api/todos` - Create a new todo\n  - `GET /api/todos/:id` - Get a specific todo\n  - `PUT /api/todos/:id` - Update a todo\n  - `DELETE /api/todos/:id` - Delete a todo\n\n## Project Overview\n\n### Architecture\n\n```mermaid\nflowchart TB\n    Client([Client])-. HTTP Request .-\u003eNginx\n    subgraph AWS EC2\n        Nginx[Nginx Reverse Proxy]\n        API[Node.js Todo API]\n        MongoDB[(MongoDB Database)]\n        Nginx--\u003eAPI\n        API--\u003eMongoDB\n    end\n    GH[GitHub Actions]-.CI/CD Pipeline.-\u003eAPI\n```\n\n### Infrastructure\n- **Control Node**: 44.203.38.191 (Ubuntu)\n- **Target Node**: 3.87.64.105 (Ubuntu)\n- **Domain**: mca.nikhilmishra.live\n\n## Project Structure\n```\nmulti-container-service/\n├── app/                    # Node.js Todo API\n│   ├── src/               # Source code\n│   │   ├── app.js        # Express application setup\n│   │   ├── index.js      # Server entry point\n│   │   ├── models/       # MongoDB models\n│   │   └── routes/       # API routes\n│   ├── test/             # Test files\n│   ├── Dockerfile        # API container configuration\n│   └── package.json      # Node.js dependencies\n├── nginx/                 # Nginx configuration\n│   └── conf.d/           # Nginx server blocks\n├── ansible/              # Ansible playbooks\n│   ├── inventory/        # Host definitions\n│   └── playbooks/        # Deployment playbooks\n├── .github/workflows/    # GitHub Actions CI/CD\n├── .env                  # Environment variables\n└── docker-compose.yml    # Container orchestration\n```\n\n## Implementation Details\n\n### 1. Node.js Todo API\n- Express.js framework\n- MongoDB with Mongoose ODM\n- RESTful endpoints\n- Health check endpoint\n- Error handling middleware\n- Input validation\n\n### 2. Docker Configuration\n- Multi-container setup with Docker Compose\n- Optimized Dockerfile with multi-stage builds\n- Volume management for data persistence\n- Container networking\n- Environment-specific configurations\n\n### 3. Nginx Reverse Proxy\n- Load balancing\n- SSL/TLS termination (planned)\n- Static file serving\n- Proxy configuration\n- Security headers\n\n### 4. CI/CD Pipeline (GitHub Actions)\n- Automated testing\n- Docker image building\n- Container registry publishing\n- Automated deployment\n- Health checks\n\n## Proof of Implementation\n\n### 1. Health Check\n```bash\n$ curl http://mca.nikhilmishra.live/health\n{\"status\":\"ok\",\"mongodb\":\"connected\"}\n```\n\n### 2. Create Todo\n```bash\n$ curl -X POST -H \"Content-Type: application/json\" \\\n  -d '{\"title\":\"Test Todo\",\"description\":\"Testing the API\"}' \\\n  http://mca.nikhilmishra.live/api/todos\n\n{\n  \"title\": \"Test Todo\",\n  \"description\": \"Testing the API\",\n  \"completed\": false,\n  \"_id\": \"67aafed247e49f9194b3e805\",\n  \"createdAt\": \"2025-02-11T10:20:08.462Z\",\n  \"updatedAt\": \"2025-02-11T10:20:08.462Z\"\n}\n```\n\n### 3. List Todos\n```bash\n$ curl http://mca.nikhilmishra.live/api/todos\n[\n  {\n    \"_id\": \"67aafed247e49f9194b3e805\",\n    \"title\": \"Test Todo\",\n    \"description\": \"Testing the API\",\n    \"completed\": false,\n    \"createdAt\": \"2025-02-11T10:20:08.462Z\",\n    \"updatedAt\": \"2025-02-11T10:20:08.462Z\"\n  }\n]\n```\n\n## Development Setup\n\n### Prerequisites\n- Docker and Docker Compose\n- Node.js \u003e= 14.0.0\n- Git\n- Ansible\n\n### Local Development\n1. Clone the repository\n   ```bash\n   git clone https://github.com/kaalpanikh/multi-container-service.git\n   cd multi-container-service\n   ```\n\n2. Install dependencies\n   ```bash\n   cd app\n   npm install\n   ```\n\n3. Start the development environment\n   ```bash\n   docker-compose up -d\n   ```\n\n4. Access the API at http://localhost:3000\n\n## Deployment\n\n### Infrastructure Setup\n1. Provision AWS EC2 instances for control and target nodes\n2. Configure security groups and networking\n3. Set up DNS records\n\n### Automated Deployment\n1. Push changes to the main branch\n2. GitHub Actions will:\n   - Run tests\n   - Build Docker images\n   - Push to container registry\n   - Deploy to target node\n   - Perform health checks\n\n## Future Improvements\n1. Add HTTPS support with Let's Encrypt\n2. Implement container health checks\n3. Add monitoring with Prometheus/Grafana\n4. Set up log aggregation\n5. Implement blue-green deployment\n\n## Contributing\n1. Fork the repository\n2. Create a feature branch\n3. Commit your changes\n4. Push to the branch\n5. Create a Pull Request\n\n## License\nMIT\n\n## Project Status\n✅ CI/CD Pipeline: Working\n✅ API Endpoints: Working\n✅ MongoDB: Connected\n✅ Nginx: Configured\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkaalpanikh%2Fmulti-container-service","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkaalpanikh%2Fmulti-container-service","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkaalpanikh%2Fmulti-container-service/lists"}