How abhijanbarik/to-do_ci-cd works
Project type and purpose
• This is a full-stack web application built with Django (Python) serving as a simple “Todo” list manager.
• It includes a web frontend (HTML/CSS templates and static assets), a Django application layer (views, URLs, models), and a SQLite database. It also contains CI/CD (Jenkinsfile), containerization hints (Dockerfile.txt), and Kubernetes deployment manifests (pod.yaml, service.yaml, deploy.yaml).
File structure
• Top-level:
• manage.py (Django CLI entry point)
• todoApp/ (Django project settings, URL routing, WSGI)
• todos/ (Django application: models, views, URLs, admin, migrations, templates)
• staticfiles/ (compiled static assets)
• Configuration: Dockerfile.txt, Jenkinsfile.txt, deploy.yaml, pod.yaml, service.yaml
• db.sqlite3 (development database)
• Patterns: MVC (Models in todos/models.py; Views in todos/views.py & todoApp/views.py; Templates in todos/templates)
• Deployment: Kubernetes manifests, CI/CD pipeline description (Jenkinsfile.txt).
Key insights from README
• States the core functionality (CRUD on Todo items).
• Dependencies: Django, SQLite.
• Local development flow: makemigrations → migrate → createsuperuser → runserver.
• Mentions a screenshot of the running app.
Main components and relationships
a. Components
1. Client (Web browser)
2. Web Layer (HTTP server / Gunicorn or Django dev server)
3. Django Project (todoApp)
• URL Router (todoApp/urls.py)
• WSGI entry point (todoApp/wsgi.py)
4. Django App (todos)
• Views (todos/views.py)
• Models (todos/models.py)
• Templates & Static files (todos/templates, staticfiles/)
5. SQLite Database (db.sqlite3)
6. Admin Interface (Django Admin)
7. CI/CD (Jenkins server executing Jenkinsfile.txt)
8. Containerization layer (Docker image built from Dockerfile.txt)
9. Orchestration (Kubernetes: Pod, Service, Deployment from pod.yaml, service.yaml, deploy.yaml)
10. External Dependencies (e.g., pip, Django package)
b. Relationships & Data Flow
• Browser → HTTP Server: GET/POST requests to endpoints under /todos
• HTTP Server → Django URL Router → App Views
• Views ↔ Models → SQLite DB (CRUD operations)
• Views → Templates/Static → HTTP responses to Browser
• Administrator ↔ Admin Interface (special URL under /admin)
• Jenkins → Clone Repo → Build Docker Image → Push to registry → Apply Kubernetes manifests → Pods start the Django container
• Kubernetes Service → Exposes Pod to external traffic
c. Architectural patterns & principles
• MVC/MVT pattern inherent in Django (Model, View, Template)
• Layered architecture: Presentation (static + templates), Application (views + business logic), Data (models + database)
• Infrastructure as code (Kubernetes YAML)
• CI/CD pipeline for continuous deployment
d. Key technologies
• Python 3 + Django Framework
• SQLite (development DB)
• HTML/CSS (staticfiles)
• Gunicorn or Django dev server
• Docker (Dockerfile.txt)
• Jenkins (Jenkinsfile.txt)
• Kubernetes (pod.yaml, service.yaml, deploy.yaml)
– Blue rectangles: user-facing components (Browser, Templates)
– Green rectangles: application components (Views, Models)