# slayersarthak/dockerized-pythonapi-with-cicd architecture

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

- Interactive diagram: https://gitdiagram.com/slayersarthak/dockerized-pythonapi-with-cicd
- Repository: https://github.com/slayersarthak/dockerized-pythonapi-with-cicd

## Overview

This repository demonstrates a Flask API delivered through a container-based CI/CD workflow. The user-facing path is a request to the API’s health endpoint; the delivery path starts with a code change, builds and exercises the API alongside PostgreSQL, then publishes and deploys an image to Cloud Run. The README also describes Artifact Registry and Cloud Build. Those deployment services are documented capabilities, but their implementation is not visible in the sampled source, and the README is inconsistent about whether CD is automated.

Main entry points: [`.github/workflows/ci.yml`](https://github.com/slayersarthak/dockerized-pythonapi-with-cicd/blob/main/.github/workflows/ci.yml) (GitHub Actions), [`docker-compose.yml`](https://github.com/slayersarthak/dockerized-pythonapi-with-cicd/blob/main/docker-compose.yml) (Compose stack), [`Dockerfile`](https://github.com/slayersarthak/dockerized-pythonapi-with-cicd/blob/main/Dockerfile) (Container image), [`test_app.py`](https://github.com/slayersarthak/dockerized-pythonapi-with-cicd/blob/main/test_app.py) (Integration tests)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["API service"]
  node_flask["Flask API<br/>[app.py]"]
  node_health["Health endpoint<br/>[app.py]"]
end

subgraph group_local["Local stack"]
  node_image["Container image"]
  node_compose["Compose stack<br/>[docker-compose.yml]"]
  node_postgres[("PostgreSQL<br/>[docker-compose.yml]")]
end

subgraph group_ci["Continuous integration"]
  node_actions["GitHub Actions<br/>[ci.yml]"]
  node_integration["Integration tests<br/>[test_app.py]"]
end

subgraph group_deployment["Cloud deployment"]
  node_registry[("Artifact Registry")]
  node_cloudbuild["Cloud Build"]
  node_run["Cloud Run"]
  node_live["Live HTTPS service"]
end

node_caller(("API caller"))
node_push(("Code change"))

node_caller -->|"requests"| node_health
node_push -->|"triggers"| node_actions
node_actions -->|"builds"| node_image
node_actions -->|"starts"| node_compose
node_compose -->|"runs"| node_flask
node_compose -->|"starts"| node_postgres
node_actions -->|"runs"| node_integration
node_integration -->|"checks"| node_health
node_image -->|"stores"| node_registry
node_cloudbuild -.->|"builds"| node_image
node_registry -->|"supplies image"| node_run
node_run -->|"serves"| node_live

click node_flask "https://github.com/slayersarthak/dockerized-pythonapi-with-cicd/blob/main/app.py"
click node_health "https://github.com/slayersarthak/dockerized-pythonapi-with-cicd/blob/main/app.py"
click node_image "https://github.com/slayersarthak/dockerized-pythonapi-with-cicd/blob/main/Dockerfile"
click node_compose "https://github.com/slayersarthak/dockerized-pythonapi-with-cicd/blob/main/docker-compose.yml"
click node_postgres "https://github.com/slayersarthak/dockerized-pythonapi-with-cicd/blob/main/docker-compose.yml"
click node_actions "https://github.com/slayersarthak/dockerized-pythonapi-with-cicd/blob/main/.github/workflows/ci.yml"
click node_integration "https://github.com/slayersarthak/dockerized-pythonapi-with-cicd/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_flask,node_health toneBlue
class node_image,node_compose,node_postgres toneAmber
class node_actions,node_integration,node_caller toneMint
class node_registry,node_cloudbuild,node_run,node_live toneRose
class node_push toneIndigo
```

## Components

### API service

- [Flask API](https://github.com/slayersarthak/dockerized-pythonapi-with-cicd/blob/main/app.py): `app.py`
- [Health endpoint](https://github.com/slayersarthak/dockerized-pythonapi-with-cicd/blob/main/app.py): `app.py`

### Local stack

- [Container image](https://github.com/slayersarthak/dockerized-pythonapi-with-cicd/blob/main/Dockerfile): `Dockerfile`
- [Compose stack](https://github.com/slayersarthak/dockerized-pythonapi-with-cicd/blob/main/docker-compose.yml): `docker-compose.yml`
- [PostgreSQL](https://github.com/slayersarthak/dockerized-pythonapi-with-cicd/blob/main/docker-compose.yml): `docker-compose.yml`

### Continuous integration

- [GitHub Actions](https://github.com/slayersarthak/dockerized-pythonapi-with-cicd/blob/main/.github/workflows/ci.yml): `.github/workflows/ci.yml`
- [Integration tests](https://github.com/slayersarthak/dockerized-pythonapi-with-cicd/blob/main/test_app.py): `test_app.py`

### Cloud deployment

- **Artifact Registry**
- **Cloud Build**
- **Cloud Run**
- **Live HTTPS service**

### Other components

- **API caller**
- **Code change**

## Connections

- API caller → Health endpoint: requests (evidence: `README.md`)
- Code change → GitHub Actions: triggers (evidence: `README.md`)
- GitHub Actions → Container image: builds (evidence: `README.md`)
- GitHub Actions → Compose stack: starts (evidence: `README.md`)
- Compose stack → Flask API: runs (evidence: `README.md`)
- Compose stack → PostgreSQL: starts (evidence: `README.md`)
- GitHub Actions → Integration tests: runs (evidence: `README.md`)
- Integration tests → Health endpoint: checks (evidence: `README.md`)
- Container image → Artifact Registry: stores (evidence: `README.md`)
- Cloud Build → Container image: builds
- Artifact Registry → Cloud Run: supplies image (evidence: `README.md`)
- Cloud Run → Live HTTPS service: serves (evidence: `README.md`)
