# intontis/the_choice_azure_cicd architecture

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

- Interactive diagram: https://gitdiagram.com/intontis/the_choice_azure_cicd
- Repository: https://github.com/intontis/the_choice_azure_cicd

## Overview

The Choice is a Flask/PostgreSQL branching-choice application: a visitor answers a sequence of questions, the app records the path, and a completed path selects a prophecy for display. The graph also includes the documented GitOps deployment branch because cloud delivery is a major project capability. Runtime calls are evidenced by sampled source; deployment relationships are based on the README, since the pipeline and Kubernetes manifests were not excerpted.

Main entry points: [`app/routes/main.py`](https://github.com/intontis/the_choice_azure_cicd/blob/main/app/routes/main.py) (Journey routes), [`db/schema.sql`](https://github.com/intontis/the_choice_azure_cicd/blob/main/db/schema.sql) (PostgreSQL data), [`app/templates`](https://github.com/intontis/the_choice_azure_cicd/tree/main/app/templates) (Question and prophecy pages), [`app/services/journey_service.py`](https://github.com/intontis/the_choice_azure_cicd/blob/main/app/services/journey_service.py) (Journey service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web experience"]
  node_flask["Flask app factory<br/>[__init__.py]"]
  node_routes["Journey routes<br/>[main.py]"]
  node_pages["Question and prophecy pages"]
  node_animation["Matrix background<br/>[matrix-rain.js]"]
end

subgraph group_journey["Journey logic"]
  node_journey_svc["Journey service<br/>[journey_service.py]"]
  node_question_svc["Question service"]
end

subgraph group_data["Persistence"]
  node_dbconn["Connection manager<br/>[db.py]"]
  node_postgres[("PostgreSQL data<br/>[schema.sql]")]
  node_seed["Question and prophecy seed<br/>[seed.py]"]
end

subgraph group_delivery["Cloud delivery"]
  node_github["GitHub repository"]
  node_pipeline["Azure Pipelines"]
  node_acr[("Azure Container Registry")]
  node_manifest["Kubernetes app manifest<br/>[deployment.yaml]"]
  node_argocd["Argo CD"]
  node_aks["AKS services and storage"]
end

node_visitor(("Visitor"))

node_visitor -->|"submits choices"| node_routes
node_flask -->|"registers routes"| node_routes
node_routes -->|"loads questions"| node_question_svc
node_routes -->|"creates and advances"| node_journey_svc
node_routes -->|"renders pages"| node_pages
node_pages -->|"shows journey"| node_visitor
node_pages -->|"uses background"| node_animation
node_journey_svc -->|"gets connections"| node_dbconn
node_question_svc -->|"gets connections"| node_dbconn
node_dbconn -->|"connects"| node_postgres
node_journey_svc -->|"reads and writes journey data"| node_postgres
node_question_svc -->|"reads questions"| node_postgres
node_seed -->|"seeds content"| node_postgres
node_github -->|"triggers validation"| node_pipeline
node_pipeline -->|"publishes image"| node_acr
node_pipeline -->|"updates image reference"| node_manifest
node_manifest -->|"committed to"| node_github
node_argocd -->|"monitors changes"| node_github
node_argocd -->|"synchronizes resources"| node_aks
node_aks -->|"runs database"| node_postgres

click node_flask "https://github.com/intontis/the_choice_azure_cicd/blob/main/app/__init__.py"
click node_routes "https://github.com/intontis/the_choice_azure_cicd/blob/main/app/routes/main.py"
click node_pages "https://github.com/intontis/the_choice_azure_cicd/tree/main/app/templates"
click node_animation "https://github.com/intontis/the_choice_azure_cicd/blob/main/app/static/matrix-rain.js"
click node_journey_svc "https://github.com/intontis/the_choice_azure_cicd/blob/main/app/services/journey_service.py"
click node_question_svc "https://github.com/intontis/the_choice_azure_cicd/blob/main/app/services/question_service.py"
click node_dbconn "https://github.com/intontis/the_choice_azure_cicd/blob/main/app/db.py"
click node_postgres "https://github.com/intontis/the_choice_azure_cicd/blob/main/db/schema.sql"
click node_seed "https://github.com/intontis/the_choice_azure_cicd/blob/main/db/seed.py"
click node_pipeline "https://github.com/intontis/the_choice_azure_cicd/blob/main/azure-pipelines.yml"
click node_manifest "https://github.com/intontis/the_choice_azure_cicd/blob/main/k8s/app/deployment.yaml"
click node_aks "https://github.com/intontis/the_choice_azure_cicd/tree/main/k8s"

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_routes,node_pages,node_animation toneBlue
class node_journey_svc,node_question_svc toneAmber
class node_dbconn,node_postgres,node_seed toneMint
class node_github,node_pipeline,node_acr,node_manifest,node_argocd,node_aks toneRose
class node_visitor toneIndigo
```

## Components

### Web experience

- [Flask app factory](https://github.com/intontis/the_choice_azure_cicd/blob/main/app/__init__.py): `app/__init__.py`
- [Journey routes](https://github.com/intontis/the_choice_azure_cicd/blob/main/app/routes/main.py): `app/routes/main.py`
- [Question and prophecy pages](https://github.com/intontis/the_choice_azure_cicd/tree/main/app/templates): `app/templates`
- [Matrix background](https://github.com/intontis/the_choice_azure_cicd/blob/main/app/static/matrix-rain.js): `app/static/matrix-rain.js`

### Journey logic

- [Journey service](https://github.com/intontis/the_choice_azure_cicd/blob/main/app/services/journey_service.py): `app/services/journey_service.py`
- [Question service](https://github.com/intontis/the_choice_azure_cicd/blob/main/app/services/question_service.py): `app/services/question_service.py`

### Persistence

- [Connection manager](https://github.com/intontis/the_choice_azure_cicd/blob/main/app/db.py): `app/db.py`
- [PostgreSQL data](https://github.com/intontis/the_choice_azure_cicd/blob/main/db/schema.sql): `db/schema.sql`
- [Question and prophecy seed](https://github.com/intontis/the_choice_azure_cicd/blob/main/db/seed.py): `db/seed.py`

### Cloud delivery

- **GitHub repository**
- [Azure Pipelines](https://github.com/intontis/the_choice_azure_cicd/blob/main/azure-pipelines.yml): `azure-pipelines.yml`
- **Azure Container Registry**
- [Kubernetes app manifest](https://github.com/intontis/the_choice_azure_cicd/blob/main/k8s/app/deployment.yaml): `k8s/app/deployment.yaml`
- **Argo CD**
- [AKS services and storage](https://github.com/intontis/the_choice_azure_cicd/tree/main/k8s): `k8s`

### Other components

- **Visitor**

## Connections

- Visitor → Journey routes: submits choices (evidence: `app/routes/main.py`)
- Flask app factory → Journey routes: registers routes (evidence: `app/__init__.py`)
- Journey routes → Question service: loads questions (evidence: `app/routes/main.py`)
- Journey routes → Journey service: creates and advances (evidence: `app/routes/main.py`)
- Journey routes → Question and prophecy pages: renders pages (evidence: `app/routes/main.py`)
- Question and prophecy pages → Visitor: shows journey (evidence: `README.md`)
- Question and prophecy pages → Matrix background: uses background (evidence: `README.md`)
- Journey service → Connection manager: gets connections (evidence: `app/services/journey_service.py`)
- Question service → Connection manager: gets connections (evidence: `app/services/question_service.py`)
- Connection manager → PostgreSQL data: connects (evidence: `app/db.py`)
- Journey service → PostgreSQL data: reads and writes journey data (evidence: `app/services/journey_service.py`)
- Question service → PostgreSQL data: reads questions (evidence: `app/services/question_service.py`)
- Question and prophecy seed → PostgreSQL data: seeds content (evidence: `db/seed.py`)
- GitHub repository → Azure Pipelines: triggers validation (evidence: `README.md`)
- Azure Pipelines → Azure Container Registry: publishes image (evidence: `README.md`)
- Azure Pipelines → Kubernetes app manifest: updates image reference (evidence: `README.md`)
- Kubernetes app manifest → GitHub repository: committed to (evidence: `README.md`)
- Argo CD → GitHub repository: monitors changes (evidence: `README.md`)
- Argo CD → AKS services and storage: synchronizes resources (evidence: `README.md`)
- AKS services and storage → PostgreSQL data: runs database (evidence: `README.md`)
