# ahsanmustafa11-a/github-action-python-3tier architecture

> Architecture diagram of the GitHub repository ahsanmustafa11-a/github-action-python-3tier, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ahsanmustafa11-a/github-action-python-3tier
- Repository: https://github.com/ahsanmustafa11-a/github-action-python-3tier

## Overview

This repository presents a GitHub Actions DevSecOps pipeline for building, scanning, publishing, deploying, and dynamically testing a three-tier library application. The README documents the pipeline stages and tools; workflow implementations were not sampled, so stage ordering follows that documentation rather than inspected workflow calls. The sampled runtime shows browser CRUD and dashboard requests through Nginx to Flask and MySQL. Deployment wiring and some tool integrations are documented but not verified in source.

Main entry points: [`.github/workflows/lint.yml`](https://github.com/ahsanmustafa11-a/github-action-python-3tier/blob/main/.github/workflows/lint.yml) (Code lint), [`.github/workflows/frontend-lint.yml`](https://github.com/ahsanmustafa11-a/github-action-python-3tier/blob/main/.github/workflows/frontend-lint.yml) (Frontend lint), [`.github/workflows/gitleaks.yml`](https://github.com/ahsanmustafa11-a/github-action-python-3tier/blob/main/.github/workflows/gitleaks.yml) (Secret scan), [`.github/workflows/sast.yml`](https://github.com/ahsanmustafa11-a/github-action-python-3tier/blob/main/.github/workflows/sast.yml) (SAST scan)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_pipeline["CI security pipeline"]
  node_lint["Code lint<br/>[lint.yml]"]
  node_frontend_lint["Frontend lint<br/>[frontend-lint.yml]"]
  node_secrets["Secret scan<br/>[gitleaks.yml]"]
  node_sast["SAST scan<br/>[sast.yml]"]
  node_sca["Dependency scan<br/>[sca.yml]"]
  node_docker_lint["Dockerfile lint"]
  node_sonarqube["Code analysis<br/>[sonarqube.yml]"]
end

subgraph group_delivery["Image delivery"]
  node_image_build["Image build"]
  node_image_scan["Image scan<br/>[trivy-image.yml]"]
  node_registry[("Docker Hub")]
  node_deployment["EC2 deployment<br/>[deploy.yml]"]
  node_dast["DAST scan<br/>[dast.yml]"]
  node_zap["OWASP ZAP"]
end

subgraph group_application["Library application"]
  node_frontend["Library interface<br/>[app.js]"]
end

subgraph group_runtime["Application runtime"]
  node_proxy["Reverse proxy<br/>[default.conf]"]
  node_backend["Flask API<br/>[app.py]"]
  node_database[("MySQL library<br/>[init.sql]")]
end

node_developer(("Developer"))
node_push(("GitHub push"))
node_browser(("Library user"))

node_developer -->|"pushes code"| node_push
node_push -->|"triggers"| node_lint
node_lint -->|"then lint"| node_frontend_lint
node_frontend_lint -->|"then scan"| node_secrets
node_secrets -->|"then scan"| node_sast
node_sast -->|"then scan"| node_sca
node_sca -->|"then lint"| node_docker_lint
node_docker_lint -->|"then build"| node_image_build
node_image_build -->|"then scan"| node_image_scan
node_image_scan -->|"then analyze"| node_sonarqube
node_sonarqube -->|"pushes image"| node_registry
node_registry -->|"provides image"| node_deployment
node_deployment -->|"then test"| node_dast
node_dast -->|"uses scanner"| node_zap
node_browser -->|"uses"| node_frontend
node_frontend -->|"requests API"| node_proxy
node_proxy -->|"routes requests"| node_backend
node_backend -->|"reads and writes"| node_database

click node_lint "https://github.com/ahsanmustafa11-a/github-action-python-3tier/blob/main/.github/workflows/lint.yml"
click node_frontend_lint "https://github.com/ahsanmustafa11-a/github-action-python-3tier/blob/main/.github/workflows/frontend-lint.yml"
click node_secrets "https://github.com/ahsanmustafa11-a/github-action-python-3tier/blob/main/.github/workflows/gitleaks.yml"
click node_sast "https://github.com/ahsanmustafa11-a/github-action-python-3tier/blob/main/.github/workflows/sast.yml"
click node_sca "https://github.com/ahsanmustafa11-a/github-action-python-3tier/blob/main/.github/workflows/sca.yml"
click node_docker_lint "https://github.com/ahsanmustafa11-a/github-action-python-3tier/blob/main/.github/workflows/docker-Hadolint-Login-push.yml"
click node_image_build "https://github.com/ahsanmustafa11-a/github-action-python-3tier/blob/main/.github/workflows/docker-build-scan-push.yml"
click node_image_scan "https://github.com/ahsanmustafa11-a/github-action-python-3tier/blob/main/.github/workflows/trivy-image.yml"
click node_sonarqube "https://github.com/ahsanmustafa11-a/github-action-python-3tier/blob/main/.github/workflows/sonarqube.yml"
click node_deployment "https://github.com/ahsanmustafa11-a/github-action-python-3tier/blob/main/.github/workflows/deploy.yml"
click node_dast "https://github.com/ahsanmustafa11-a/github-action-python-3tier/blob/main/.github/workflows/dast.yml"
click node_frontend "https://github.com/ahsanmustafa11-a/github-action-python-3tier/blob/main/frontend/js/app.js"
click node_proxy "https://github.com/ahsanmustafa11-a/github-action-python-3tier/blob/main/nginx/default.conf"
click node_backend "https://github.com/ahsanmustafa11-a/github-action-python-3tier/blob/main/backend/app.py"
click node_database "https://github.com/ahsanmustafa11-a/github-action-python-3tier/blob/main/database/init.sql"

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_lint,node_frontend_lint,node_secrets,node_sast,node_sca,node_docker_lint,node_sonarqube,node_browser toneBlue
class node_image_build,node_image_scan,node_registry,node_deployment,node_dast,node_zap toneAmber
class node_frontend toneMint
class node_proxy,node_backend,node_database toneRose
class node_developer,node_push toneIndigo
```

## Components

### CI security pipeline

- [Code lint](https://github.com/ahsanmustafa11-a/github-action-python-3tier/blob/main/.github/workflows/lint.yml): `.github/workflows/lint.yml`
- [Frontend lint](https://github.com/ahsanmustafa11-a/github-action-python-3tier/blob/main/.github/workflows/frontend-lint.yml): `.github/workflows/frontend-lint.yml`
- [Secret scan](https://github.com/ahsanmustafa11-a/github-action-python-3tier/blob/main/.github/workflows/gitleaks.yml): `.github/workflows/gitleaks.yml`
- [SAST scan](https://github.com/ahsanmustafa11-a/github-action-python-3tier/blob/main/.github/workflows/sast.yml): `.github/workflows/sast.yml`
- [Dependency scan](https://github.com/ahsanmustafa11-a/github-action-python-3tier/blob/main/.github/workflows/sca.yml): `.github/workflows/sca.yml`
- [Dockerfile lint](https://github.com/ahsanmustafa11-a/github-action-python-3tier/blob/main/.github/workflows/docker-Hadolint-Login-push.yml): `.github/workflows/docker-Hadolint-Login-push.yml`
- [Code analysis](https://github.com/ahsanmustafa11-a/github-action-python-3tier/blob/main/.github/workflows/sonarqube.yml): `.github/workflows/sonarqube.yml`

### Image delivery

- [Image build](https://github.com/ahsanmustafa11-a/github-action-python-3tier/blob/main/.github/workflows/docker-build-scan-push.yml): `.github/workflows/docker-build-scan-push.yml`
- [Image scan](https://github.com/ahsanmustafa11-a/github-action-python-3tier/blob/main/.github/workflows/trivy-image.yml): `.github/workflows/trivy-image.yml`
- **Docker Hub**
- [EC2 deployment](https://github.com/ahsanmustafa11-a/github-action-python-3tier/blob/main/.github/workflows/deploy.yml): `.github/workflows/deploy.yml`
- [DAST scan](https://github.com/ahsanmustafa11-a/github-action-python-3tier/blob/main/.github/workflows/dast.yml): `.github/workflows/dast.yml`
- **OWASP ZAP**

### Library application

- [Library interface](https://github.com/ahsanmustafa11-a/github-action-python-3tier/blob/main/frontend/js/app.js): `frontend/js/app.js`

### Application runtime

- [Reverse proxy](https://github.com/ahsanmustafa11-a/github-action-python-3tier/blob/main/nginx/default.conf): `nginx/default.conf`
- [Flask API](https://github.com/ahsanmustafa11-a/github-action-python-3tier/blob/main/backend/app.py): `backend/app.py`
- [MySQL library](https://github.com/ahsanmustafa11-a/github-action-python-3tier/blob/main/database/init.sql): `database/init.sql`

### Other components

- **Developer**
- **GitHub push**
- **Library user**

## Connections

- Developer → GitHub push: pushes code
- GitHub push → Code lint: triggers
- Code lint → Frontend lint: then lint
- Frontend lint → Secret scan: then scan
- Secret scan → SAST scan: then scan
- SAST scan → Dependency scan: then scan
- Dependency scan → Dockerfile lint: then lint
- Dockerfile lint → Image build: then build
- Image build → Image scan: then scan
- Image scan → Code analysis: then analyze
- Code analysis → Docker Hub: pushes image
- Docker Hub → EC2 deployment: provides image
- EC2 deployment → DAST scan: then test
- DAST scan → OWASP ZAP: uses scanner
- Library user → Library interface: uses
- Library interface → Reverse proxy: requests API
- Reverse proxy → Flask API: routes requests
- Flask API → MySQL library: reads and writes
