# kolugin/lottowebapp architecture

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

- Interactive diagram: https://gitdiagram.com/kolugin/lottowebapp
- Repository: https://github.com/kolugin/lottowebapp

## Overview

LottoWebApp collects lottery draw history and lets users explore it through statistical analyses, visualizations, and exports, with separate user and administrator roles. The main flow is draw-source ingestion into lottery storage, followed by game-specific querying and analysis. The README documents six analysis families, represented here as a shared analysis subsystem because individual page implementations were not sampled. Edges are limited to source-index references, excerpts, and README claims; several UI and integration details remain unverified.

Main entry points: [`LottoWebApp/Pages`](https://github.com/kolugin/lottowebapp/tree/master/LottoWebApp/Pages) (Razor web app), [`LottoWebApp/Pages/Analysis`](https://github.com/kolugin/lottowebapp/tree/master/LottoWebApp/Pages/Analysis) (Analysis pages), [`LottoWebApp/Data/LottoDbContext.cs`](https://github.com/kolugin/lottowebapp/blob/master/LottoWebApp/Data/LottoDbContext.cs) (Database context), [`LottoWebApp/Services`](https://github.com/kolugin/lottowebapp/tree/master/LottoWebApp/Services) (Analysis CSV helpers)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Access and roles"]
  node_web["Razor web app"]
  node_auth["Authentication"]
  node_profiles["User profiles"]
  node_admin["Admin console"]
end

subgraph group_ingest["Draw ingestion"]
  node_scheduler["Download schedulers"]
  node_downloader["Lottery downloader"]
end

subgraph group_data["Lottery data"]
  node_records["Draw record models"]
  node_accounts["Account models"]
  node_context["Database context<br/>[LottoDbContext.cs]"]
  node_store[("Lottery database<br/>[LottoDbContext.cs]")]
end

subgraph group_analysis["Analysis and export"]
  node_query["Game query provider"]
  node_analysispages["Analysis pages"]
  node_analysisfamilies["Analysis families"]
  node_exports["Analysis CSV helpers"]
  node_csvwriter["CSV file writer"]
  node_exportfiles["Export files"]
end

node_visitor(("User"))
node_admins(("Administrator"))
node_sources["Official draw sources"]

node_visitor -->|"uses"| node_web
node_admins -->|"uses"| node_web
node_web -.->|"authenticates"| node_auth
node_web -.->|"opens profile"| node_profiles
node_web -.->|"opens analysis"| node_analysispages
node_admins -.->|"manages"| node_admin
node_sources -->|"provides draws"| node_downloader
node_scheduler -->|"runs downloads"| node_downloader
node_downloader -->|"writes draws"| node_store
node_context -->|"maps tables"| node_store
node_context -->|"maps entities"| node_records
node_context -->|"maps entities"| node_accounts
node_query -->|"queries"| node_context
node_analysispages -.->|"uses game data"| node_query
node_analysispages -->|"implements"| node_analysisfamilies
node_analysispages -.->|"exports results"| node_exports
node_exports -->|"queries data"| node_query
node_exports -->|"delegates CSV"| node_csvwriter
node_csvwriter -->|"writes files"| node_exportfiles

click node_web "https://github.com/kolugin/lottowebapp/tree/master/LottoWebApp/Pages"
click node_auth "https://github.com/kolugin/lottowebapp/tree/master/LottoWebApp/Pages/Auth"
click node_profiles "https://github.com/kolugin/lottowebapp/tree/master/LottoWebApp/Pages/User"
click node_admin "https://github.com/kolugin/lottowebapp/tree/master/LottoWebApp/Pages/Admin"
click node_scheduler "https://github.com/kolugin/lottowebapp/tree/master/LottoWebApp/Services"
click node_downloader "https://github.com/kolugin/lottowebapp/blob/master/LottoWebApp/Services/LotteryDataDownloader.cs"
click node_records "https://github.com/kolugin/lottowebapp/tree/master/LottoWebApp/Models"
click node_accounts "https://github.com/kolugin/lottowebapp/tree/master/LottoWebApp/Models"
click node_context "https://github.com/kolugin/lottowebapp/blob/master/LottoWebApp/Data/LottoDbContext.cs"
click node_store "https://github.com/kolugin/lottowebapp/blob/master/LottoWebApp/Data/LottoDbContext.cs"
click node_query "https://github.com/kolugin/lottowebapp/blob/master/LottoWebApp/Services/LotteryQueryProvider.cs"
click node_analysispages "https://github.com/kolugin/lottowebapp/tree/master/LottoWebApp/Pages/Analysis"
click node_analysisfamilies "https://github.com/kolugin/lottowebapp/tree/master/LottoWebApp/Pages/Analysis"
click node_exports "https://github.com/kolugin/lottowebapp/tree/master/LottoWebApp/Services"
click node_csvwriter "https://github.com/kolugin/lottowebapp/blob/master/LottoWebApp/Services/CsvExportService.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_web,node_auth,node_profiles,node_admin,node_visitor toneBlue
class node_scheduler,node_downloader toneAmber
class node_records,node_accounts,node_context,node_store toneMint
class node_query,node_analysispages,node_analysisfamilies,node_exports,node_csvwriter,node_exportfiles toneRose
class node_admins,node_sources toneIndigo
```

## Components

### Access and roles

- [Razor web app](https://github.com/kolugin/lottowebapp/tree/master/LottoWebApp/Pages): `LottoWebApp/Pages`
- [Authentication](https://github.com/kolugin/lottowebapp/tree/master/LottoWebApp/Pages/Auth): `LottoWebApp/Pages/Auth`
- [User profiles](https://github.com/kolugin/lottowebapp/tree/master/LottoWebApp/Pages/User): `LottoWebApp/Pages/User`
- [Admin console](https://github.com/kolugin/lottowebapp/tree/master/LottoWebApp/Pages/Admin): `LottoWebApp/Pages/Admin`

### Draw ingestion

- [Download schedulers](https://github.com/kolugin/lottowebapp/tree/master/LottoWebApp/Services): `LottoWebApp/Services`
- [Lottery downloader](https://github.com/kolugin/lottowebapp/blob/master/LottoWebApp/Services/LotteryDataDownloader.cs): `LottoWebApp/Services/LotteryDataDownloader.cs`

### Lottery data

- [Draw record models](https://github.com/kolugin/lottowebapp/tree/master/LottoWebApp/Models): `LottoWebApp/Models`
- [Account models](https://github.com/kolugin/lottowebapp/tree/master/LottoWebApp/Models): `LottoWebApp/Models`
- [Database context](https://github.com/kolugin/lottowebapp/blob/master/LottoWebApp/Data/LottoDbContext.cs): `LottoWebApp/Data/LottoDbContext.cs`
- [Lottery database](https://github.com/kolugin/lottowebapp/blob/master/LottoWebApp/Data/LottoDbContext.cs): `LottoWebApp/Data/LottoDbContext.cs`

### Analysis and export

- [Game query provider](https://github.com/kolugin/lottowebapp/blob/master/LottoWebApp/Services/LotteryQueryProvider.cs): `LottoWebApp/Services/LotteryQueryProvider.cs`
- [Analysis pages](https://github.com/kolugin/lottowebapp/tree/master/LottoWebApp/Pages/Analysis): `LottoWebApp/Pages/Analysis`
- [Analysis families](https://github.com/kolugin/lottowebapp/tree/master/LottoWebApp/Pages/Analysis): `LottoWebApp/Pages/Analysis`
- [Analysis CSV helpers](https://github.com/kolugin/lottowebapp/tree/master/LottoWebApp/Services): `LottoWebApp/Services`
- [CSV file writer](https://github.com/kolugin/lottowebapp/blob/master/LottoWebApp/Services/CsvExportService.cs): `LottoWebApp/Services/CsvExportService.cs`
- **Export files**

### Other components

- **User**
- **Administrator**
- **Official draw sources**

## Connections

- User → Razor web app: uses (evidence: `README.md`)
- Administrator → Razor web app: uses (evidence: `README.md`)
- Razor web app → Authentication: authenticates
- Razor web app → User profiles: opens profile
- Razor web app → Analysis pages: opens analysis
- Administrator → Admin console: manages
- Official draw sources → Lottery downloader: provides draws (evidence: `README.md`)
- Download schedulers → Lottery downloader: runs downloads (evidence: `LottoWebApp/Services/_649DownloadService.cs`)
- Lottery downloader → Lottery database: writes draws (evidence: `LottoWebApp/Services/LotteryDataDownloader.cs`)
- Database context → Lottery database: maps tables (evidence: `LottoWebApp/Data/LottoDbContext.cs`)
- Database context → Draw record models: maps entities (evidence: `LottoWebApp/Data/LottoDbContext.cs`)
- Database context → Account models: maps entities (evidence: `LottoWebApp/Data/LottoDbContext.cs`)
- Game query provider → Database context: queries (evidence: `LottoWebApp/Services/LotteryQueryProvider.cs`)
- Analysis pages → Game query provider: uses game data
- Analysis pages → Analysis families: implements (evidence: `README.md`)
- Analysis pages → Analysis CSV helpers: exports results
- Analysis CSV helpers → Game query provider: queries data (evidence: `LottoWebApp/Services/A110CsvExportHelper.cs`)
- Analysis CSV helpers → CSV file writer: delegates CSV (evidence: `LottoWebApp/Services/A110CsvExportHelper.cs`)
- CSV file writer → Export files: writes files (evidence: `LottoWebApp/Services/CsvExportService.cs`)
