# boofinka/skywatch architecture

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

- Interactive diagram: https://gitdiagram.com/boofinka/skywatch
- Repository: https://github.com/boofinka/skywatch

## Overview

SkyWatch provides a browser-based weather lookup: a city search reaches the Flask frontend, which proxies the request to the backend; the backend resolves the city and fetches current conditions from Open-Meteo. The repository also documents a separate cluster-provisioning and GitOps deployment capability. Source excerpts establish the application calls and dynamic inventory behavior; infrastructure and deployment links below rely on README statements and directory paths, since those implementation files were not sampled.

Main entry points: [`ansible/playbooks`](https://github.com/boofinka/skywatch/tree/main/ansible/playbooks) (Ansible orchestration), [`frontend/app.py`](https://github.com/boofinka/skywatch/blob/main/frontend/app.py) (Flask frontend), [`backend/app.py`](https://github.com/boofinka/skywatch/blob/main/backend/app.py) (Weather API), [`ansible/inventories/multipass.py`](https://github.com/boofinka/skywatch/blob/main/ansible/inventories/multipass.py) (Dynamic inventory)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_weather["Weather application"]
  node_frontend["Flask frontend<br/>[app.py]"]
  node_weatherui["Weather search UI<br/>[index.html]"]
  node_backend["Weather API<br/>[app.py]"]
  node_geocoding{{"Open-Meteo geocoding"}}
  node_forecast{{"Open-Meteo forecast"}}
end

subgraph group_provision["Cluster provisioning"]
  node_multipass["Multipass VMs"]
  node_inventory["Dynamic inventory<br/>[multipass.py]"]
  node_ansible["Ansible orchestration"]
  node_common["Common prerequisites"]
  node_server["K3s control plane"]
  node_agents["K3s workers"]
  node_cluster{{"K3s cluster"}}
end

subgraph group_delivery["GitOps deployment"]
  node_helm["SkyWatch Helm chart"]
  node_argocd["ArgoCD GitOps"]
  node_terraform["Terraform bootstrap"]
  node_ingress{{"K3s Traefik ingress"}}
end

node_browser(("End user"))

node_browser -->|"searches"| node_frontend
node_frontend -->|"renders"| node_weatherui
node_frontend -->|"requests weather"| node_backend
node_backend -->|"resolves city"| node_geocoding
node_backend -->|"fetches conditions"| node_forecast
node_inventory -->|"queries instances"| node_multipass
node_ansible -->|"discovers hosts"| node_inventory
node_ansible -->|"applies role"| node_common
node_ansible -->|"installs control plane"| node_server
node_ansible -->|"joins workers"| node_agents
node_server -->|"creates control plane"| node_cluster
node_agents -->|"joins cluster"| node_cluster
node_terraform -->|"bootstraps"| node_argocd
node_argocd -->|"deploys chart"| node_helm
node_helm -->|"defines workloads"| node_cluster
node_browser -->|"reaches host"| node_ingress
node_ingress -->|"routes traffic"| node_frontend

click node_frontend "https://github.com/boofinka/skywatch/blob/main/frontend/app.py"
click node_weatherui "https://github.com/boofinka/skywatch/blob/main/frontend/templates/index.html"
click node_backend "https://github.com/boofinka/skywatch/blob/main/backend/app.py"
click node_inventory "https://github.com/boofinka/skywatch/blob/main/ansible/inventories/multipass.py"
click node_ansible "https://github.com/boofinka/skywatch/tree/main/ansible/playbooks"
click node_common "https://github.com/boofinka/skywatch/tree/main/ansible/roles/common"
click node_server "https://github.com/boofinka/skywatch/tree/main/ansible/roles/k3s-server"
click node_agents "https://github.com/boofinka/skywatch/tree/main/ansible/roles/k3s-agent"
click node_helm "https://github.com/boofinka/skywatch/tree/main/helm/skywatch"
click node_argocd "https://github.com/boofinka/skywatch/tree/main/argocd"
click node_terraform "https://github.com/boofinka/skywatch/tree/main/terraform"

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_frontend,node_weatherui,node_backend,node_geocoding,node_forecast,node_browser toneBlue
class node_multipass,node_inventory,node_ansible,node_common,node_server,node_agents,node_cluster toneAmber
class node_helm,node_argocd,node_terraform,node_ingress toneMint
```

## Components

### Weather application

- [Flask frontend](https://github.com/boofinka/skywatch/blob/main/frontend/app.py): `frontend/app.py`
- [Weather search UI](https://github.com/boofinka/skywatch/blob/main/frontend/templates/index.html): `frontend/templates/index.html`
- [Weather API](https://github.com/boofinka/skywatch/blob/main/backend/app.py): `backend/app.py`
- **Open-Meteo geocoding**
- **Open-Meteo forecast**

### Cluster provisioning

- **Multipass VMs**
- [Dynamic inventory](https://github.com/boofinka/skywatch/blob/main/ansible/inventories/multipass.py): `ansible/inventories/multipass.py`
- [Ansible orchestration](https://github.com/boofinka/skywatch/tree/main/ansible/playbooks): `ansible/playbooks`
- [Common prerequisites](https://github.com/boofinka/skywatch/tree/main/ansible/roles/common): `ansible/roles/common`
- [K3s control plane](https://github.com/boofinka/skywatch/tree/main/ansible/roles/k3s-server): `ansible/roles/k3s-server`
- [K3s workers](https://github.com/boofinka/skywatch/tree/main/ansible/roles/k3s-agent): `ansible/roles/k3s-agent`
- **K3s cluster**

### GitOps deployment

- [SkyWatch Helm chart](https://github.com/boofinka/skywatch/tree/main/helm/skywatch): `helm/skywatch`
- [ArgoCD GitOps](https://github.com/boofinka/skywatch/tree/main/argocd): `argocd`
- [Terraform bootstrap](https://github.com/boofinka/skywatch/tree/main/terraform): `terraform`
- **K3s Traefik ingress**

### Other components

- **End user**

## Connections

- End user → Flask frontend: searches (evidence: `README.md`)
- Flask frontend → Weather search UI: renders (evidence: `README.md`)
- Flask frontend → Weather API: requests weather (evidence: `frontend/app.py`)
- Weather API → Open-Meteo geocoding: resolves city (evidence: `backend/app.py`)
- Weather API → Open-Meteo forecast: fetches conditions (evidence: `backend/app.py`)
- Dynamic inventory → Multipass VMs: queries instances (evidence: `ansible/inventories/multipass.py`)
- Ansible orchestration → Dynamic inventory: discovers hosts (evidence: `README.md`)
- Ansible orchestration → Common prerequisites: applies role (evidence: `README.md`)
- Ansible orchestration → K3s control plane: installs control plane (evidence: `README.md`)
- Ansible orchestration → K3s workers: joins workers (evidence: `README.md`)
- K3s control plane → K3s cluster: creates control plane (evidence: `README.md`)
- K3s workers → K3s cluster: joins cluster (evidence: `README.md`)
- Terraform bootstrap → ArgoCD GitOps: bootstraps (evidence: `README.md`)
- ArgoCD GitOps → SkyWatch Helm chart: deploys chart (evidence: `README.md`)
- SkyWatch Helm chart → K3s cluster: defines workloads (evidence: `README.md`)
- End user → K3s Traefik ingress: reaches host (evidence: `README.md`)
- K3s Traefik ingress → Flask frontend: routes traffic (evidence: `README.md`)
