# collinszheng/steamgamepicker architecture

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

- Interactive diagram: https://gitdiagram.com/collinszheng/steamgamepicker
- Repository: https://github.com/collinszheng/steamgamepicker

## Overview

Steam Game Picker is a Tkinter desktop app that resolves a Steam identity, loads a public game library, lets the user filter and exclude titles, and randomly picks a game with details and a recent-picks history. Startup assembles the window, worker, and Steam client; the worker keeps network calls off the UI thread. The README documents caching, language switching, settings, and certificate-trust fallback. Edges are limited to relationships visible in excerpts, the source index, or README; unsampled implementation details are not inferred.

Main entry points: [`app/ui/main_window.py`](https://github.com/collinszheng/steamgamepicker/blob/main/app/ui/main_window.py) (Main window), [`main.py`](https://github.com/collinszheng/steamgamepicker/blob/main/main.py) (App assembly), [`app/steam_api.py`](https://github.com/collinszheng/steamgamepicker/blob/main/app/steam_api.py) (Steam API client), [`app/ui/settings_dialog.py`](https://github.com/collinszheng/steamgamepicker/blob/main/app/ui/settings_dialog.py) (Settings dialog)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_startup["App startup"]
  node_entry["App assembly<br/>[main.py]"]
  node_worker["Background worker<br/>[worker.py]"]
  node_cancel["Cancellation tokens<br/>[cancellation.py]"]
  node_logging[("Redacted logs<br/>[logging_setup.py]")]
  node_language_marker[("Install language marker<br/>[language_marker.py]")]
end

subgraph group_library["Library and picking"]
  node_models["Game data models<br/>[models.py]"]
  node_pool["Filters and draw pool<br/>[pool.py]"]
end

subgraph group_steam["Steam access"]
  node_identity["Identity parsing<br/>[steamid.py]"]
  node_steamclient["Steam API client<br/>[steam_api.py]"]
  node_steamservice{{"Steam Web API"}}
  node_trust["Trust fallback<br/>[trust.py]"]
  node_errors["Error classification<br/>[errors.py]"]
  node_details["Game details<br/>[steam_api.py]"]
end

subgraph group_persistence["Local data"]
  node_config[("Configuration<br/>[config.py]")]
  node_cache[("Library and detail cache<br/>[cache.py]")]
  node_history[("Pick history<br/>[history.py]")]
end

subgraph group_interface["Interface"]
  node_window["Main window<br/>[main_window.py]"]
  node_images["Cover images<br/>[images.py]"]
  node_animation["Draw animation<br/>[animator.py]"]
  node_historyview["History window<br/>[history_dialog.py]"]
  node_settings["Settings dialog<br/>[settings_dialog.py]"]
  node_theme["Theme and layout<br/>[theme.py]"]
  node_i18n["Translations<br/>[i18n.py]"]
  node_state["UI state mapping<br/>[state.py]"]
end

node_user(("User"))

node_user -->|"uses"| node_window
node_entry -->|"creates"| node_worker
node_entry -->|"creates"| node_steamclient
node_entry -->|"assembles"| node_window
node_entry -->|"loads"| node_config
node_entry -->|"configures"| node_logging
node_entry -->|"consumes"| node_language_marker
node_window -->|"submits tasks"| node_worker
node_worker -->|"uses"| node_cancel
node_window -->|"parses input"| node_identity
node_window -->|"requests library"| node_steamclient
node_steamclient -->|"calls"| node_steamservice
node_steamclient -->|"retries with"| node_trust
node_steamclient -->|"classifies failures"| node_errors
node_steamclient -->|"returns game data"| node_models
node_window -->|"filters and draws"| node_pool
node_pool -->|"operates on"| node_models
node_window -->|"uses cached data"| node_cache
node_window -->|"loads details"| node_details
node_window -->|"loads covers"| node_images
node_window -->|"animates draw"| node_animation
node_window -->|"records picks"| node_history
node_historyview -->|"reads records"| node_history
node_window -->|"opens"| node_settings
node_settings -->|"saves settings"| node_config
node_window -->|"uses configuration"| node_config
node_window -->|"applies theme"| node_theme
node_settings -->|"uses theme"| node_theme
node_window -->|"translates interface"| node_i18n
node_settings -->|"translates controls"| node_i18n
node_window -->|"updates controls"| node_state
node_cache -->|"uses storage paths"| node_config

click node_entry "https://github.com/collinszheng/steamgamepicker/blob/main/main.py"
click node_window "https://github.com/collinszheng/steamgamepicker/blob/main/app/ui/main_window.py"
click node_worker "https://github.com/collinszheng/steamgamepicker/blob/main/app/worker.py"
click node_cancel "https://github.com/collinszheng/steamgamepicker/blob/main/app/cancellation.py"
click node_identity "https://github.com/collinszheng/steamgamepicker/blob/main/app/steamid.py"
click node_steamclient "https://github.com/collinszheng/steamgamepicker/blob/main/app/steam_api.py"
click node_trust "https://github.com/collinszheng/steamgamepicker/blob/main/app/trust.py"
click node_errors "https://github.com/collinszheng/steamgamepicker/blob/main/app/errors.py"
click node_models "https://github.com/collinszheng/steamgamepicker/blob/main/app/models.py"
click node_pool "https://github.com/collinszheng/steamgamepicker/blob/main/app/pool.py"
click node_details "https://github.com/collinszheng/steamgamepicker/blob/main/app/steam_api.py"
click node_images "https://github.com/collinszheng/steamgamepicker/blob/main/app/images.py"
click node_animation "https://github.com/collinszheng/steamgamepicker/blob/main/app/ui/animator.py"
click node_historyview "https://github.com/collinszheng/steamgamepicker/blob/main/app/ui/history_dialog.py"
click node_settings "https://github.com/collinszheng/steamgamepicker/blob/main/app/ui/settings_dialog.py"
click node_theme "https://github.com/collinszheng/steamgamepicker/blob/main/app/ui/theme.py"
click node_i18n "https://github.com/collinszheng/steamgamepicker/blob/main/app/i18n.py"
click node_state "https://github.com/collinszheng/steamgamepicker/blob/main/app/state.py"
click node_config "https://github.com/collinszheng/steamgamepicker/blob/main/app/config.py"
click node_cache "https://github.com/collinszheng/steamgamepicker/blob/main/app/cache.py"
click node_history "https://github.com/collinszheng/steamgamepicker/blob/main/app/history.py"
click node_logging "https://github.com/collinszheng/steamgamepicker/blob/main/app/logging_setup.py"
click node_language_marker "https://github.com/collinszheng/steamgamepicker/blob/main/app/language_marker.py"

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_entry,node_worker,node_cancel,node_logging,node_language_marker,node_user toneBlue
class node_models,node_pool toneAmber
class node_identity,node_steamclient,node_steamservice,node_trust,node_errors,node_details toneMint
class node_config,node_cache,node_history toneRose
class node_window,node_images,node_animation,node_historyview,node_settings,node_theme,node_i18n,node_state toneIndigo
```

## Components

### App startup

- [App assembly](https://github.com/collinszheng/steamgamepicker/blob/main/main.py): `main.py`
- [Background worker](https://github.com/collinszheng/steamgamepicker/blob/main/app/worker.py): `app/worker.py`
- [Cancellation tokens](https://github.com/collinszheng/steamgamepicker/blob/main/app/cancellation.py): `app/cancellation.py`
- [Redacted logs](https://github.com/collinszheng/steamgamepicker/blob/main/app/logging_setup.py): `app/logging_setup.py`
- [Install language marker](https://github.com/collinszheng/steamgamepicker/blob/main/app/language_marker.py): `app/language_marker.py`

### Library and picking

- [Game data models](https://github.com/collinszheng/steamgamepicker/blob/main/app/models.py): `app/models.py`
- [Filters and draw pool](https://github.com/collinszheng/steamgamepicker/blob/main/app/pool.py): `app/pool.py`

### Steam access

- [Identity parsing](https://github.com/collinszheng/steamgamepicker/blob/main/app/steamid.py): `app/steamid.py`
- [Steam API client](https://github.com/collinszheng/steamgamepicker/blob/main/app/steam_api.py): `app/steam_api.py`
- **Steam Web API**
- [Trust fallback](https://github.com/collinszheng/steamgamepicker/blob/main/app/trust.py): `app/trust.py`
- [Error classification](https://github.com/collinszheng/steamgamepicker/blob/main/app/errors.py): `app/errors.py`
- [Game details](https://github.com/collinszheng/steamgamepicker/blob/main/app/steam_api.py): `app/steam_api.py`

### Local data

- [Configuration](https://github.com/collinszheng/steamgamepicker/blob/main/app/config.py): `app/config.py`
- [Library and detail cache](https://github.com/collinszheng/steamgamepicker/blob/main/app/cache.py): `app/cache.py`
- [Pick history](https://github.com/collinszheng/steamgamepicker/blob/main/app/history.py): `app/history.py`

### Interface

- [Main window](https://github.com/collinszheng/steamgamepicker/blob/main/app/ui/main_window.py): `app/ui/main_window.py`
- [Cover images](https://github.com/collinszheng/steamgamepicker/blob/main/app/images.py): `app/images.py`
- [Draw animation](https://github.com/collinszheng/steamgamepicker/blob/main/app/ui/animator.py): `app/ui/animator.py`
- [History window](https://github.com/collinszheng/steamgamepicker/blob/main/app/ui/history_dialog.py): `app/ui/history_dialog.py`
- [Settings dialog](https://github.com/collinszheng/steamgamepicker/blob/main/app/ui/settings_dialog.py): `app/ui/settings_dialog.py`
- [Theme and layout](https://github.com/collinszheng/steamgamepicker/blob/main/app/ui/theme.py): `app/ui/theme.py`
- [Translations](https://github.com/collinszheng/steamgamepicker/blob/main/app/i18n.py): `app/i18n.py`
- [UI state mapping](https://github.com/collinszheng/steamgamepicker/blob/main/app/state.py): `app/state.py`

### Other components

- **User**

## Connections

- User → Main window: uses (evidence: `README.md`)
- App assembly → Background worker: creates (evidence: `main.py`)
- App assembly → Steam API client: creates (evidence: `main.py`)
- App assembly → Main window: assembles (evidence: `main.py`)
- App assembly → Configuration: loads (evidence: `main.py`)
- App assembly → Redacted logs: configures (evidence: `main.py`)
- App assembly → Install language marker: consumes (evidence: `main.py`)
- Main window → Background worker: submits tasks (evidence: `app/ui/main_window.py`)
- Background worker → Cancellation tokens: uses (evidence: `app/worker.py`)
- Main window → Identity parsing: parses input (evidence: `app/ui/main_window.py`)
- Main window → Steam API client: requests library (evidence: `README.md`)
- Steam API client → Steam Web API: calls (evidence: `README.md`)
- Steam API client → Trust fallback: retries with (evidence: `app/steam_api.py`)
- Steam API client → Error classification: classifies failures (evidence: `app/steam_api.py`)
- Steam API client → Game data models: returns game data (evidence: `app/steam_api.py`)
- Main window → Filters and draw pool: filters and draws (evidence: `app/ui/main_window.py`)
- Filters and draw pool → Game data models: operates on (evidence: `app/pool.py`)
- Main window → Library and detail cache: uses cached data (evidence: `app/ui/main_window.py`)
- Main window → Game details: loads details (evidence: `README.md`)
- Main window → Cover images: loads covers (evidence: `app/ui/main_window.py`)
- Main window → Draw animation: animates draw (evidence: `app/ui/main_window.py`)
- Main window → Pick history: records picks (evidence: `app/ui/main_window.py`)
- History window → Pick history: reads records (evidence: `app/ui/history_dialog.py`)
- Main window → Settings dialog: opens (evidence: `app/ui/main_window.py`)
- Settings dialog → Configuration: saves settings (evidence: `app/ui/settings_dialog.py`)
- Main window → Configuration: uses configuration (evidence: `app/ui/main_window.py`)
- Main window → Theme and layout: applies theme (evidence: `app/ui/main_window.py`)
- Settings dialog → Theme and layout: uses theme (evidence: `app/ui/settings_dialog.py`)
- Main window → Translations: translates interface (evidence: `app/ui/main_window.py`)
- Settings dialog → Translations: translates controls (evidence: `app/ui/settings_dialog.py`)
- Main window → UI state mapping: updates controls (evidence: `app/ui/main_window.py`)
- Library and detail cache → Configuration: uses storage paths (evidence: `app/cache.py`)
