# natsteff/forge-gamesheets architecture

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

- Interactive diagram: https://gitdiagram.com/natsteff/forge-gamesheets
- Repository: https://github.com/natsteff/forge-gamesheets

## Overview

FORGE GameSheets is a self-hosted library and creation app for printable game resources, with temporary LiveSheets for scoring. The main user workflow is to scan and organize a file collection, find and preview resources, then create or print structured sheets or start live scoring from compatible saved sheets. README-described collection management also includes links, artwork, optional BoardGameGeek associations, Reprints, accounts, backups, and metadata portability. The graph uses documented capabilities and visible wiring; several subsystem internals were not sampled, so some relationships are omitted.

Main entry points: [`app/main.py`](https://github.com/natsteff/forge-gamesheets/blob/main/app/main.py) (Application setup), [`app/sheet_designer/web.py`](https://github.com/natsteff/forge-gamesheets/blob/main/app/sheet_designer/web.py) (Designer interface), [`app/web.py`](https://github.com/natsteff/forge-gamesheets/blob/main/app/web.py) (Web interface), [`app/bgg/jobs.py`](https://github.com/natsteff/forge-gamesheets/blob/main/app/bgg/jobs.py) (BoardGameGeek integration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_http["HTTP application"]
  node_app["Application setup<br/>[main.py]"]
  node_web["Web interface<br/>[web.py]"]
end

subgraph group_library["Game library"]
  node_scan["Library scanning<br/>[scanner.py]"]
  node_reconcile["Scan reconciliation<br/>[reconciliation.py]"]
  node_library_data["Library queries<br/>[repository.py]"]
  node_database[("Application database<br/>[database.py]")]
  node_file_access["Resource files<br/>[files.py]"]
  node_previews["Resource previews<br/>[previews.py]"]
end

subgraph group_designer["Sheet creation"]
  node_designer_web["Designer interface<br/>[web.py]"]
  node_sheet_model["FGS document model<br/>[model.py]"]
  node_drafts[("Draft storage<br/>[storage.py]")]
  node_renderer["FGS renderer<br/>[index.mjs]"]
end

subgraph group_play["Live play"]
  node_live_web["LiveSheet interface<br/>[livesheet_web.py]"]
  node_live_sessions["Live scoring sessions<br/>[livesheet.py]"]
end

subgraph group_management["Collection management"]
  node_links_artwork["Links and artwork<br/>[game_links.py]"]
  node_bgg["BoardGameGeek integration<br/>[jobs.py]"]
  node_reprints["Reprint management"]
  node_portability["Metadata portability"]
  node_accounts["Local accounts<br/>[accounts.py]"]
end

node_user(("User"))
node_external_bgg(("BoardGameGeek<br/>external system"))

node_user -->|"opens app"| node_app
node_app -->|"registers routes"| node_web
node_user -->|"browses library"| node_web
node_web -.->|"requests scan"| node_scan
node_app -->|"initializes scanning"| node_scan
node_app -->|"reconciles collection"| node_reconcile
node_user -->|"searches resources"| node_library_data
node_user -->|"previews resources"| node_previews
node_user -->|"downloads originals"| node_file_access
node_user -->|"creates sheets"| node_designer_web
node_designer_web -->|"validates documents"| node_sheet_model
node_designer_web -->|"manages drafts"| node_drafts
node_user -->|"exports print output"| node_renderer
node_user -->|"starts LiveSheet"| node_live_web
node_live_web -.->|"runs scoring"| node_live_sessions
node_user -->|"manages game details"| node_links_artwork
node_user -->|"associates games"| node_bgg
node_bgg -->|"queries metadata"| node_external_bgg
node_user -->|"maintains Reprints"| node_reprints
node_user -->|"moves metadata"| node_portability
node_user -->|"uses local accounts"| node_accounts
node_external_bgg -->|"returns metadata"| node_bgg

click node_app "https://github.com/natsteff/forge-gamesheets/blob/main/app/main.py"
click node_web "https://github.com/natsteff/forge-gamesheets/blob/main/app/web.py"
click node_scan "https://github.com/natsteff/forge-gamesheets/blob/main/app/library/scanner.py"
click node_reconcile "https://github.com/natsteff/forge-gamesheets/blob/main/app/library/reconciliation.py"
click node_library_data "https://github.com/natsteff/forge-gamesheets/blob/main/app/library/repository.py"
click node_database "https://github.com/natsteff/forge-gamesheets/blob/main/app/database.py"
click node_file_access "https://github.com/natsteff/forge-gamesheets/blob/main/app/library/files.py"
click node_previews "https://github.com/natsteff/forge-gamesheets/blob/main/app/library/previews.py"
click node_designer_web "https://github.com/natsteff/forge-gamesheets/blob/main/app/sheet_designer/web.py"
click node_sheet_model "https://github.com/natsteff/forge-gamesheets/blob/main/app/sheet_designer/model.py"
click node_drafts "https://github.com/natsteff/forge-gamesheets/blob/main/app/sheet_designer/storage.py"
click node_renderer "https://github.com/natsteff/forge-gamesheets/blob/main/packages/fgs-renderer/src/index.mjs"
click node_live_web "https://github.com/natsteff/forge-gamesheets/blob/main/app/livesheet_web.py"
click node_live_sessions "https://github.com/natsteff/forge-gamesheets/blob/main/app/livesheet.py"
click node_links_artwork "https://github.com/natsteff/forge-gamesheets/blob/main/app/library/game_links.py"
click node_bgg "https://github.com/natsteff/forge-gamesheets/blob/main/app/bgg/jobs.py"
click node_reprints "https://github.com/natsteff/forge-gamesheets/blob/main/app/library/reprint_maintenance.py"
click node_portability "https://github.com/natsteff/forge-gamesheets/blob/main/app/library/link_portability.py"
click node_accounts "https://github.com/natsteff/forge-gamesheets/blob/main/app/accounts.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_app,node_web,node_user toneBlue
class node_scan,node_reconcile,node_library_data,node_database,node_file_access,node_previews toneAmber
class node_designer_web,node_sheet_model,node_drafts,node_renderer toneMint
class node_live_web,node_live_sessions toneRose
class node_links_artwork,node_bgg,node_reprints,node_portability,node_accounts,node_external_bgg toneIndigo
```

## Components

### HTTP application

- [Application setup](https://github.com/natsteff/forge-gamesheets/blob/main/app/main.py): `app/main.py`
- [Web interface](https://github.com/natsteff/forge-gamesheets/blob/main/app/web.py): `app/web.py`

### Game library

- [Library scanning](https://github.com/natsteff/forge-gamesheets/blob/main/app/library/scanner.py): `app/library/scanner.py`
- [Scan reconciliation](https://github.com/natsteff/forge-gamesheets/blob/main/app/library/reconciliation.py): `app/library/reconciliation.py`
- [Library queries](https://github.com/natsteff/forge-gamesheets/blob/main/app/library/repository.py): `app/library/repository.py`
- [Application database](https://github.com/natsteff/forge-gamesheets/blob/main/app/database.py): `app/database.py`
- [Resource files](https://github.com/natsteff/forge-gamesheets/blob/main/app/library/files.py): `app/library/files.py`
- [Resource previews](https://github.com/natsteff/forge-gamesheets/blob/main/app/library/previews.py): `app/library/previews.py`

### Sheet creation

- [Designer interface](https://github.com/natsteff/forge-gamesheets/blob/main/app/sheet_designer/web.py): `app/sheet_designer/web.py`
- [FGS document model](https://github.com/natsteff/forge-gamesheets/blob/main/app/sheet_designer/model.py): `app/sheet_designer/model.py`
- [Draft storage](https://github.com/natsteff/forge-gamesheets/blob/main/app/sheet_designer/storage.py): `app/sheet_designer/storage.py`
- [FGS renderer](https://github.com/natsteff/forge-gamesheets/blob/main/packages/fgs-renderer/src/index.mjs): `packages/fgs-renderer/src/index.mjs`

### Live play

- [LiveSheet interface](https://github.com/natsteff/forge-gamesheets/blob/main/app/livesheet_web.py): `app/livesheet_web.py`
- [Live scoring sessions](https://github.com/natsteff/forge-gamesheets/blob/main/app/livesheet.py): `app/livesheet.py`

### Collection management

- [Links and artwork](https://github.com/natsteff/forge-gamesheets/blob/main/app/library/game_links.py): `app/library/game_links.py`
- [BoardGameGeek integration](https://github.com/natsteff/forge-gamesheets/blob/main/app/bgg/jobs.py): `app/bgg/jobs.py`
- [Reprint management](https://github.com/natsteff/forge-gamesheets/blob/main/app/library/reprint_maintenance.py): `app/library/reprint_maintenance.py`
- [Metadata portability](https://github.com/natsteff/forge-gamesheets/blob/main/app/library/link_portability.py): `app/library/link_portability.py`
- [Local accounts](https://github.com/natsteff/forge-gamesheets/blob/main/app/accounts.py): `app/accounts.py`

### Other components

- **User**
- **BoardGameGeek**: external system

## Connections

- User → Application setup: opens app (evidence: `README.md`)
- Application setup → Web interface: registers routes (evidence: `app/main.py`)
- User → Web interface: browses library (evidence: `README.md`)
- Web interface → Library scanning: requests scan (evidence: `app/web.py`)
- Application setup → Library scanning: initializes scanning (evidence: `app/main.py`)
- Application setup → Scan reconciliation: reconciles collection (evidence: `app/main.py`)
- User → Library queries: searches resources (evidence: `README.md`)
- User → Resource previews: previews resources (evidence: `README.md`)
- User → Resource files: downloads originals (evidence: `README.md`)
- User → Designer interface: creates sheets (evidence: `README.md`)
- Designer interface → FGS document model: validates documents (evidence: `app/sheet_designer/web.py`)
- Designer interface → Draft storage: manages drafts (evidence: `app/sheet_designer/web.py`)
- User → FGS renderer: exports print output (evidence: `README.md`)
- User → LiveSheet interface: starts LiveSheet (evidence: `README.md`)
- LiveSheet interface → Live scoring sessions: runs scoring
- User → Links and artwork: manages game details (evidence: `README.md`)
- User → BoardGameGeek integration: associates games (evidence: `README.md`)
- BoardGameGeek integration → BoardGameGeek: queries metadata
- User → Reprint management: maintains Reprints (evidence: `README.md`)
- User → Metadata portability: moves metadata (evidence: `README.md`)
- User → Local accounts: uses local accounts (evidence: `README.md`)
- BoardGameGeek → BoardGameGeek integration: returns metadata
