# hussainshaqsi/django-cicd-pipeline architecture

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

- Interactive diagram: https://gitdiagram.com/hussainshaqsi/django-cicd-pipeline
- Repository: https://github.com/hussainshaqsi/django-cicd-pipeline

## Overview

This repository is a small Django site packaged for automated deployment: a visitor reaches a Django response through the configured URL routes, while GitLab CI/CD builds and deploys the container to an Oracle Cloud VM behind Traefik. The README documents HTTPS certificates, DuckDNS, and CI-injected secrets. The chart files suggest a Kubernetes deployment configuration, but the README presents k3s as a next step; its internal wiring is not shown in the excerpts, so those links are marked unverified.

Main entry points: [`.gitlab-ci.yml`](https://github.com/hussainshaqsi/django-cicd-pipeline/blob/main/.gitlab-ci.yml) (CI pipeline), [`config/settings.py`](https://github.com/hussainshaqsi/django-cicd-pipeline/blob/main/config/settings.py) (App configuration), [`docker-compose.yml`](https://github.com/hussainshaqsi/django-cicd-pipeline/blob/main/docker-compose.yml) (Compose deployment), [`chart/templates/deployment.yaml`](https://github.com/hussainshaqsi/django-cicd-pipeline/blob/main/chart/templates/deployment.yaml) (Chart deployment)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Django site"]
  node_django["Django runtime"]
  node_routes["Home and admin routes<br/>[urls.py]"]
  node_settings["App configuration<br/>[settings.py]"]
  node_sqlite[("SQLite database")]
end

subgraph group_deploy["CI and deployment"]
  node_pipeline["CI pipeline<br/>[.gitlab-ci.yml]"]
  node_runner["Self-hosted runner"]
  node_docker["Docker image"]
  node_compose["Compose deployment<br/>[docker-compose.yml]"]
  node_secrets["CI secrets"]
end

subgraph group_edge["Ingress and domain"]
  node_traefik["Traefik proxy"]
  node_certs["Let's Encrypt"]
  node_dns["DuckDNS"]
end

subgraph group_orchestration["Kubernetes chart"]
  node_chartdeploy["Chart deployment<br/>[deployment.yaml]"]
  node_chartservice["Chart service<br/>[service.yaml]"]
  node_chartingress["Chart ingress<br/>[ingress.yaml]"]
  node_chartstorage["Chart storage<br/>[pvc.yaml]"]
end

node_visitor(("Visitor"))
node_gitlab["GitLab"]
node_vm["Oracle Cloud VM"]

node_visitor -->|"visits"| node_traefik
node_traefik -->|"routes traffic"| node_django
node_django -->|"resolves URLs"| node_routes
node_django -->|"loads settings"| node_settings
node_settings -->|"configures database"| node_sqlite
node_gitlab -->|"assigns work"| node_runner
node_runner -->|"runs pipeline"| node_pipeline
node_pipeline -->|"builds image"| node_docker
node_pipeline -->|"deploys container"| node_compose
node_pipeline -->|"injects secrets"| node_secrets
node_runner -->|"runs on"| node_vm
node_compose -->|"starts container"| node_vm
node_traefik -->|"obtains certificates"| node_certs
node_dns -.->|"names site"| node_traefik
node_chartdeploy -.->|"uses service"| node_chartservice
node_chartingress -.->|"targets service"| node_chartservice
node_chartstorage -.->|"mounts storage"| node_chartdeploy

click node_routes "https://github.com/hussainshaqsi/django-cicd-pipeline/blob/main/config/urls.py"
click node_settings "https://github.com/hussainshaqsi/django-cicd-pipeline/blob/main/config/settings.py"
click node_pipeline "https://github.com/hussainshaqsi/django-cicd-pipeline/blob/main/.gitlab-ci.yml"
click node_docker "https://github.com/hussainshaqsi/django-cicd-pipeline/blob/main/Dockerfile"
click node_compose "https://github.com/hussainshaqsi/django-cicd-pipeline/blob/main/docker-compose.yml"
click node_chartdeploy "https://github.com/hussainshaqsi/django-cicd-pipeline/blob/main/chart/templates/deployment.yaml"
click node_chartservice "https://github.com/hussainshaqsi/django-cicd-pipeline/blob/main/chart/templates/service.yaml"
click node_chartingress "https://github.com/hussainshaqsi/django-cicd-pipeline/blob/main/chart/templates/ingress.yaml"
click node_chartstorage "https://github.com/hussainshaqsi/django-cicd-pipeline/blob/main/chart/templates/pvc.yaml"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_django,node_routes,node_settings,node_sqlite toneBlue
class node_pipeline,node_runner,node_docker,node_compose,node_secrets toneAmber
class node_traefik,node_certs,node_dns toneMint
class node_chartdeploy,node_chartservice,node_chartingress,node_chartstorage toneRose
class node_visitor,node_gitlab,node_vm toneIndigo
```

## Components

### Django site

- **Django runtime**
- [Home and admin routes](https://github.com/hussainshaqsi/django-cicd-pipeline/blob/main/config/urls.py): `config/urls.py`
- [App configuration](https://github.com/hussainshaqsi/django-cicd-pipeline/blob/main/config/settings.py): `config/settings.py`
- **SQLite database**

### CI and deployment

- [CI pipeline](https://github.com/hussainshaqsi/django-cicd-pipeline/blob/main/.gitlab-ci.yml): `.gitlab-ci.yml`
- **Self-hosted runner**
- [Docker image](https://github.com/hussainshaqsi/django-cicd-pipeline/blob/main/Dockerfile): `Dockerfile`
- [Compose deployment](https://github.com/hussainshaqsi/django-cicd-pipeline/blob/main/docker-compose.yml): `docker-compose.yml`
- **CI secrets**

### Ingress and domain

- **Traefik proxy**
- **Let's Encrypt**
- **DuckDNS**

### Kubernetes chart

- [Chart deployment](https://github.com/hussainshaqsi/django-cicd-pipeline/blob/main/chart/templates/deployment.yaml): `chart/templates/deployment.yaml`
- [Chart service](https://github.com/hussainshaqsi/django-cicd-pipeline/blob/main/chart/templates/service.yaml): `chart/templates/service.yaml`
- [Chart ingress](https://github.com/hussainshaqsi/django-cicd-pipeline/blob/main/chart/templates/ingress.yaml): `chart/templates/ingress.yaml`
- [Chart storage](https://github.com/hussainshaqsi/django-cicd-pipeline/blob/main/chart/templates/pvc.yaml): `chart/templates/pvc.yaml`

### Other components

- **Visitor**
- **GitLab**
- **Oracle Cloud VM**

## Connections

- Visitor → Traefik proxy: visits (evidence: `README.md`)
- Traefik proxy → Django runtime: routes traffic (evidence: `README.md`)
- Django runtime → Home and admin routes: resolves URLs (evidence: `config/urls.py`)
- Django runtime → App configuration: loads settings (evidence: `config/settings.py`)
- App configuration → SQLite database: configures database (evidence: `config/settings.py`)
- GitLab → Self-hosted runner: assigns work (evidence: `README.md`)
- Self-hosted runner → CI pipeline: runs pipeline (evidence: `README.md`)
- CI pipeline → Docker image: builds image (evidence: `README.md`)
- CI pipeline → Compose deployment: deploys container (evidence: `README.md`)
- CI pipeline → CI secrets: injects secrets (evidence: `README.md`)
- Self-hosted runner → Oracle Cloud VM: runs on (evidence: `README.md`)
- Compose deployment → Oracle Cloud VM: starts container (evidence: `README.md`)
- Traefik proxy → Let's Encrypt: obtains certificates (evidence: `README.md`)
- DuckDNS → Traefik proxy: names site (evidence: `README.md`)
- Chart deployment → Chart service: uses service
- Chart ingress → Chart service: targets service
- Chart storage → Chart deployment: mounts storage
