# greendiary/clim8 architecture

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

- Interactive diagram: https://gitdiagram.com/greendiary/clim8
- Repository: https://github.com/greendiary/clim8

## Overview

Clim8 is a Windows tray-resident weather client. On interactive launch, the app obtains device coordinates, persists location and preferences, and opens a forecast card; the card fetches current, hourly, and daily conditions from Google Weather and renders them. The tray menu and settings panel provide alternate controls for opening the card, refreshing location or weather, changing units, and managing startup. The graph includes documented capabilities whose implementation was not sampled; relationships are shown only where excerpts or the README support them.

Main entry points: [`App.xaml.cs`](https://github.com/greendiary/clim8/blob/main/App.xaml.cs) (App lifecycle), [`MainWindow.xaml.cs`](https://github.com/greendiary/clim8/blob/main/MainWindow.xaml.cs) (Forecast card), [`WeatherService.cs`](https://github.com/greendiary/clim8/blob/main/WeatherService.cs) (Weather API client), [`DpiCompat.cs`](https://github.com/greendiary/clim8/blob/main/DpiCompat.cs) (DPI compatibility)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App orchestration"]
  node_app["App lifecycle<br/>[App.xaml.cs]"]
  node_dpi["DPI compatibility<br/>[DpiCompat.cs]"]
end

subgraph group_weather["Weather experience"]
  node_weather_window["Forecast card<br/>[MainWindow.xaml.cs]"]
  node_weather_service["Weather API client<br/>[WeatherService.cs]"]
  node_weather_models["Forecast models<br/>[Models.cs]"]
  node_weather_presentation["Weather formatting"]
  node_weather_icons["Weather artwork"]
end

subgraph group_settings["Settings and location"]
  node_settings_store[("Settings store<br/>[SettingsStore.cs]")]
  node_location_service["Device location"]
  node_settings_window["Settings panel"]
  node_startup_registration["Startup registration"]
end

subgraph group_tray["Tray controls"]
  node_tray_icon["Tray icon factory<br/>[TrayIconFactory.cs]"]
  node_tray_menu["Tray action menu"]
end

node_user(("Windows user"))
node_windows_location["Windows location"]
node_google_weather["Google Weather API"]

node_user -->|"launches"| node_app
node_app -->|"loads and saves"| node_settings_store
node_app -->|"requests position"| node_location_service
node_location_service -->|"reads coordinates"| node_windows_location
node_app -->|"opens card"| node_weather_window
node_weather_window -->|"requests forecast"| node_weather_service
node_weather_service -->|"fetches conditions"| node_google_weather
node_weather_service -.->|"builds snapshot"| node_weather_models
node_weather_window -->|"formats forecast"| node_weather_presentation
node_weather_window -->|"renders icons"| node_weather_icons
node_app -->|"opens settings"| node_settings_window
node_app -->|"sets startup"| node_startup_registration
node_app -->|"creates icon"| node_tray_icon
node_app -->|"opens menu"| node_tray_menu
node_user -->|"uses controls"| node_tray_icon
node_settings_window -->|"positions window"| node_dpi
node_tray_menu -->|"positions menu"| node_dpi
node_weather_window -.->|"positions card"| node_dpi

click node_app "https://github.com/greendiary/clim8/blob/main/App.xaml.cs"
click node_settings_store "https://github.com/greendiary/clim8/blob/main/SettingsStore.cs"
click node_location_service "https://github.com/greendiary/clim8/blob/main/DeviceLocationService.cs"
click node_settings_window "https://github.com/greendiary/clim8/blob/main/SettingsWindow.xaml.cs"
click node_startup_registration "https://github.com/greendiary/clim8/blob/main/StartupRegistration.cs"
click node_weather_window "https://github.com/greendiary/clim8/blob/main/MainWindow.xaml.cs"
click node_weather_service "https://github.com/greendiary/clim8/blob/main/WeatherService.cs"
click node_weather_models "https://github.com/greendiary/clim8/blob/main/Models.cs"
click node_weather_presentation "https://github.com/greendiary/clim8/blob/main/WeatherPresentation.cs"
click node_weather_icons "https://github.com/greendiary/clim8/blob/main/WeatherIconImage.cs"
click node_tray_icon "https://github.com/greendiary/clim8/blob/main/TrayIconFactory.cs"
click node_tray_menu "https://github.com/greendiary/clim8/blob/main/TrayMenuWindow.xaml.cs"
click node_dpi "https://github.com/greendiary/clim8/blob/main/DpiCompat.cs"

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_dpi,node_user toneBlue
class node_weather_window,node_weather_service,node_weather_models,node_weather_presentation,node_weather_icons toneAmber
class node_settings_store,node_location_service,node_settings_window,node_startup_registration,node_google_weather toneMint
class node_tray_icon,node_tray_menu toneRose
class node_windows_location toneIndigo
```

## Components

### App orchestration

- [App lifecycle](https://github.com/greendiary/clim8/blob/main/App.xaml.cs): `App.xaml.cs`
- [DPI compatibility](https://github.com/greendiary/clim8/blob/main/DpiCompat.cs): `DpiCompat.cs`

### Weather experience

- [Forecast card](https://github.com/greendiary/clim8/blob/main/MainWindow.xaml.cs): `MainWindow.xaml.cs`
- [Weather API client](https://github.com/greendiary/clim8/blob/main/WeatherService.cs): `WeatherService.cs`
- [Forecast models](https://github.com/greendiary/clim8/blob/main/Models.cs): `Models.cs`
- [Weather formatting](https://github.com/greendiary/clim8/blob/main/WeatherPresentation.cs): `WeatherPresentation.cs`
- [Weather artwork](https://github.com/greendiary/clim8/blob/main/WeatherIconImage.cs): `WeatherIconImage.cs`

### Settings and location

- [Settings store](https://github.com/greendiary/clim8/blob/main/SettingsStore.cs): `SettingsStore.cs`
- [Device location](https://github.com/greendiary/clim8/blob/main/DeviceLocationService.cs): `DeviceLocationService.cs`
- [Settings panel](https://github.com/greendiary/clim8/blob/main/SettingsWindow.xaml.cs): `SettingsWindow.xaml.cs`
- [Startup registration](https://github.com/greendiary/clim8/blob/main/StartupRegistration.cs): `StartupRegistration.cs`

### Tray controls

- [Tray icon factory](https://github.com/greendiary/clim8/blob/main/TrayIconFactory.cs): `TrayIconFactory.cs`
- [Tray action menu](https://github.com/greendiary/clim8/blob/main/TrayMenuWindow.xaml.cs): `TrayMenuWindow.xaml.cs`

### Other components

- **Windows user**
- **Windows location**
- **Google Weather API**

## Connections

- Windows user → App lifecycle: launches (evidence: `README.md`)
- App lifecycle → Settings store: loads and saves (evidence: `README.md`)
- App lifecycle → Device location: requests position (evidence: `App.xaml.cs`)
- Device location → Windows location: reads coordinates (evidence: `DeviceLocationService.cs`)
- App lifecycle → Forecast card: opens card (evidence: `App.xaml.cs`)
- Forecast card → Weather API client: requests forecast (evidence: `MainWindow.xaml.cs`)
- Weather API client → Google Weather API: fetches conditions (evidence: `WeatherService.cs`)
- Weather API client → Forecast models: builds snapshot
- Forecast card → Weather formatting: formats forecast (evidence: `MainWindow.xaml.cs`)
- Forecast card → Weather artwork: renders icons (evidence: `MainWindow.xaml.cs`)
- App lifecycle → Settings panel: opens settings (evidence: `App.xaml.cs`)
- App lifecycle → Startup registration: sets startup (evidence: `App.xaml.cs`)
- App lifecycle → Tray icon factory: creates icon (evidence: `App.xaml.cs`)
- App lifecycle → Tray action menu: opens menu (evidence: `App.xaml.cs`)
- Windows user → Tray icon factory: uses controls (evidence: `README.md`)
- Settings panel → DPI compatibility: positions window (evidence: `SettingsWindow.xaml.cs`)
- Tray action menu → DPI compatibility: positions menu (evidence: `TrayMenuWindow.xaml.cs`)
- Forecast card → DPI compatibility: positions card (evidence: `MainWindow.xaml.cs`)
