# mohammed-005/devops-capstone-app architecture

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

- Interactive diagram: https://gitdiagram.com/mohammed-005/devops-capstone-app
- Repository: https://github.com/mohammed-005/devops-capstone-app

## Overview

This repository is a DevOps capstone: its product is a Flask service delivered through CI and pull-based GitOps, then operated on Kubernetes with autoscaling and observability. The graph preserves that documented workflow and its major stages. Application, workflow, and manifest contents were not sampled, so relationships are based on README statements; the graph does not infer wiring from filenames alone.

Main entry points: [`.github/workflows/ci.yaml`](https://github.com/mohammed-005/devops-capstone-app/blob/main/.github/workflows/ci.yaml) (CI workflow), [`app.py`](https://github.com/mohammed-005/devops-capstone-app/blob/main/app.py) (Flask service), [`argocd-app.yaml`](https://github.com/mohammed-005/devops-capstone-app/blob/main/argocd-app.yaml) (ArgoCD application), [`helm/capstone-chart/templates/hpa.yaml`](https://github.com/mohammed-005/devops-capstone-app/blob/main/helm/capstone-chart/templates/hpa.yaml) (Horizontal autoscaler)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_application["Application"]
  node_app["Flask service<br/>[app.py]"]
  node_exporter["Prometheus exporter<br/>[requirements.txt]"]
end

subgraph group_ci["CI and Artifact"]
  node_workflow["CI workflow<br/>[ci.yaml]"]
  node_image["Image build"]
  node_scan["Trivy scan"]
  node_ecr[("AWS ECR")]
end

subgraph group_deployment["GitOps Deployment"]
  node_argocd["ArgoCD application<br/>[argocd-app.yaml]"]
  node_chart["Helm chart<br/>[values.yaml]"]
  node_templates["Kubernetes templates"]
  node_cluster["Kubernetes cluster"]
  node_deploymentmanifest["App deployment<br/>[app-deploy.yaml]"]
end

subgraph group_operations["Operations and Monitoring"]
  node_hpa["Horizontal autoscaler<br/>[hpa.yaml]"]
  node_metrics["Metrics Server"]
  node_monitoring["Prometheus and Grafana"]
  node_servicemonitor["Service monitoring config"]
end

node_push(("Main-branch push"))

node_push -->|"triggers"| node_workflow
node_workflow -->|"builds"| node_image
node_workflow -->|"scans image"| node_scan
node_workflow -->|"pushes verified image"| node_ecr
node_argocd -->|"monitors"| node_chart
node_argocd -->|"syncs state"| node_cluster
node_chart -->|"renders"| node_templates
node_templates -->|"configures"| node_cluster
node_cluster -->|"pulls image"| node_ecr
node_cluster -->|"runs deployment"| node_deploymentmanifest
node_cluster -->|"runs service"| node_app
node_hpa -->|"reads CPU metrics"| node_metrics
node_hpa -->|"scales replicas"| node_cluster
node_servicemonitor -->|"configures scraping"| node_monitoring
node_monitoring -->|"scrapes health metrics"| node_app
node_app -->|"uses dependency"| node_exporter

click node_workflow "https://github.com/mohammed-005/devops-capstone-app/blob/main/.github/workflows/ci.yaml"
click node_image "https://github.com/mohammed-005/devops-capstone-app/blob/main/Dockerfile"
click node_app "https://github.com/mohammed-005/devops-capstone-app/blob/main/app.py"
click node_exporter "https://github.com/mohammed-005/devops-capstone-app/blob/main/requirements.txt"
click node_argocd "https://github.com/mohammed-005/devops-capstone-app/blob/main/argocd-app.yaml"
click node_chart "https://github.com/mohammed-005/devops-capstone-app/blob/main/helm/capstone-chart/values.yaml"
click node_templates "https://github.com/mohammed-005/devops-capstone-app/tree/main/helm/capstone-chart/templates"
click node_deploymentmanifest "https://github.com/mohammed-005/devops-capstone-app/blob/main/k8s/app-deploy.yaml"
click node_hpa "https://github.com/mohammed-005/devops-capstone-app/blob/main/helm/capstone-chart/templates/hpa.yaml"
click node_servicemonitor "https://github.com/mohammed-005/devops-capstone-app/blob/main/helm/capstone-chart/templates/servicemonitor.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_app,node_exporter toneBlue
class node_workflow,node_image,node_scan,node_ecr toneAmber
class node_argocd,node_chart,node_templates,node_cluster,node_deploymentmanifest toneMint
class node_hpa,node_metrics,node_monitoring,node_servicemonitor toneRose
class node_push toneIndigo
```

## Components

### Application

- [Flask service](https://github.com/mohammed-005/devops-capstone-app/blob/main/app.py): `app.py`
- [Prometheus exporter](https://github.com/mohammed-005/devops-capstone-app/blob/main/requirements.txt): `requirements.txt`

### CI and Artifact

- [CI workflow](https://github.com/mohammed-005/devops-capstone-app/blob/main/.github/workflows/ci.yaml): `.github/workflows/ci.yaml`
- [Image build](https://github.com/mohammed-005/devops-capstone-app/blob/main/Dockerfile): `Dockerfile`
- **Trivy scan**
- **AWS ECR**

### GitOps Deployment

- [ArgoCD application](https://github.com/mohammed-005/devops-capstone-app/blob/main/argocd-app.yaml): `argocd-app.yaml`
- [Helm chart](https://github.com/mohammed-005/devops-capstone-app/blob/main/helm/capstone-chart/values.yaml): `helm/capstone-chart/values.yaml`
- [Kubernetes templates](https://github.com/mohammed-005/devops-capstone-app/tree/main/helm/capstone-chart/templates): `helm/capstone-chart/templates`
- **Kubernetes cluster**
- [App deployment](https://github.com/mohammed-005/devops-capstone-app/blob/main/k8s/app-deploy.yaml): `k8s/app-deploy.yaml`

### Operations and Monitoring

- [Horizontal autoscaler](https://github.com/mohammed-005/devops-capstone-app/blob/main/helm/capstone-chart/templates/hpa.yaml): `helm/capstone-chart/templates/hpa.yaml`
- **Metrics Server**
- **Prometheus and Grafana**
- [Service monitoring config](https://github.com/mohammed-005/devops-capstone-app/blob/main/helm/capstone-chart/templates/servicemonitor.yaml): `helm/capstone-chart/templates/servicemonitor.yaml`

### Other components

- **Main-branch push**

## Connections

- Main-branch push → CI workflow: triggers (evidence: `README.md`)
- CI workflow → Image build: builds (evidence: `README.md`)
- CI workflow → Trivy scan: scans image (evidence: `README.md`)
- CI workflow → AWS ECR: pushes verified image (evidence: `README.md`)
- ArgoCD application → Helm chart: monitors (evidence: `README.md`)
- ArgoCD application → Kubernetes cluster: syncs state (evidence: `README.md`)
- Helm chart → Kubernetes templates: renders (evidence: `README.md`)
- Kubernetes templates → Kubernetes cluster: configures (evidence: `README.md`)
- Kubernetes cluster → AWS ECR: pulls image (evidence: `README.md`)
- Kubernetes cluster → App deployment: runs deployment (evidence: `README.md`)
- Kubernetes cluster → Flask service: runs service (evidence: `README.md`)
- Horizontal autoscaler → Metrics Server: reads CPU metrics (evidence: `README.md`)
- Horizontal autoscaler → Kubernetes cluster: scales replicas (evidence: `README.md`)
- Service monitoring config → Prometheus and Grafana: configures scraping (evidence: `README.md`)
- Prometheus and Grafana → Flask service: scrapes health metrics (evidence: `README.md`)
- Flask service → Prometheus exporter: uses dependency (evidence: `README.md`)
