# mymtgo/client architecture

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

## Overview

mymtgo is a local desktop companion that passively reads MTGO logs and deck files, then turns them into searchable match history, performance analytics, and live-play aids. The documented core path is local logs through ingestion and match processing into local SQLite-backed records; users explore results through deck, match, league, dashboard, and opponent views. Separate branches cover limited drafts, archetype analysis, replay, and overlays. Pipeline orchestration and the sampled controllers support the wiring shown; unsampled feature implementations are represented at their existing directory paths, with uncertain internal calls omitted.

Main entry points: [`app/Actions/Pipeline/RunPipeline.php`](https://github.com/mymtgo/client/blob/main/app/Actions/Pipeline/RunPipeline.php) (Pipeline orchestration), [`app/Managers/MtgoManager.php`](https://github.com/mymtgo/client/blob/main/app/Managers/MtgoManager.php) (MTGO manager), [`app/Jobs/RunPipelineJob.php`](https://github.com/mymtgo/client/blob/main/app/Jobs/RunPipelineJob.php) (Pipeline job), [`app/Actions/Leagues`](https://github.com/mymtgo/client/tree/main/app/Actions/Leagues) (League tracking)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ingest["Capture and processing"]
  node_manager["MTGO manager<br/>[MtgoManager.php]"]
  node_pipeline_job["Pipeline job<br/>[RunPipelineJob.php]"]
  node_pipeline["Pipeline orchestration<br/>[RunPipeline.php]"]
  node_logs["Log ingestion"]
  node_match_processing["Match processing"]
  node_sidecar["Sidecar events"]
  node_drafts["Draft processing"]
end

subgraph group_analysis["Deck and performance"]
  node_leagues["League tracking"]
  node_tournaments["Tournament linking"]
  node_decks["Deck tracking"]
  node_archetypes["Archetype analysis"]
  node_cards["Card data and stats"]
  node_dashboard["Performance dashboard"]
  node_limited["Limited analytics"]
end

subgraph group_play["Live play features"]
  node_replays["Match replays"]
  node_overlay["Live overlay"]
  node_sideboard["Sideboard guides"]
  node_sync["Deck cloud sync"]
end

subgraph group_interface["Desktop experience"]
  node_controllers["Application controllers"]
  node_league_view["League view"]
  node_card_view["Card browser"]
  node_storage_view["Storage settings"]
  node_ingest_request["Manual ingestion"]
end

node_mtgo["MTGO files"]
node_user(("Player"))
node_db[("Local SQLite")]
node_web(("Desktop interface"))

node_mtgo -->|"reads paths"| node_manager
node_manager -->|"schedules tick"| node_pipeline_job
node_pipeline_job -->|"runs"| node_pipeline
node_pipeline -->|"ingests logs"| node_manager
node_manager -->|"scans and ingests"| node_logs
node_pipeline -->|"ingests and projects"| node_sidecar
node_pipeline -->|"processes events"| node_leagues
node_pipeline -->|"processes events"| node_drafts
node_pipeline -->|"processes matches"| node_match_processing
node_pipeline -->|"links and enqueues"| node_tournaments
node_logs -->|"records events"| node_db
node_match_processing -->|"stores match data"| node_db
node_sidecar -->|"projects events"| node_db
node_drafts -->|"records draft state"| node_db
node_leagues -->|"records league state"| node_db
node_tournaments -->|"updates matches"| node_db
node_decks -->|"reads and writes"| node_db
node_archetypes -->|"reads and writes"| node_db
node_cards -->|"reads and writes"| node_db
node_dashboard -->|"reads statistics"| node_db
node_limited -->|"reads and writes"| node_db
node_replays -->|"reads game data"| node_db
node_overlay -->|"reads live context"| node_db
node_sideboard -->|"reads and writes"| node_db
node_sync -.->|"syncs deck state"| node_db
node_user -->|"uses"| node_web
node_web -->|"requests views"| node_controllers
node_controllers -->|"serves product data"| node_db
node_league_view -->|"queries runs"| node_db
node_league_view -->|"formats runs"| node_leagues
node_card_view -->|"queries cards"| node_db
node_storage_view -->|"counts cards"| node_db
node_user -->|"requests ingestion"| node_ingest_request
node_ingest_request -->|"dispatches"| node_pipeline_job

click node_manager "https://github.com/mymtgo/client/blob/main/app/Managers/MtgoManager.php"
click node_pipeline_job "https://github.com/mymtgo/client/blob/main/app/Jobs/RunPipelineJob.php"
click node_pipeline "https://github.com/mymtgo/client/blob/main/app/Actions/Pipeline/RunPipeline.php"
click node_logs "https://github.com/mymtgo/client/tree/main/app/Actions/Logs"
click node_match_processing "https://github.com/mymtgo/client/tree/main/app/Actions/Matches"
click node_sidecar "https://github.com/mymtgo/client/tree/main/app/Actions/Sidecar"
click node_drafts "https://github.com/mymtgo/client/tree/main/app/Actions/Drafts"
click node_leagues "https://github.com/mymtgo/client/tree/main/app/Actions/Leagues"
click node_tournaments "https://github.com/mymtgo/client/tree/main/app/Actions/Tournaments"
click node_decks "https://github.com/mymtgo/client/tree/main/app/Actions/Decks"
click node_archetypes "https://github.com/mymtgo/client/tree/main/app/Actions/Archetypes"
click node_cards "https://github.com/mymtgo/client/tree/main/app/Actions/Cards"
click node_dashboard "https://github.com/mymtgo/client/tree/main/app/Actions/Dashboard"
click node_limited "https://github.com/mymtgo/client/tree/main/app/Actions/Limited"
click node_replays "https://github.com/mymtgo/client/tree/main/app/Actions/Replays"
click node_overlay "https://github.com/mymtgo/client/tree/main/app/Actions/Overlay"
click node_sideboard "https://github.com/mymtgo/client/tree/main/app/Actions/SideboardGuides"
click node_sync "https://github.com/mymtgo/client/tree/main/app/Actions/Sync"
click node_controllers "https://github.com/mymtgo/client/tree/main/app/Http/Controllers"
click node_league_view "https://github.com/mymtgo/client/blob/main/app/Http/Controllers/Leagues/IndexController.php"
click node_card_view "https://github.com/mymtgo/client/blob/main/app/Http/Controllers/Cards/IndexController.php"
click node_storage_view "https://github.com/mymtgo/client/blob/main/app/Http/Controllers/Settings/Pages/StorageController.php"
click node_ingest_request "https://github.com/mymtgo/client/blob/main/app/Http/Controllers/Settings/RunIngestController.php"

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_manager,node_pipeline_job,node_pipeline,node_logs,node_match_processing,node_sidecar,node_drafts toneBlue
class node_leagues,node_tournaments,node_decks,node_archetypes,node_cards,node_dashboard,node_limited,node_db toneAmber
class node_replays,node_overlay,node_sideboard,node_sync toneMint
class node_controllers,node_league_view,node_card_view,node_storage_view,node_ingest_request toneRose
class node_mtgo,node_user,node_web toneIndigo
```

## Components

### Capture and processing

- [MTGO manager](https://github.com/mymtgo/client/blob/main/app/Managers/MtgoManager.php): `app/Managers/MtgoManager.php`
- [Pipeline job](https://github.com/mymtgo/client/blob/main/app/Jobs/RunPipelineJob.php): `app/Jobs/RunPipelineJob.php`
- [Pipeline orchestration](https://github.com/mymtgo/client/blob/main/app/Actions/Pipeline/RunPipeline.php): `app/Actions/Pipeline/RunPipeline.php`
- [Log ingestion](https://github.com/mymtgo/client/tree/main/app/Actions/Logs): `app/Actions/Logs`
- [Match processing](https://github.com/mymtgo/client/tree/main/app/Actions/Matches): `app/Actions/Matches`
- [Sidecar events](https://github.com/mymtgo/client/tree/main/app/Actions/Sidecar): `app/Actions/Sidecar`
- [Draft processing](https://github.com/mymtgo/client/tree/main/app/Actions/Drafts): `app/Actions/Drafts`

### Deck and performance

- [League tracking](https://github.com/mymtgo/client/tree/main/app/Actions/Leagues): `app/Actions/Leagues`
- [Tournament linking](https://github.com/mymtgo/client/tree/main/app/Actions/Tournaments): `app/Actions/Tournaments`
- [Deck tracking](https://github.com/mymtgo/client/tree/main/app/Actions/Decks): `app/Actions/Decks`
- [Archetype analysis](https://github.com/mymtgo/client/tree/main/app/Actions/Archetypes): `app/Actions/Archetypes`
- [Card data and stats](https://github.com/mymtgo/client/tree/main/app/Actions/Cards): `app/Actions/Cards`
- [Performance dashboard](https://github.com/mymtgo/client/tree/main/app/Actions/Dashboard): `app/Actions/Dashboard`
- [Limited analytics](https://github.com/mymtgo/client/tree/main/app/Actions/Limited): `app/Actions/Limited`

### Live play features

- [Match replays](https://github.com/mymtgo/client/tree/main/app/Actions/Replays): `app/Actions/Replays`
- [Live overlay](https://github.com/mymtgo/client/tree/main/app/Actions/Overlay): `app/Actions/Overlay`
- [Sideboard guides](https://github.com/mymtgo/client/tree/main/app/Actions/SideboardGuides): `app/Actions/SideboardGuides`
- [Deck cloud sync](https://github.com/mymtgo/client/tree/main/app/Actions/Sync): `app/Actions/Sync`

### Desktop experience

- [Application controllers](https://github.com/mymtgo/client/tree/main/app/Http/Controllers): `app/Http/Controllers`
- [League view](https://github.com/mymtgo/client/blob/main/app/Http/Controllers/Leagues/IndexController.php): `app/Http/Controllers/Leagues/IndexController.php`
- [Card browser](https://github.com/mymtgo/client/blob/main/app/Http/Controllers/Cards/IndexController.php): `app/Http/Controllers/Cards/IndexController.php`
- [Storage settings](https://github.com/mymtgo/client/blob/main/app/Http/Controllers/Settings/Pages/StorageController.php): `app/Http/Controllers/Settings/Pages/StorageController.php`
- [Manual ingestion](https://github.com/mymtgo/client/blob/main/app/Http/Controllers/Settings/RunIngestController.php): `app/Http/Controllers/Settings/RunIngestController.php`

### Other components

- **MTGO files**
- **Player**
- **Local SQLite**
- **Desktop interface**

## Connections

- MTGO files → MTGO manager: reads paths
- MTGO manager → Pipeline job: schedules tick
- Pipeline job → Pipeline orchestration: runs
- Pipeline orchestration → MTGO manager: ingests logs
- MTGO manager → Log ingestion: scans and ingests
- Pipeline orchestration → Sidecar events: ingests and projects
- Pipeline orchestration → League tracking: processes events
- Pipeline orchestration → Draft processing: processes events
- Pipeline orchestration → Match processing: processes matches
- Pipeline orchestration → Tournament linking: links and enqueues
- Log ingestion → Local SQLite: records events
- Match processing → Local SQLite: stores match data
- Sidecar events → Local SQLite: projects events
- Draft processing → Local SQLite: records draft state
- League tracking → Local SQLite: records league state
- Tournament linking → Local SQLite: updates matches
- Deck tracking → Local SQLite: reads and writes
- Archetype analysis → Local SQLite: reads and writes
- Card data and stats → Local SQLite: reads and writes
- Performance dashboard → Local SQLite: reads statistics
- Limited analytics → Local SQLite: reads and writes
- Match replays → Local SQLite: reads game data
- Live overlay → Local SQLite: reads live context
- Sideboard guides → Local SQLite: reads and writes
- Deck cloud sync → Local SQLite: syncs deck state
- Player → Desktop interface: uses
- Desktop interface → Application controllers: requests views
- Application controllers → Local SQLite: serves product data
- League view → Local SQLite: queries runs
- League view → League tracking: formats runs
- Card browser → Local SQLite: queries cards
- Storage settings → Local SQLite: counts cards
- Player → Manual ingestion: requests ingestion
- Manual ingestion → Pipeline job: dispatches
