# aqibhafeez473/django-todo-cicd architecture

> Architecture diagram of the GitHub repository aqibhafeez473/django-todo-cicd, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-06-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/aqibhafeez473/django-todo-cicd
- Repository: https://github.com/aqibhafeez473/django-todo-cicd

## Overview

##### Project type and purpose
- This is a full-stack, monolithic Django “todo” web application with built-in templating for the UI and a simple persistence layer (SQLite in dev, with Kubernetes manifests for a MySQL alternative in prod). It is containerized via Docker, orchestrated via Docker-Compose locally and Kubernetes in production, and includes CI/CD pipelines (GitHub Actions + Jenkinsfiles).

##### File structure
- Top-level:
- Dockerfile, docker-compose.yml, .dockerignore – container build
- Jenkinsfile* – multiple CI/CD pipeline definitions
- .github/workflows/docker-build.yml – GitHub Actions CI
- k8s/ – Kubernetes manifests (deployments, services, configMap, secret for MySQL)
- volume/ – host volume mapping for persistent SQLite data
- manage.py & db.sqlite3 – Django project entry and dev database
- staticfiles/ – compiled static assets (CSS)
- Django project:
- todoApp/ – core project config (settings, URLs, WSGI)
- todos/ – app module (models, views, URLs, templates, migrations, admin)

##### README
- Confirms it’s a simple Django ToDo app, uses SQLite by default, and instructions to run migrations, create superuser, start dev server on 127.0.0.1:8000/todos.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% External Client
    Browser["User Browser\nHTTP :8000"]:::external

    %% Development & CI/CD
    subgraph "Development & CI/CD"
        direction TB
        GH["GitHub"]:::external
        GA["GitHub Actions\n.docker-build.yml"]:::cicd
        Jenkins["Jenkins Pipelines\nJenkinsfile*"]:::cicd
        Registry["Docker Registry"]:::external

        GH -->|push code| GA
        GH -->|push code| Jenkins
        GA -->|build image| Registry
        Jenkins -->|build/deploy image| Registry
    end

    %% Local Development
    subgraph "Local Development (Docker-Compose)"
        direction TB
        Compose["docker-compose.yml\n(Web & SQLite)"]:::orchestration
        Dockerfile["Dockerfile"]:::orchestration
        SQLite["SQLite File\ndb.sqlite3"]:::data

        Compose --> Dockerfile
        Compose --> SQLite
        Browser -->|HTTP| Compose
    end

    %% Production Environment
    subgraph "Production (Kubernetes Cluster)"
        direction TB

        Registry -->|pull image| WebService["Django Web Pod\ndeployment.yaml"]:::compute
        K8sAPI["Kubernetes API Server"]:::external
        K8sAPI --> WebService

        subgraph "Django Application"
            direction TB
            Settings["settings.py"]:::code
            WSGI["wsgi.py"]:::code
            ProjectURLs["todoApp/urls.py"]:::code
            AppURLs["todos/urls.py"]:::code
            Views["todos/views.py"]:::code
            Models["todos/models.py"]:::code
            Admin["todos/admin.py"]:::code
            Migrations["migrations/"]:::code
            BaseHTML["base.html"]:::code
            IndexHTML["index.html"]:::code
            StaticCSS["style.css"]:::code
            ManageCLI["manage.py"]:::code

            Settings --> ProjectURLs --> AppURLs
            AppURLs --> Views
            Views --> Models
            Views --> Templates
            Templates["templates"]:::code --> BaseHTML & IndexHTML
            Views --> StaticCSS
            ManageCLI --> Views
        end

        click Settings "https://github.com/aqibhafeez473/django-todo-cicd/blob/develop/todoApp/settings.py"
        click WSGI "https://github.com/aqibhafeez473/django-todo-cicd/blob/develop/todoApp/wsgi.py"
        click ProjectURLs "https://github.com/aqibhafeez473/django-todo-cicd/blob/develop/todoApp/urls.py"
        click AppURLs "https://github.com/aqibhafeez473/django-todo-cicd/blob/develop/todos/urls.py"
        click Views "https://github.com/aqibhafeez473/django-todo-cicd/blob/develop/todos/views.py"
        click Models "https://github.com/aqibhafeez473/django-todo-cicd/blob/develop/todos/models.py"
        click Admin "https://github.com/aqibhafeez473/django-todo-cicd/blob/develop/todos/admin.py"
        click Migrations "https://github.com/aqibhafeez473/django-todo-cicd/tree/develop/todos/migrations/"
        click BaseHTML "https://github.com/aqibhafeez473/django-todo-cicd/blob/develop/todos/templates/todos/base.html"
        click IndexHTML "https://github.com/aqibhafeez473/django-todo-cicd/blob/develop/todos/templates/todos/index.html"
        click StaticCSS "https://github.com/aqibhafeez473/django-todo-cicd/blob/develop/staticfiles/css/style.css"
        click ManageCLI "https://github.com/aqibhafeez473/django-todo-cicd/blob/develop/manage.py"

        subgraph "Database Tier"
            direction TB
            MySQLDep["MySQL Deployment"]:::data
            MySQLSvc["MySQL Service\nservice.yaml"]:::data
            PVC["PersistentVolumeClaim"]:::data

            MySQLDep --> PVC
            MySQLSvc --> MySQLDep
            WebService -->|TCP:3306| MySQLSvc
        end

        subgraph "K8s Configuration"
            direction TB
            ConfigMap["ConfigMap"]:::external
            Secret["Secret"]:::external

            ConfigMap --> WebService
            Secret --> WebService

            click ConfigMap "https://github.com/aqibhafeez473/django-todo-cicd/blob/develop/k8s/MYSQL-DB/configMap.yml"
            click Secret "https://github.com/aqibhafeez473/django-todo-cicd/blob/develop/k8s/MYSQL-DB/secret.yml"
        end

        Browser -->|HTTP| WebService
    end

    %% Classes
    classDef compute fill:#ADD8E6,stroke:#000;
    classDef data fill:#FFA500,stroke:#000;
    classDef cicd  fill:#90EE90,stroke:#000;
    classDef external fill:#D3D3D3,stroke:#000;
    classDef orchestration fill:#D8BFD8,stroke:#000;
    classDef code fill:#AED6F1,stroke:#000;
```
