How divyesh2508/todoapp works
Project type and purpose
• This is a full-stack, containerized web application (“Dockerize Node-ToDo Application”).
• It uses Node.js/Express as the backend providing a CRUD API and EJS/static files for the frontend, and MongoDB as the data store.
• It’s packaged and deployed via Docker (Dockerfile, docker-compose.yml) with CI/CD pipelines defined in GitHub Actions and Jenkins.
File structure
• Top-level directories and files:
• app.js, index.html, views/, public/ → Node/Express server, server-rendered UI and static assets
• Dockerfile, docker-compose.yml → container build and orchestration
• .github/workflows & Jenkinsfile(s) → CI/CD pipelines targeting QA/UAT/PROD and AWS ECR
• test/ → integration tests for the /api/v1 endpoints
• sonar-project.properties, trivy…deb, rollbar.js → code quality, security scanning, error reporting
README for additional insights
• Two services are brought up in a Docker network:
1. A MongoDB container with credentials injected as env vars
2. A todoapp container exposing port 3000, connecting to MongoDB over the custom Docker network
• Uses docker-compose for “up –build -d” to create network, volume, and both containers in one command.
Main components & interactions (to be shown
a. Presentation Layer
• Browser (client) → HTTP(S) → Node/Express container (port 3000)
• Static assets (public/style.css, index.html) and server-rendered views (views/index.ejs) delivered by the backend
b. Application Layer
• app.js (Express server) exposing RESTful endpoints under /api/v1
• Business logic and validation, integration with Rollbar for error reporting
• CI/CD hooks trigger tests (test/integration/api/v1/test.js) and quality/security scans (SonarQube, Trivy)
c. Data Layer
• MongoDB container (mongoserver4) storing todo data in a Docker volume
• Environment variables: MONGO_INITDB_ROOT_USERNAME, MONGO_INITDB_ROOT_PASSWORD
d. Infrastructure & DevOps
• Docker host or cluster where docker-compose runs both containers on todoapp_network
• CI/CD pipelines:
• GitHub Actions workflows push images to AWS ECR
• Jenkins pipelines deploy to QA, UAT, and Production servers
• Artifact flow: Source repo → CI build → Docker image → Registry (ECR) → Deployment
Architectural patterns & design principles
• Three-tier architecture (Presentation, Application, Data)
• Containerization (Docker & docker-compose) for isolation and reproducible environments
• Infrastructure as Code for network, volumes, and build scripts
• Automated CI/CD with quality gates (Sonar, Trivy, integration tests)
• Secure credential management via environment variables
Final checklist
[ ] Presentation (Browser) → Express (port 3000)
[ ] Application (app.js + tests + Rollbar)
[ ] Data (MongoDB + Docker volume)
[ ] Docker network boundary enclosing Node and Mongo containers
[ ] CI/CD section: GitHub Actions, Jenkins, AWS ECR, SonarQube, Trivy