# veirt/weathr architecture

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

- Interactive diagram: https://gitdiagram.com/veirt/weathr
- Repository: https://github.com/veirt/weathr

## Overview

weathr is a terminal weather app whose main workflow is to load settings, resolve a location, obtain weather data, and render an animated ASCII scene with a weather HUD. The graph includes the documented provider, location, theme, and animation capabilities. Some wiring is based on README or SOURCE INDEX references because the corresponding implementations were not excerpted; those limits are reflected in the edges.

Main entry points: [`src/app.rs`](https://github.com/veirt/weathr/blob/main/src/app.rs) (App loop), [`src/main.rs`](https://github.com/veirt/weathr/blob/main/src/main.rs) (CLI entry), [`src/weather/client.rs`](https://github.com/veirt/weathr/blob/main/src/weather/client.rs) (Weather client), [`src/scene/mod.rs`](https://github.com/veirt/weathr/blob/main/src/scene/mod.rs) (Scene registry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Application"]
  node_main["CLI entry<br/>[main.rs]"]
  node_config["Configuration<br/>[config.rs]"]
  node_app["App loop<br/>[app.rs]"]
  node_state["Weather state<br/>[app_state.rs]"]
end

subgraph group_weather["Weather and Location"]
  node_cache[("Weather cache<br/>[cache.rs]")]
  node_geolocation["Auto location<br/>[geolocation.rs]"]
  node_weather_client["Weather client<br/>[client.rs]"]
  node_providers["Weather providers"]
  node_open_meteo["Open-Meteo<br/>[open_meteo.rs]"]
  node_met_office["Met Office<br/>[met_office.rs]"]
  node_normalizer["Weather normalization<br/>[normalizer.rs]"]
  node_weather_types["Weather model<br/>[types.rs]"]
  node_nominatim["Nominatim geocoding"]
  node_ipinfo["IP location service"]
end

subgraph group_display["Scene and Rendering"]
  node_themes["Theme registry<br/>[mod.rs]"]
  node_world["World scene"]
  node_scene["Scene registry<br/>[mod.rs]"]
  node_overlay["Scene overlay<br/>[overlay.rs]"]
  node_style["World styling<br/>[style.rs]"]
  node_renderer["Terminal renderer<br/>[mod.rs]"]
end

subgraph group_motion["Animation Systems"]
  node_animation_manager["Animation manager"]
  node_animation_systems["Weather animations"]
end

node_user(("Terminal user"))

node_user -->|"runs"| node_main
node_main -->|"loads settings"| node_config
node_main -->|"resolves location"| node_geolocation
node_main -->|"starts app"| node_app
node_main -.->|"creates client"| node_weather_client
node_geolocation -->|"detects location"| node_ipinfo
node_config -->|"configures geocoding"| node_nominatim
node_app -->|"fetches weather"| node_weather_client
node_weather_client -->|"dispatches request"| node_providers
node_providers -->|"implements provider"| node_open_meteo
node_providers -->|"implements provider"| node_met_office
node_weather_client -->|"normalizes response"| node_normalizer
node_normalizer -->|"produces model"| node_weather_types
node_weather_client -->|"uses cache"| node_cache
node_app -.->|"updates state"| node_state
node_themes -->|"selects scene"| node_scene
node_app -->|"registers scene"| node_scene
node_scene -->|"registers world"| node_world
node_world -->|"uses styling"| node_style
node_scene -->|"supports overlays"| node_overlay
node_app -->|"renders animation"| node_animation_manager
node_animation_manager -->|"dispatches frames"| node_animation_systems
node_animation_manager -->|"draws frame"| node_renderer
node_world -->|"renders scene"| node_renderer
node_app -->|"renders HUD"| node_renderer

click node_main "https://github.com/veirt/weathr/blob/main/src/main.rs"
click node_config "https://github.com/veirt/weathr/blob/main/src/config.rs"
click node_app "https://github.com/veirt/weathr/blob/main/src/app.rs"
click node_state "https://github.com/veirt/weathr/blob/main/src/app_state.rs"
click node_cache "https://github.com/veirt/weathr/blob/main/src/cache.rs"
click node_geolocation "https://github.com/veirt/weathr/blob/main/src/geolocation.rs"
click node_weather_client "https://github.com/veirt/weathr/blob/main/src/weather/client.rs"
click node_providers "https://github.com/veirt/weathr/tree/main/src/weather/provider"
click node_open_meteo "https://github.com/veirt/weathr/blob/main/src/weather/provider/open_meteo.rs"
click node_met_office "https://github.com/veirt/weathr/blob/main/src/weather/provider/met_office.rs"
click node_normalizer "https://github.com/veirt/weathr/blob/main/src/weather/normalizer.rs"
click node_weather_types "https://github.com/veirt/weathr/blob/main/src/weather/types.rs"
click node_themes "https://github.com/veirt/weathr/blob/main/src/theme/mod.rs"
click node_world "https://github.com/veirt/weathr/tree/main/src/scene/world"
click node_scene "https://github.com/veirt/weathr/blob/main/src/scene/mod.rs"
click node_overlay "https://github.com/veirt/weathr/blob/main/src/scene/overlay.rs"
click node_style "https://github.com/veirt/weathr/blob/main/src/scene/world/style.rs"
click node_renderer "https://github.com/veirt/weathr/blob/main/src/render/mod.rs"
click node_animation_manager "https://github.com/veirt/weathr/blob/main/src/animation_manager.rs"
click node_animation_systems "https://github.com/veirt/weathr/tree/main/src/animation"

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_main,node_config,node_app,node_state,node_user toneBlue
class node_cache,node_geolocation,node_weather_client,node_providers,node_open_meteo,node_met_office,node_normalizer,node_weather_types,node_nominatim,node_ipinfo toneAmber
class node_themes,node_world,node_scene,node_overlay,node_style,node_renderer toneMint
class node_animation_manager,node_animation_systems toneRose
```

## Components

### Application

- [CLI entry](https://github.com/veirt/weathr/blob/main/src/main.rs): `src/main.rs`
- [Configuration](https://github.com/veirt/weathr/blob/main/src/config.rs): `src/config.rs`
- [App loop](https://github.com/veirt/weathr/blob/main/src/app.rs): `src/app.rs`
- [Weather state](https://github.com/veirt/weathr/blob/main/src/app_state.rs): `src/app_state.rs`

### Weather and Location

- [Weather cache](https://github.com/veirt/weathr/blob/main/src/cache.rs): `src/cache.rs`
- [Auto location](https://github.com/veirt/weathr/blob/main/src/geolocation.rs): `src/geolocation.rs`
- [Weather client](https://github.com/veirt/weathr/blob/main/src/weather/client.rs): `src/weather/client.rs`
- [Weather providers](https://github.com/veirt/weathr/tree/main/src/weather/provider): `src/weather/provider`
- [Open-Meteo](https://github.com/veirt/weathr/blob/main/src/weather/provider/open_meteo.rs): `src/weather/provider/open_meteo.rs`
- [Met Office](https://github.com/veirt/weathr/blob/main/src/weather/provider/met_office.rs): `src/weather/provider/met_office.rs`
- [Weather normalization](https://github.com/veirt/weathr/blob/main/src/weather/normalizer.rs): `src/weather/normalizer.rs`
- [Weather model](https://github.com/veirt/weathr/blob/main/src/weather/types.rs): `src/weather/types.rs`
- **Nominatim geocoding**
- **IP location service**

### Scene and Rendering

- [Theme registry](https://github.com/veirt/weathr/blob/main/src/theme/mod.rs): `src/theme/mod.rs`
- [World scene](https://github.com/veirt/weathr/tree/main/src/scene/world): `src/scene/world`
- [Scene registry](https://github.com/veirt/weathr/blob/main/src/scene/mod.rs): `src/scene/mod.rs`
- [Scene overlay](https://github.com/veirt/weathr/blob/main/src/scene/overlay.rs): `src/scene/overlay.rs`
- [World styling](https://github.com/veirt/weathr/blob/main/src/scene/world/style.rs): `src/scene/world/style.rs`
- [Terminal renderer](https://github.com/veirt/weathr/blob/main/src/render/mod.rs): `src/render/mod.rs`

### Animation Systems

- [Animation manager](https://github.com/veirt/weathr/blob/main/src/animation_manager.rs): `src/animation_manager.rs`
- [Weather animations](https://github.com/veirt/weathr/tree/main/src/animation): `src/animation`

### Other components

- **Terminal user**

## Connections

- Terminal user → CLI entry: runs (evidence: `README.md`)
- CLI entry → Configuration: loads settings (evidence: `src/main.rs`)
- CLI entry → Auto location: resolves location (evidence: `src/main.rs`)
- CLI entry → App loop: starts app (evidence: `src/main.rs`)
- CLI entry → Weather client: creates client
- Auto location → IP location service: detects location (evidence: `README.md`)
- Configuration → Nominatim geocoding: configures geocoding (evidence: `README.md`)
- App loop → Weather client: fetches weather (evidence: `src/app.rs`)
- Weather client → Weather providers: dispatches request (evidence: `src/weather/client.rs`)
- Weather providers → Open-Meteo: implements provider (evidence: `src/weather/provider/mod.rs`)
- Weather providers → Met Office: implements provider (evidence: `src/weather/provider/mod.rs`)
- Weather client → Weather normalization: normalizes response (evidence: `src/weather/client.rs`)
- Weather normalization → Weather model: produces model (evidence: `src/weather/normalizer.rs`)
- Weather client → Weather cache: uses cache (evidence: `src/weather/client.rs`)
- App loop → Weather state: updates state (evidence: `src/app.rs`)
- Theme registry → Scene registry: selects scene (evidence: `src/app.rs`)
- App loop → Scene registry: registers scene (evidence: `src/app.rs`)
- Scene registry → World scene: registers world (evidence: `src/scene/mod.rs`)
- World scene → World styling: uses styling (evidence: `src/scene/world/mod.rs`)
- Scene registry → Scene overlay: supports overlays (evidence: `src/scene/mod.rs`)
- App loop → Animation manager: renders animation (evidence: `src/app.rs`)
- Animation manager → Weather animations: dispatches frames (evidence: `src/animation_manager.rs`)
- Animation manager → Terminal renderer: draws frame (evidence: `src/animation_manager.rs`)
- World scene → Terminal renderer: renders scene (evidence: `src/scene/world/mod.rs`)
- App loop → Terminal renderer: renders HUD (evidence: `src/app.rs`)
