# videre-project/tracker architecture

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

- Interactive diagram: https://gitdiagram.com/videre-project/tracker
- Repository: https://github.com/videre-project/tracker

## Overview

Videre Tracker is a Windows-hosted web application for tracking MTGO gameplay and collections. The user-facing workflow runs from the embedded client through the Web API to live MTGO data and persisted history, then back to pages for match analysis, replay, collection, decks, and trades. The README documents real-time capture, statistics, replay, and performance insights; the tree supports additional collection, event, deck, and trade capabilities. Sampled excerpts are partial, so uncertain controller-to-service wiring is omitted.

Main entry points: [`src/server/src/Services/WebAPIService.cs`](https://github.com/videre-project/tracker/blob/main/src/server/src/Services/WebAPIService.cs) (Web API), [`src/server/src/Services/MTGO`](https://github.com/videre-project/tracker/tree/main/src/server/src/Services/MTGO) (MTGO services), [`src/client/src/router.tsx`](https://github.com/videre-project/tracker/blob/main/src/client/src/router.tsx) (Page router), [`src/client/src/main.tsx`](https://github.com/videre-project/tracker/blob/main/src/client/src/main.tsx) (React client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Host and API"]
  node_app["Application host<br/>[Program.cs]"]
  node_webapi["Web API<br/>[WebAPIService.cs]"]
  node_ui["Embedded UI host<br/>[HostForm.cs]"]
  node_clientcontroller["Client endpoints"]
  node_collectioncontroller["Collection endpoints"]
  node_deckscontroller["Deck endpoints<br/>[DecksController.cs]"]
  node_gamescontroller["Game endpoints<br/>[GamesController.cs]"]
  node_eventscontroller["Event endpoints"]
  node_tradescontroller["Trade endpoints"]
end

subgraph group_capture["MTGO capture"]
  node_mtgoservices["MTGO services"]
  node_eventcapture["Game event capture<br/>[EventTracker.cs]"]
  node_collectioncapture["Collection capture"]
  node_tradecapture["Trade capture<br/>[TradeAPIService.cs]"]
end

subgraph group_domain["Tracker data"]
  node_eventdb[("Event history store<br/>[EventContext.cs]")]
  node_collectiondb[("Collection store")]
  node_tradedb[("Trade history store<br/>[TradeContext.cs]")]
end

subgraph group_client["Web client"]
  node_client["React client<br/>[main.tsx]"]
  node_router["Page router<br/>[router.tsx]"]
  node_collectionui["Collection and decks<br/>[collection.tsx]"]
  node_gameui["Matches and replay<br/>[game-replay.tsx]"]
  node_eventsui["Events and trades<br/>[events.tsx]"]
  node_stateui["Client state"]
end

subgraph group_integrations["External services"]
  node_videre["Videre API"]
  node_videreclient["Videre integration<br/>[VidereAPIClient.cs]"]
end

node_user(("Player"))
node_mtgo["MTGO client"]

node_user -->|"uses"| node_client
node_app -->|"starts"| node_webapi
node_app -->|"hosts"| node_ui
node_ui -->|"displays"| node_client
node_client -->|"renders"| node_router
node_router -->|"routes"| node_collectionui
node_router -->|"routes"| node_gameui
node_router -->|"routes"| node_eventsui
node_client -->|"provides state"| node_stateui
node_collectionui -->|"requests data"| node_collectioncontroller
node_collectionui -->|"requests data"| node_deckscontroller
node_gameui -->|"requests data"| node_gamescontroller
node_eventsui -->|"requests data"| node_eventscontroller
node_eventsui -->|"requests data"| node_tradescontroller
node_stateui -->|"requests state"| node_clientcontroller
node_webapi -->|"dispatches"| node_clientcontroller
node_webapi -->|"dispatches"| node_collectioncontroller
node_webapi -->|"dispatches"| node_deckscontroller
node_webapi -->|"dispatches"| node_gamescontroller
node_webapi -->|"dispatches"| node_eventscontroller
node_webapi -->|"dispatches"| node_tradescontroller
node_mtgo -->|"supplies live data"| node_mtgoservices
node_mtgoservices -->|"tracks gameplay"| node_eventcapture
node_mtgoservices -->|"tracks collection"| node_collectioncapture
node_mtgoservices -->|"tracks trades"| node_tradecapture
node_eventcapture -->|"writes history"| node_eventdb
node_collectioncapture -->|"writes snapshots"| node_collectiondb
node_tradecapture -->|"writes history"| node_tradedb
node_collectioncontroller -->|"fetches products and prices"| node_videreclient
node_videreclient -->|"requests data"| node_videre

click node_app "https://github.com/videre-project/tracker/blob/main/src/server/src/Program.cs"
click node_webapi "https://github.com/videre-project/tracker/blob/main/src/server/src/Services/WebAPIService.cs"
click node_ui "https://github.com/videre-project/tracker/blob/main/src/server/src/WebView/HostForm.cs"
click node_client "https://github.com/videre-project/tracker/blob/main/src/client/src/main.tsx"
click node_router "https://github.com/videre-project/tracker/blob/main/src/client/src/router.tsx"
click node_collectionui "https://github.com/videre-project/tracker/blob/main/src/client/src/pages/collection.tsx"
click node_gameui "https://github.com/videre-project/tracker/blob/main/src/client/src/pages/game-replay.tsx"
click node_eventsui "https://github.com/videre-project/tracker/blob/main/src/client/src/pages/events.tsx"
click node_stateui "https://github.com/videre-project/tracker/blob/main/src/client/src/components/client-state-provider.tsx"
click node_clientcontroller "https://github.com/videre-project/tracker/blob/main/src/server/src/Controllers/ClientController.cs"
click node_collectioncontroller "https://github.com/videre-project/tracker/blob/main/src/server/src/Controllers/CollectionController.cs"
click node_deckscontroller "https://github.com/videre-project/tracker/blob/main/src/server/src/Controllers/DecksController.cs"
click node_gamescontroller "https://github.com/videre-project/tracker/blob/main/src/server/src/Controllers/GamesController.cs"
click node_eventscontroller "https://github.com/videre-project/tracker/blob/main/src/server/src/Controllers/EventsController.cs"
click node_tradescontroller "https://github.com/videre-project/tracker/blob/main/src/server/src/Controllers/TradesController.cs"
click node_mtgoservices "https://github.com/videre-project/tracker/tree/main/src/server/src/Services/MTGO"
click node_eventcapture "https://github.com/videre-project/tracker/blob/main/src/server/src/Services/MTGO/Events/EventTracker.cs"
click node_collectioncapture "https://github.com/videre-project/tracker/blob/main/src/server/src/Services/MTGO/CollectionAPIService.cs"
click node_tradecapture "https://github.com/videre-project/tracker/blob/main/src/server/src/Services/MTGO/TradeAPIService.cs"
click node_eventdb "https://github.com/videre-project/tracker/blob/main/src/server/src/Database/EventContext.cs"
click node_collectiondb "https://github.com/videre-project/tracker/blob/main/src/server/src/Database/CollectionContext.cs"
click node_tradedb "https://github.com/videre-project/tracker/blob/main/src/server/src/Database/TradeContext.cs"
click node_videreclient "https://github.com/videre-project/tracker/blob/main/src/server/src/Services/Videre/VidereAPIClient.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_webapi,node_ui,node_clientcontroller,node_collectioncontroller,node_deckscontroller,node_gamescontroller,node_eventscontroller,node_tradescontroller,node_mtgo toneBlue
class node_mtgoservices,node_eventcapture,node_collectioncapture,node_tradecapture toneAmber
class node_eventdb,node_collectiondb,node_tradedb toneMint
class node_client,node_router,node_collectionui,node_gameui,node_eventsui,node_stateui toneRose
class node_videre,node_videreclient,node_user toneIndigo
```

## Components

### Host and API

- [Application host](https://github.com/videre-project/tracker/blob/main/src/server/src/Program.cs): `src/server/src/Program.cs`
- [Web API](https://github.com/videre-project/tracker/blob/main/src/server/src/Services/WebAPIService.cs): `src/server/src/Services/WebAPIService.cs`
- [Embedded UI host](https://github.com/videre-project/tracker/blob/main/src/server/src/WebView/HostForm.cs): `src/server/src/WebView/HostForm.cs`
- [Client endpoints](https://github.com/videre-project/tracker/blob/main/src/server/src/Controllers/ClientController.cs): `src/server/src/Controllers/ClientController.cs`
- [Collection endpoints](https://github.com/videre-project/tracker/blob/main/src/server/src/Controllers/CollectionController.cs): `src/server/src/Controllers/CollectionController.cs`
- [Deck endpoints](https://github.com/videre-project/tracker/blob/main/src/server/src/Controllers/DecksController.cs): `src/server/src/Controllers/DecksController.cs`
- [Game endpoints](https://github.com/videre-project/tracker/blob/main/src/server/src/Controllers/GamesController.cs): `src/server/src/Controllers/GamesController.cs`
- [Event endpoints](https://github.com/videre-project/tracker/blob/main/src/server/src/Controllers/EventsController.cs): `src/server/src/Controllers/EventsController.cs`
- [Trade endpoints](https://github.com/videre-project/tracker/blob/main/src/server/src/Controllers/TradesController.cs): `src/server/src/Controllers/TradesController.cs`

### MTGO capture

- [MTGO services](https://github.com/videre-project/tracker/tree/main/src/server/src/Services/MTGO): `src/server/src/Services/MTGO`
- [Game event capture](https://github.com/videre-project/tracker/blob/main/src/server/src/Services/MTGO/Events/EventTracker.cs): `src/server/src/Services/MTGO/Events/EventTracker.cs`
- [Collection capture](https://github.com/videre-project/tracker/blob/main/src/server/src/Services/MTGO/CollectionAPIService.cs): `src/server/src/Services/MTGO/CollectionAPIService.cs`
- [Trade capture](https://github.com/videre-project/tracker/blob/main/src/server/src/Services/MTGO/TradeAPIService.cs): `src/server/src/Services/MTGO/TradeAPIService.cs`

### Tracker data

- [Event history store](https://github.com/videre-project/tracker/blob/main/src/server/src/Database/EventContext.cs): `src/server/src/Database/EventContext.cs`
- [Collection store](https://github.com/videre-project/tracker/blob/main/src/server/src/Database/CollectionContext.cs): `src/server/src/Database/CollectionContext.cs`
- [Trade history store](https://github.com/videre-project/tracker/blob/main/src/server/src/Database/TradeContext.cs): `src/server/src/Database/TradeContext.cs`

### Web client

- [React client](https://github.com/videre-project/tracker/blob/main/src/client/src/main.tsx): `src/client/src/main.tsx`
- [Page router](https://github.com/videre-project/tracker/blob/main/src/client/src/router.tsx): `src/client/src/router.tsx`
- [Collection and decks](https://github.com/videre-project/tracker/blob/main/src/client/src/pages/collection.tsx): `src/client/src/pages/collection.tsx`
- [Matches and replay](https://github.com/videre-project/tracker/blob/main/src/client/src/pages/game-replay.tsx): `src/client/src/pages/game-replay.tsx`
- [Events and trades](https://github.com/videre-project/tracker/blob/main/src/client/src/pages/events.tsx): `src/client/src/pages/events.tsx`
- [Client state](https://github.com/videre-project/tracker/blob/main/src/client/src/components/client-state-provider.tsx): `src/client/src/components/client-state-provider.tsx`

### External services

- **Videre API**
- [Videre integration](https://github.com/videre-project/tracker/blob/main/src/server/src/Services/Videre/VidereAPIClient.cs): `src/server/src/Services/Videre/VidereAPIClient.cs`

### Other components

- **Player**
- **MTGO client**

## Connections

- Player → React client: uses
- Application host → Web API: starts
- Application host → Embedded UI host: hosts
- Embedded UI host → React client: displays
- React client → Page router: renders
- Page router → Collection and decks: routes
- Page router → Matches and replay: routes
- Page router → Events and trades: routes
- React client → Client state: provides state
- Collection and decks → Collection endpoints: requests data
- Collection and decks → Deck endpoints: requests data
- Matches and replay → Game endpoints: requests data
- Events and trades → Event endpoints: requests data
- Events and trades → Trade endpoints: requests data
- Client state → Client endpoints: requests state
- Web API → Client endpoints: dispatches
- Web API → Collection endpoints: dispatches
- Web API → Deck endpoints: dispatches
- Web API → Game endpoints: dispatches
- Web API → Event endpoints: dispatches
- Web API → Trade endpoints: dispatches
- MTGO client → MTGO services: supplies live data
- MTGO services → Game event capture: tracks gameplay
- MTGO services → Collection capture: tracks collection
- MTGO services → Trade capture: tracks trades
- Game event capture → Event history store: writes history
- Collection capture → Collection store: writes snapshots
- Trade capture → Trade history store: writes history
- Collection endpoints → Videre integration: fetches products and prices
- Videre integration → Videre API: requests data
