# baiiraam/ml_project_task_2 architecture

> Architecture diagram of the GitHub repository baiiraam/ml_project_task_2, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-18). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/baiiraam/ml_project_task_2
- Repository: https://github.com/baiiraam/ml_project_task_2

## Overview

This repository packages a small FastAPI service and automates its delivery: changes pushed to GitHub trigger a workflow that lints and builds the container, publishes it, deploys it to a Kind Kubernetes cluster with Helm, and tests its endpoints. The service exposes root and health responses; the Helm chart defines its deployment and ClusterIP service. Workflow details and deployment relationships below follow the README; the workflow and Helm source files were not sampled, so their internal wiring is not inferred beyond documented behavior.

Main entry points: [`.github/workflows/ci.yml`](https://github.com/baiiraam/ml_project_task_2/blob/main/.github/workflows/ci.yml) (GitHub Actions), [`Dockerfile`](https://github.com/baiiraam/ml_project_task_2/blob/main/Dockerfile) (Image build), [`helm/templates/deployment.yaml`](https://github.com/baiiraam/ml_project_task_2/blob/main/helm/templates/deployment.yaml) (Pod deployment), [`helm/templates/service.yaml`](https://github.com/baiiraam/ml_project_task_2/blob/main/helm/templates/service.yaml) (ClusterIP service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_service["FastAPI service"]
  node_app["FastAPI app<br/>[app.py]"]
end

subgraph group_pipeline["CI/CD workflow"]
  node_workflow["GitHub Actions<br/>[ci.yml]"]
  node_lint["Dockerfile lint<br/>[ci.yml]"]
  node_build["Image build"]
  node_push["Image publish<br/>[ci.yml]"]
  node_deploy["Helm deploy<br/>[ci.yml]"]
  node_test["Endpoint tests<br/>[ci.yml]"]
end

subgraph group_deployment["Kubernetes deployment"]
  node_cluster["Kind cluster"]
  node_deployment_resource["Pod deployment<br/>[deployment.yaml]"]
  node_kube_service["ClusterIP service<br/>[service.yaml]"]
end

node_developer(("Contributor"))
node_registry["Docker Hub"]

node_developer -->|"pushes changes"| node_workflow
node_workflow -->|"runs"| node_lint
node_workflow -->|"builds image"| node_build
node_build -->|"produces image"| node_push
node_push -->|"publishes image"| node_registry
node_workflow -->|"runs"| node_deploy
node_deploy -->|"creates cluster"| node_cluster
node_deploy -->|"installs chart"| node_deployment_resource
node_deployment_resource -->|"runs"| node_app
node_kube_service -->|"routes traffic"| node_app
node_workflow -->|"runs"| node_test
node_test -->|"tests endpoints"| node_kube_service

click node_workflow "https://github.com/baiiraam/ml_project_task_2/blob/main/.github/workflows/ci.yml"
click node_lint "https://github.com/baiiraam/ml_project_task_2/blob/main/.github/workflows/ci.yml"
click node_build "https://github.com/baiiraam/ml_project_task_2/blob/main/Dockerfile"
click node_push "https://github.com/baiiraam/ml_project_task_2/blob/main/.github/workflows/ci.yml"
click node_deploy "https://github.com/baiiraam/ml_project_task_2/blob/main/.github/workflows/ci.yml"
click node_deployment_resource "https://github.com/baiiraam/ml_project_task_2/blob/main/helm/templates/deployment.yaml"
click node_kube_service "https://github.com/baiiraam/ml_project_task_2/blob/main/helm/templates/service.yaml"
click node_app "https://github.com/baiiraam/ml_project_task_2/blob/main/src/app.py"
click node_test "https://github.com/baiiraam/ml_project_task_2/blob/main/.github/workflows/ci.yml"

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_app toneBlue
class node_workflow,node_lint,node_build,node_push,node_deploy,node_test toneAmber
class node_cluster,node_deployment_resource,node_kube_service toneMint
class node_developer,node_registry toneIndigo
```

## Components

### FastAPI service

- [FastAPI app](https://github.com/baiiraam/ml_project_task_2/blob/main/src/app.py): `src/app.py`

### CI/CD workflow

- [GitHub Actions](https://github.com/baiiraam/ml_project_task_2/blob/main/.github/workflows/ci.yml): `.github/workflows/ci.yml`
- [Dockerfile lint](https://github.com/baiiraam/ml_project_task_2/blob/main/.github/workflows/ci.yml): `.github/workflows/ci.yml`
- [Image build](https://github.com/baiiraam/ml_project_task_2/blob/main/Dockerfile): `Dockerfile`
- [Image publish](https://github.com/baiiraam/ml_project_task_2/blob/main/.github/workflows/ci.yml): `.github/workflows/ci.yml`
- [Helm deploy](https://github.com/baiiraam/ml_project_task_2/blob/main/.github/workflows/ci.yml): `.github/workflows/ci.yml`
- [Endpoint tests](https://github.com/baiiraam/ml_project_task_2/blob/main/.github/workflows/ci.yml): `.github/workflows/ci.yml`

### Kubernetes deployment

- **Kind cluster**
- [Pod deployment](https://github.com/baiiraam/ml_project_task_2/blob/main/helm/templates/deployment.yaml): `helm/templates/deployment.yaml`
- [ClusterIP service](https://github.com/baiiraam/ml_project_task_2/blob/main/helm/templates/service.yaml): `helm/templates/service.yaml`

### Other components

- **Contributor**
- **Docker Hub**

## Connections

- Contributor → GitHub Actions: pushes changes (evidence: `README.md`)
- GitHub Actions → Dockerfile lint: runs (evidence: `README.md`)
- GitHub Actions → Image build: builds image (evidence: `README.md`)
- Image build → Image publish: produces image (evidence: `README.md`)
- Image publish → Docker Hub: publishes image (evidence: `README.md`)
- GitHub Actions → Helm deploy: runs (evidence: `README.md`)
- Helm deploy → Kind cluster: creates cluster (evidence: `README.md`)
- Helm deploy → Pod deployment: installs chart (evidence: `README.md`)
- Pod deployment → FastAPI app: runs (evidence: `README.md`)
- ClusterIP service → FastAPI app: routes traffic (evidence: `README.md`)
- GitHub Actions → Endpoint tests: runs (evidence: `README.md`)
- Endpoint tests → ClusterIP service: tests endpoints (evidence: `README.md`)
