# zaxiure/huntstats architecture

> Architecture diagram of the GitHub repository zaxiure/huntstats, 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/zaxiure/huntstats
- Repository: https://github.com/zaxiure/huntstats

## Overview

HuntStats is a .NET MAUI/Blazor app for importing Hunt: Showdown match XML, saving match history locally, and viewing match details, lists, settings, totals, accolades, and charts. The documented workflow is game XML → match parsing and persistence → match/statistics views. Sampled handlers confirm SQLite access, match reconstruction, and chart queries; page-to-handler wiring is not shown, so those links are marked unverified. The README notes that Hunt: Showdown removed the XML data the app depends on, limiting the documented workflow today.

Main entry points: [`HuntStats/Data/IDbConnectionFactory.cs`](https://github.com/zaxiure/huntstats/blob/master/HuntStats/Data/IDbConnectionFactory.cs) (SQLite Connections), [`HuntStats/Pages`](https://github.com/zaxiure/huntstats/tree/master/HuntStats/Pages) (Dashboard and Pages), [`HuntStats/Features/MatchHandler.cs`](https://github.com/zaxiure/huntstats/blob/master/HuntStats/Features/MatchHandler.cs) (Match Queries), [`HuntStats/Features/SettingsHandler.cs`](https://github.com/zaxiure/huntstats/blob/master/HuntStats/Features/SettingsHandler.cs) (Settings Handler)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["App UI"]
  node_pages["Dashboard and Pages"]
  node_components["UI Components"]
end

subgraph group_ingest["Match Ingestion"]
  node_xmlimport["XML Import<br/>[XmlFileHandler.cs]"]
  node_settings["Settings Handler<br/>[SettingsHandler.cs]"]
end

subgraph group_domain["Match Data"]
  node_matchhandler["Match Queries<br/>[MatchHandler.cs]"]
  node_entryhandler["Entry Queries<br/>[EntryHandler.cs]"]
  node_accoladehandler["Accolade Queries<br/>[AccoladeHandler.cs]"]
  node_matchmodels["Match Models<br/>[Match.cs]"]
  node_accolademodel["Accolade Model<br/>[Accolade.cs]"]
end

subgraph group_analytics["Statistics"]
  node_totalhandler["Totals<br/>[TotalHandler.cs]"]
  node_charts["Chart Queries"]
  node_chartdispatch["Chart Dispatch<br/>[ChartHandler.cs]"]
end

subgraph group_platform["Runtime and Storage"]
  node_appshell["MAUI App Shell<br/>[App.xaml.cs]"]
  node_mauireg["App Registration<br/>[MauiProgram.cs]"]
  node_appstate["Shared App State<br/>[AppState.cs]"]
  node_dbfactory["SQLite Connections"]
  node_database[("Local SQLite DB")]
  node_folderpicker["Windows Folder Picker<br/>[FolderPicker.cs]"]
end

node_user(("User"))
node_gamexml["Game XML"]

node_user -->|"uses"| node_pages
node_gamexml -->|"provides XML"| node_xmlimport
node_xmlimport -->|"opens connection"| node_dbfactory
node_xmlimport -->|"stores matches"| node_database
node_xmlimport -->|"notifies state"| node_appstate
node_settings -->|"opens connection"| node_dbfactory
node_settings -->|"reads settings"| node_database
node_settings -->|"updates state"| node_appstate
node_matchhandler -->|"opens connection"| node_dbfactory
node_matchhandler -->|"queries matches"| node_database
node_matchhandler -->|"maps records"| node_matchmodels
node_matchhandler -->|"notifies changes"| node_appstate
node_entryhandler -->|"opens connection"| node_dbfactory
node_accoladehandler -->|"opens connection"| node_dbfactory
node_accoladehandler -->|"uses model"| node_accolademodel
node_totalhandler -->|"opens connection"| node_dbfactory
node_charts -->|"opens connection"| node_dbfactory
node_charts -->|"requests matches"| node_matchhandler
node_charts -->|"requests settings"| node_settings
node_charts -->|"requests accolades"| node_accoladehandler
node_pages -.->|"requests match views"| node_matchhandler
node_pages -.->|"requests settings"| node_settings
node_pages -.->|"requests totals"| node_totalhandler
node_pages -.->|"requests charts"| node_chartdispatch
node_pages -.->|"renders components"| node_components
node_mauireg -->|"registers state"| node_appstate
node_mauireg -->|"registers connections"| node_dbfactory
node_mauireg -->|"registers picker"| node_folderpicker
node_appshell -.->|"creates app"| node_mauireg
node_dbfactory -->|"opens SQLite"| node_database

click node_appshell "https://github.com/zaxiure/huntstats/blob/master/HuntStats/App.xaml.cs"
click node_mauireg "https://github.com/zaxiure/huntstats/blob/master/HuntStats/MauiProgram.cs"
click node_pages "https://github.com/zaxiure/huntstats/tree/master/HuntStats/Pages"
click node_components "https://github.com/zaxiure/huntstats/tree/master/HuntStats/Components"
click node_appstate "https://github.com/zaxiure/huntstats/blob/master/HuntStats/State/AppState.cs"
click node_xmlimport "https://github.com/zaxiure/huntstats/blob/master/HuntStats/Features/XmlFileHandler.cs"
click node_settings "https://github.com/zaxiure/huntstats/blob/master/HuntStats/Features/SettingsHandler.cs"
click node_matchhandler "https://github.com/zaxiure/huntstats/blob/master/HuntStats/Features/MatchHandler.cs"
click node_entryhandler "https://github.com/zaxiure/huntstats/blob/master/HuntStats/Features/EntryHandler.cs"
click node_accoladehandler "https://github.com/zaxiure/huntstats/blob/master/HuntStats/Features/AccoladeHandler.cs"
click node_totalhandler "https://github.com/zaxiure/huntstats/blob/master/HuntStats/Features/TotalHandler.cs"
click node_charts "https://github.com/zaxiure/huntstats/tree/master/HuntStats/Features/ChartHandlers"
click node_chartdispatch "https://github.com/zaxiure/huntstats/blob/master/HuntStats/Features/ChartHandler.cs"
click node_matchmodels "https://github.com/zaxiure/huntstats/blob/master/HuntStats/Models/Match.cs"
click node_accolademodel "https://github.com/zaxiure/huntstats/blob/master/HuntStats/Models/Accolade.cs"
click node_dbfactory "https://github.com/zaxiure/huntstats/blob/master/HuntStats/Data/IDbConnectionFactory.cs"
click node_folderpicker "https://github.com/zaxiure/huntstats/blob/master/HuntStats/Platforms/Windows/FolderPicker.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_pages,node_components,node_user toneBlue
class node_xmlimport,node_settings toneAmber
class node_matchhandler,node_entryhandler,node_accoladehandler,node_matchmodels,node_accolademodel toneMint
class node_totalhandler,node_charts,node_chartdispatch toneRose
class node_appshell,node_mauireg,node_appstate,node_dbfactory,node_database,node_folderpicker,node_gamexml toneIndigo
```

## Components

### App UI

- [Dashboard and Pages](https://github.com/zaxiure/huntstats/tree/master/HuntStats/Pages): `HuntStats/Pages`
- [UI Components](https://github.com/zaxiure/huntstats/tree/master/HuntStats/Components): `HuntStats/Components`

### Match Ingestion

- [XML Import](https://github.com/zaxiure/huntstats/blob/master/HuntStats/Features/XmlFileHandler.cs): `HuntStats/Features/XmlFileHandler.cs`
- [Settings Handler](https://github.com/zaxiure/huntstats/blob/master/HuntStats/Features/SettingsHandler.cs): `HuntStats/Features/SettingsHandler.cs`

### Match Data

- [Match Queries](https://github.com/zaxiure/huntstats/blob/master/HuntStats/Features/MatchHandler.cs): `HuntStats/Features/MatchHandler.cs`
- [Entry Queries](https://github.com/zaxiure/huntstats/blob/master/HuntStats/Features/EntryHandler.cs): `HuntStats/Features/EntryHandler.cs`
- [Accolade Queries](https://github.com/zaxiure/huntstats/blob/master/HuntStats/Features/AccoladeHandler.cs): `HuntStats/Features/AccoladeHandler.cs`
- [Match Models](https://github.com/zaxiure/huntstats/blob/master/HuntStats/Models/Match.cs): `HuntStats/Models/Match.cs`
- [Accolade Model](https://github.com/zaxiure/huntstats/blob/master/HuntStats/Models/Accolade.cs): `HuntStats/Models/Accolade.cs`

### Statistics

- [Totals](https://github.com/zaxiure/huntstats/blob/master/HuntStats/Features/TotalHandler.cs): `HuntStats/Features/TotalHandler.cs`
- [Chart Queries](https://github.com/zaxiure/huntstats/tree/master/HuntStats/Features/ChartHandlers): `HuntStats/Features/ChartHandlers`
- [Chart Dispatch](https://github.com/zaxiure/huntstats/blob/master/HuntStats/Features/ChartHandler.cs): `HuntStats/Features/ChartHandler.cs`

### Runtime and Storage

- [MAUI App Shell](https://github.com/zaxiure/huntstats/blob/master/HuntStats/App.xaml.cs): `HuntStats/App.xaml.cs`
- [App Registration](https://github.com/zaxiure/huntstats/blob/master/HuntStats/MauiProgram.cs): `HuntStats/MauiProgram.cs`
- [Shared App State](https://github.com/zaxiure/huntstats/blob/master/HuntStats/State/AppState.cs): `HuntStats/State/AppState.cs`
- [SQLite Connections](https://github.com/zaxiure/huntstats/blob/master/HuntStats/Data/IDbConnectionFactory.cs): `HuntStats/Data/IDbConnectionFactory.cs`
- **Local SQLite DB**
- [Windows Folder Picker](https://github.com/zaxiure/huntstats/blob/master/HuntStats/Platforms/Windows/FolderPicker.cs): `HuntStats/Platforms/Windows/FolderPicker.cs`

### Other components

- **User**
- **Game XML**

## Connections

- User → Dashboard and Pages: uses (evidence: `README.md`)
- Game XML → XML Import: provides XML (evidence: `README.md`)
- XML Import → SQLite Connections: opens connection (evidence: `HuntStats/Features/XmlFileHandler.cs`)
- XML Import → Local SQLite DB: stores matches (evidence: `HuntStats/Features/XmlFileHandler.cs`)
- XML Import → Shared App State: notifies state (evidence: `HuntStats/Features/XmlFileHandler.cs`)
- Settings Handler → SQLite Connections: opens connection (evidence: `HuntStats/Features/SettingsHandler.cs`)
- Settings Handler → Local SQLite DB: reads settings (evidence: `HuntStats/Features/SettingsHandler.cs`)
- Settings Handler → Shared App State: updates state (evidence: `HuntStats/Features/SettingsHandler.cs`)
- Match Queries → SQLite Connections: opens connection (evidence: `HuntStats/Features/MatchHandler.cs`)
- Match Queries → Local SQLite DB: queries matches (evidence: `HuntStats/Features/MatchHandler.cs`)
- Match Queries → Match Models: maps records (evidence: `HuntStats/Features/MatchHandler.cs`)
- Match Queries → Shared App State: notifies changes (evidence: `HuntStats/Features/MatchHandler.cs`)
- Entry Queries → SQLite Connections: opens connection (evidence: `HuntStats/Features/EntryHandler.cs`)
- Accolade Queries → SQLite Connections: opens connection (evidence: `HuntStats/Features/AccoladeHandler.cs`)
- Accolade Queries → Accolade Model: uses model (evidence: `HuntStats/Features/AccoladeHandler.cs`)
- Totals → SQLite Connections: opens connection (evidence: `HuntStats/Features/TotalHandler.cs`)
- Chart Queries → SQLite Connections: opens connection (evidence: `HuntStats/Features/ChartHandlers/KillChartHandler.cs`)
- Chart Queries → Match Queries: requests matches (evidence: `HuntStats/Features/ChartHandlers/KillChartHandler.cs`)
- Chart Queries → Settings Handler: requests settings (evidence: `HuntStats/Features/ChartHandlers/KillChartHandler.cs`)
- Chart Queries → Accolade Queries: requests accolades (evidence: `HuntStats/Features/ChartHandlers/KillChartHandler.cs`)
- Dashboard and Pages → Match Queries: requests match views
- Dashboard and Pages → Settings Handler: requests settings
- Dashboard and Pages → Totals: requests totals
- Dashboard and Pages → Chart Dispatch: requests charts
- Dashboard and Pages → UI Components: renders components
- App Registration → Shared App State: registers state (evidence: `HuntStats/MauiProgram.cs`)
- App Registration → SQLite Connections: registers connections (evidence: `HuntStats/MauiProgram.cs`)
- App Registration → Windows Folder Picker: registers picker (evidence: `HuntStats/MauiProgram.cs`)
- MAUI App Shell → App Registration: creates app
- SQLite Connections → Local SQLite DB: opens SQLite (evidence: `HuntStats/Data/IDbConnectionFactory.cs`)
