# adilsalah996/python-devops-pipeline architecture

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

- Interactive diagram: https://gitdiagram.com/adilsalah996/python-devops-pipeline
- Repository: https://github.com/adilsalah996/python-devops-pipeline

## Overview

This repository is a small Python web application presented as a DevOps learning project. Its user-facing workflow is an HTTP request routed by the application to either the homepage or JSON health response. The broader documented product also includes a hardened Docker image, automated tests, CI image scanning, and a documented EC2 deployment. The application source was inspected; Docker, test, and workflow relationships below rely on README statements rather than inspected implementation details.

Main entry points: [`.github/workflows/ci.yml`](https://github.com/adilsalah996/python-devops-pipeline/blob/main/.github/workflows/ci.yml) (CI workflow), [`app.py`](https://github.com/adilsalah996/python-devops-pipeline/blob/main/app.py) (HTTP server), [`Dockerfile`](https://github.com/adilsalah996/python-devops-pipeline/blob/main/Dockerfile) (Hardened image), [`test_app.py`](https://github.com/adilsalah996/python-devops-pipeline/blob/main/test_app.py) (Application tests)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_application["Web application"]
  node_server["HTTP server<br/>[app.py]"]
  node_homepage["Homepage response<br/>[app.py]"]
  node_health["Health response<br/>[app.py]"]
end

subgraph group_container["Container runtime"]
  node_image["Hardened image"]
  node_container_run["Container runtime"]
end

subgraph group_automation["CI and verification"]
  node_ci["CI workflow<br/>[ci.yml]"]
  node_tests["Application tests<br/>[test_app.py]"]
  node_trivy["Trivy scanner"]
end

subgraph group_deployment["Cloud deployment"]
  node_ec2["AWS EC2 host"]
end

node_user(("HTTP client"))

node_user -->|"sends HTTP"| node_server
node_server -->|"serves default route"| node_homepage
node_server -->|"routes /health"| node_health
node_ci -->|"runs tests"| node_tests
node_ci -->|"builds image"| node_image
node_ci -->|"scans image"| node_trivy
node_image -->|"runs as container"| node_container_run
node_ec2 -->|"hosts deployment"| node_container_run

click node_server "https://github.com/adilsalah996/python-devops-pipeline/blob/main/app.py"
click node_homepage "https://github.com/adilsalah996/python-devops-pipeline/blob/main/app.py"
click node_health "https://github.com/adilsalah996/python-devops-pipeline/blob/main/app.py"
click node_image "https://github.com/adilsalah996/python-devops-pipeline/blob/main/Dockerfile"
click node_container_run "https://github.com/adilsalah996/python-devops-pipeline/blob/main/Dockerfile"
click node_ci "https://github.com/adilsalah996/python-devops-pipeline/blob/main/.github/workflows/ci.yml"
click node_tests "https://github.com/adilsalah996/python-devops-pipeline/blob/main/test_app.py"

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_server,node_homepage,node_health,node_user toneBlue
class node_image,node_container_run toneAmber
class node_ci,node_tests,node_trivy toneMint
class node_ec2 toneRose
```

## Components

### Web application

- [HTTP server](https://github.com/adilsalah996/python-devops-pipeline/blob/main/app.py): `app.py`
- [Homepage response](https://github.com/adilsalah996/python-devops-pipeline/blob/main/app.py): `app.py`
- [Health response](https://github.com/adilsalah996/python-devops-pipeline/blob/main/app.py): `app.py`

### Container runtime

- [Hardened image](https://github.com/adilsalah996/python-devops-pipeline/blob/main/Dockerfile): `Dockerfile`
- [Container runtime](https://github.com/adilsalah996/python-devops-pipeline/blob/main/Dockerfile): `Dockerfile`

### CI and verification

- [CI workflow](https://github.com/adilsalah996/python-devops-pipeline/blob/main/.github/workflows/ci.yml): `.github/workflows/ci.yml`
- [Application tests](https://github.com/adilsalah996/python-devops-pipeline/blob/main/test_app.py): `test_app.py`
- **Trivy scanner**

### Cloud deployment

- **AWS EC2 host**

### Other components

- **HTTP client**

## Connections

- HTTP client → HTTP server: sends HTTP (evidence: `README.md`)
- HTTP server → Homepage response: serves default route (evidence: `app.py`)
- HTTP server → Health response: routes /health (evidence: `app.py`)
- CI workflow → Application tests: runs tests (evidence: `README.md`)
- CI workflow → Hardened image: builds image (evidence: `README.md`)
- CI workflow → Trivy scanner: scans image (evidence: `README.md`)
- Hardened image → Container runtime: runs as container (evidence: `README.md`)
- AWS EC2 host → Container runtime: hosts deployment (evidence: `README.md`)
