# clswhre/mango architecture

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

- Interactive diagram: https://gitdiagram.com/clswhre/mango
- Repository: https://github.com/clswhre/mango

## Overview

Mango is a WPF place-management desktop app. The user works through the main window’s tabs: they add categorized places, browse visited and planned places, select a place to view or edit details, and inspect statistics or weather. PlaceStore is the shared state boundary; SQLite provides persistence, while the weather service supplies external conditions and forecasts. The graph includes documented statistics and tab capabilities, but their implementation and some view-model wiring were not sampled, so those links are limited to documented responsibilities.

Main entry points: [`OOPWPFProject/Store/PlaceStore.cs`](https://github.com/clswhre/mango/blob/main/OOPWPFProject/Store/PlaceStore.cs) (Place store), [`OOPWPFProject/Views/MainWindow.xaml`](https://github.com/clswhre/mango/blob/main/OOPWPFProject/Views/MainWindow.xaml) (Main window), [`OOPWPFProject/ViewModels/MainViewModel.cs`](https://github.com/clswhre/mango/blob/main/OOPWPFProject/ViewModels/MainViewModel.cs) (Main coordinator), [`OOPWPFProject/ViewModels/LeftPanelViewModel.cs`](https://github.com/clswhre/mango/blob/main/OOPWPFProject/ViewModels/LeftPanelViewModel.cs) (Place entry logic)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["WPF interface"]
  node_app["Application startup<br/>[App.xaml.cs]"]
  node_window["Main window<br/>[MainWindow.xaml]"]
  node_left_view["Place entry panel<br/>[LeftPanel.xaml]"]
  node_content_view["Place content tabs<br/>[MainContent.xaml]"]
  node_details_view["Place details control"]
end

subgraph group_presentation["Presentation logic"]
  node_main_vm["Main coordinator<br/>[MainViewModel.cs]"]
  node_left_vm["Place entry logic"]
  node_content_vm["Place list logic"]
  node_details_vm["Details and editing"]
  node_statistics_vm["Statistics tab"]
  node_weather_vm["Weather tab"]
end

subgraph group_domain["Place domain"]
  node_place["Place model<br/>[Place.cs]"]
  node_place_types["Place categories"]
end

subgraph group_data["Place state and storage"]
  node_store["Place store<br/>[PlaceStore.cs]"]
  node_entity_manager["In-memory manager<br/>[EntityManager.cs]"]
  node_sqlite["SQLite storage<br/>[SQLiteStorage.cs]"]
  node_database[("Local places database<br/>[SQLiteStorage.cs]")]
end

subgraph group_integrations["External services"]
  node_weather_service["Weather service<br/>[IWeatherService.cs]"]
  node_weather_api["Weather API client<br/>[WeatherApi.cs]"]
end

node_user(("User"))
node_weather_provider["OpenWeather"]

node_user -->|"uses"| node_window
node_app -->|"creates"| node_main_vm
node_app -->|"creates"| node_weather_api
node_app -->|"shows"| node_window
node_window -->|"binds"| node_main_vm
node_window -->|"hosts"| node_left_view
node_window -->|"hosts"| node_content_view
node_content_view -->|"shows"| node_details_view
node_main_vm -->|"coordinates"| node_left_vm
node_main_vm -->|"coordinates"| node_content_vm
node_left_view -->|"binds"| node_left_vm
node_content_view -->|"binds"| node_content_vm
node_details_view -->|"binds"| node_details_vm
node_left_vm -->|"adds places"| node_store
node_left_vm -->|"creates category"| node_place_types
node_content_vm -->|"reads selection"| node_store
node_content_vm -->|"tracks visit state"| node_place
node_details_vm -->|"edits or deletes"| node_store
node_details_vm -->|"updates fields"| node_place
node_statistics_vm -->|"summarizes places"| node_store
node_weather_vm -->|"reads selection"| node_store
node_weather_vm -->|"requests weather"| node_weather_service
node_store -->|"manages places"| node_entity_manager
node_store -->|"persists places"| node_sqlite
node_sqlite -->|"reads and writes"| node_database
node_weather_api -.->|"requests conditions"| node_weather_provider
node_weather_api -.->|"downloads icons"| node_weather_provider
node_weather_service -->|"implemented by"| node_weather_api

click node_app "https://github.com/clswhre/mango/blob/main/OOPWPFProject/App.xaml.cs"
click node_window "https://github.com/clswhre/mango/blob/main/OOPWPFProject/Views/MainWindow.xaml"
click node_left_view "https://github.com/clswhre/mango/blob/main/OOPWPFProject/Views/LeftPanel.xaml"
click node_content_view "https://github.com/clswhre/mango/blob/main/OOPWPFProject/Views/MainContent.xaml"
click node_details_view "https://github.com/clswhre/mango/blob/main/OOPWPFProject/Views/PlaceDetailsControl.xaml"
click node_main_vm "https://github.com/clswhre/mango/blob/main/OOPWPFProject/ViewModels/MainViewModel.cs"
click node_left_vm "https://github.com/clswhre/mango/blob/main/OOPWPFProject/ViewModels/LeftPanelViewModel.cs"
click node_content_vm "https://github.com/clswhre/mango/blob/main/OOPWPFProject/ViewModels/MainContentViewModel.cs"
click node_details_vm "https://github.com/clswhre/mango/blob/main/OOPWPFProject/ViewModels/Tabs/DetailsTabViewModel.cs"
click node_statistics_vm "https://github.com/clswhre/mango/blob/main/OOPWPFProject/ViewModels/Tabs/StatisticTabViewModel.cs"
click node_weather_vm "https://github.com/clswhre/mango/blob/main/OOPWPFProject/ViewModels/Tabs/WeatherTabViewModel.cs"
click node_store "https://github.com/clswhre/mango/blob/main/OOPWPFProject/Store/PlaceStore.cs"
click node_entity_manager "https://github.com/clswhre/mango/blob/main/OOPWPFProject/Store/EntityManager.cs"
click node_place "https://github.com/clswhre/mango/blob/main/OOPWPFProject/Models/Places/Place.cs"
click node_place_types "https://github.com/clswhre/mango/tree/main/OOPWPFProject/Models/Places"
click node_sqlite "https://github.com/clswhre/mango/blob/main/OOPWPFProject/Services/DB/SQLiteStorage.cs"
click node_database "https://github.com/clswhre/mango/blob/main/OOPWPFProject/Services/DB/SQLiteStorage.cs"
click node_weather_service "https://github.com/clswhre/mango/blob/main/OOPWPFProject/Services/Weather/IWeatherService.cs"
click node_weather_api "https://github.com/clswhre/mango/blob/main/OOPWPFProject/Services/Weather/WeatherApi.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_window,node_left_view,node_content_view,node_details_view,node_user toneBlue
class node_main_vm,node_left_vm,node_content_vm,node_details_vm,node_statistics_vm,node_weather_vm toneAmber
class node_place,node_place_types toneMint
class node_store,node_entity_manager,node_sqlite,node_database toneRose
class node_weather_service,node_weather_api,node_weather_provider toneIndigo
```

## Components

### WPF interface

- [Application startup](https://github.com/clswhre/mango/blob/main/OOPWPFProject/App.xaml.cs): `OOPWPFProject/App.xaml.cs`
- [Main window](https://github.com/clswhre/mango/blob/main/OOPWPFProject/Views/MainWindow.xaml): `OOPWPFProject/Views/MainWindow.xaml`
- [Place entry panel](https://github.com/clswhre/mango/blob/main/OOPWPFProject/Views/LeftPanel.xaml): `OOPWPFProject/Views/LeftPanel.xaml`
- [Place content tabs](https://github.com/clswhre/mango/blob/main/OOPWPFProject/Views/MainContent.xaml): `OOPWPFProject/Views/MainContent.xaml`
- [Place details control](https://github.com/clswhre/mango/blob/main/OOPWPFProject/Views/PlaceDetailsControl.xaml): `OOPWPFProject/Views/PlaceDetailsControl.xaml`

### Presentation logic

- [Main coordinator](https://github.com/clswhre/mango/blob/main/OOPWPFProject/ViewModels/MainViewModel.cs): `OOPWPFProject/ViewModels/MainViewModel.cs`
- [Place entry logic](https://github.com/clswhre/mango/blob/main/OOPWPFProject/ViewModels/LeftPanelViewModel.cs): `OOPWPFProject/ViewModels/LeftPanelViewModel.cs`
- [Place list logic](https://github.com/clswhre/mango/blob/main/OOPWPFProject/ViewModels/MainContentViewModel.cs): `OOPWPFProject/ViewModels/MainContentViewModel.cs`
- [Details and editing](https://github.com/clswhre/mango/blob/main/OOPWPFProject/ViewModels/Tabs/DetailsTabViewModel.cs): `OOPWPFProject/ViewModels/Tabs/DetailsTabViewModel.cs`
- [Statistics tab](https://github.com/clswhre/mango/blob/main/OOPWPFProject/ViewModels/Tabs/StatisticTabViewModel.cs): `OOPWPFProject/ViewModels/Tabs/StatisticTabViewModel.cs`
- [Weather tab](https://github.com/clswhre/mango/blob/main/OOPWPFProject/ViewModels/Tabs/WeatherTabViewModel.cs): `OOPWPFProject/ViewModels/Tabs/WeatherTabViewModel.cs`

### Place domain

- [Place model](https://github.com/clswhre/mango/blob/main/OOPWPFProject/Models/Places/Place.cs): `OOPWPFProject/Models/Places/Place.cs`
- [Place categories](https://github.com/clswhre/mango/tree/main/OOPWPFProject/Models/Places): `OOPWPFProject/Models/Places`

### Place state and storage

- [Place store](https://github.com/clswhre/mango/blob/main/OOPWPFProject/Store/PlaceStore.cs): `OOPWPFProject/Store/PlaceStore.cs`
- [In-memory manager](https://github.com/clswhre/mango/blob/main/OOPWPFProject/Store/EntityManager.cs): `OOPWPFProject/Store/EntityManager.cs`
- [SQLite storage](https://github.com/clswhre/mango/blob/main/OOPWPFProject/Services/DB/SQLiteStorage.cs): `OOPWPFProject/Services/DB/SQLiteStorage.cs`
- [Local places database](https://github.com/clswhre/mango/blob/main/OOPWPFProject/Services/DB/SQLiteStorage.cs): `OOPWPFProject/Services/DB/SQLiteStorage.cs`

### External services

- [Weather service](https://github.com/clswhre/mango/blob/main/OOPWPFProject/Services/Weather/IWeatherService.cs): `OOPWPFProject/Services/Weather/IWeatherService.cs`
- [Weather API client](https://github.com/clswhre/mango/blob/main/OOPWPFProject/Services/Weather/WeatherApi.cs): `OOPWPFProject/Services/Weather/WeatherApi.cs`

### Other components

- **User**
- **OpenWeather**

## Connections

- User → Main window: uses
- Application startup → Main coordinator: creates
- Application startup → Weather API client: creates
- Application startup → Main window: shows
- Main window → Main coordinator: binds
- Main window → Place entry panel: hosts
- Main window → Place content tabs: hosts
- Place content tabs → Place details control: shows
- Main coordinator → Place entry logic: coordinates
- Main coordinator → Place list logic: coordinates
- Place entry panel → Place entry logic: binds
- Place content tabs → Place list logic: binds
- Place details control → Details and editing: binds
- Place entry logic → Place store: adds places
- Place entry logic → Place categories: creates category
- Place list logic → Place store: reads selection
- Place list logic → Place model: tracks visit state
- Details and editing → Place store: edits or deletes
- Details and editing → Place model: updates fields
- Statistics tab → Place store: summarizes places
- Weather tab → Place store: reads selection
- Weather tab → Weather service: requests weather
- Place store → In-memory manager: manages places
- Place store → SQLite storage: persists places
- SQLite storage → Local places database: reads and writes
- Weather API client → OpenWeather: requests conditions
- Weather API client → OpenWeather: downloads icons
- Weather service → Weather API client: implemented by
