# dinael/swdscorepad architecture

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

## Overview

7 Wonders Duel Scorepad is a browser score calculator. Players enter category scores for each player, optionally enable Agora or Pantheon, then calculate a winner or record a military, progress, or political victory; they can reset and replay. The app also provides player tabs, translated UI, and a splash route. The graph follows the sampled entry point and score flow. Some listed views and components were not sampled, so their internal behavior and wiring are omitted.

Main entry points: [`src/view/scorepad/Scorepad.tsx`](https://github.com/dinael/swdscorepad/blob/main/src/view/scorepad/Scorepad.tsx) (Scorepad view), [`src/App.tsx`](https://github.com/dinael/swdscorepad/blob/main/src/App.tsx) (App shell), [`src/router/Router.tsx`](https://github.com/dinael/swdscorepad/blob/main/src/router/Router.tsx) (Route dispatch), [`src/main.tsx`](https://github.com/dinael/swdscorepad/blob/main/src/main.tsx) (React entry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application shell"]
  node_main["React entry<br/>[main.tsx]"]
  node_app_root["App shell<br/>[App.tsx]"]
  node_router["Route dispatch<br/>[Router.tsx]"]
  node_footer["Footer<br/>[SWDfooter.tsx]"]
end

subgraph group_score["Scoring workflow"]
  node_score_view["Scorepad view<br/>[Scorepad.tsx]"]
  node_tabs["Player tabs<br/>[SWDtabs.tsx]"]
  node_player_pad["Player scorepad<br/>[SWDscorepad.tsx]"]
  node_score_inputs["Score categories<br/>[inputValues.tsx]"]
  node_victories["Victory actions<br/>[SWDvictories.tsx]"]
end

subgraph group_settings["Settings and language"]
  node_game_context["Game context<br/>[GameContext.tsx]"]
  node_header["Header settings<br/>[SWDheader.tsx]"]
end

subgraph group_content["Views and translations"]
  node_i18n["Translation setup<br/>[i18n.ts]"]
  node_locales["Locale messages<br/>[en.json]"]
  node_splash["Splash view<br/>[Splash.tsx]"]
  node_error_view["Error view<br/>[ErrorPage.tsx]"]
end

node_browser(("Player"))

node_browser -->|"opens app"| node_main
node_main -->|"renders"| node_app_root
node_main -->|"loads translations"| node_i18n
node_app_root -->|"provides state"| node_game_context
node_app_root -->|"renders"| node_header
node_app_root -->|"renders"| node_router
node_app_root -->|"renders"| node_footer
node_header -->|"toggles expansions"| node_game_context
node_header -->|"changes language"| node_i18n
node_i18n -->|"loads messages"| node_locales
node_router -->|"routes scorepad"| node_score_view
node_router -->|"routes splash"| node_splash
node_router -->|"routes fallback"| node_error_view
node_score_view -->|"reads expansions"| node_game_context
node_score_view -->|"renders players"| node_tabs
node_score_view -->|"renders score entry"| node_player_pad
node_score_view -->|"dispatches victory actions"| node_victories
node_score_inputs -->|"supplies categories"| node_player_pad
node_player_pad -->|"reports totals"| node_score_view
node_tabs -->|"reports active player"| node_score_view

click node_main "https://github.com/dinael/swdscorepad/blob/main/src/main.tsx"
click node_app_root "https://github.com/dinael/swdscorepad/blob/main/src/App.tsx"
click node_router "https://github.com/dinael/swdscorepad/blob/main/src/router/Router.tsx"
click node_game_context "https://github.com/dinael/swdscorepad/blob/main/src/context/GameContext.tsx"
click node_header "https://github.com/dinael/swdscorepad/blob/main/src/components/SWDheader/SWDheader.tsx"
click node_i18n "https://github.com/dinael/swdscorepad/blob/main/src/i18n.ts"
click node_locales "https://github.com/dinael/swdscorepad/blob/main/src/locales/en.json"
click node_score_view "https://github.com/dinael/swdscorepad/blob/main/src/view/scorepad/Scorepad.tsx"
click node_tabs "https://github.com/dinael/swdscorepad/blob/main/src/components/SWDtabs/SWDtabs.tsx"
click node_player_pad "https://github.com/dinael/swdscorepad/blob/main/src/components/SWDscorepad/SWDscorepad.tsx"
click node_score_inputs "https://github.com/dinael/swdscorepad/blob/main/src/data/inputValues.tsx"
click node_victories "https://github.com/dinael/swdscorepad/blob/main/src/components/SWDvictories/SWDvictories.tsx"
click node_splash "https://github.com/dinael/swdscorepad/blob/main/src/view/splash/Splash.tsx"
click node_error_view "https://github.com/dinael/swdscorepad/blob/main/src/view/ErrorPage.tsx"
click node_footer "https://github.com/dinael/swdscorepad/blob/main/src/components/SWDfooter/SWDfooter.tsx"

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_main,node_app_root,node_router,node_footer toneBlue
class node_score_view,node_tabs,node_player_pad,node_score_inputs,node_victories toneAmber
class node_game_context,node_header toneMint
class node_i18n,node_locales,node_splash,node_error_view toneRose
class node_browser toneIndigo
```

## Components

### Application shell

- [React entry](https://github.com/dinael/swdscorepad/blob/main/src/main.tsx): `src/main.tsx`
- [App shell](https://github.com/dinael/swdscorepad/blob/main/src/App.tsx): `src/App.tsx`
- [Route dispatch](https://github.com/dinael/swdscorepad/blob/main/src/router/Router.tsx): `src/router/Router.tsx`
- [Footer](https://github.com/dinael/swdscorepad/blob/main/src/components/SWDfooter/SWDfooter.tsx): `src/components/SWDfooter/SWDfooter.tsx`

### Scoring workflow

- [Scorepad view](https://github.com/dinael/swdscorepad/blob/main/src/view/scorepad/Scorepad.tsx): `src/view/scorepad/Scorepad.tsx`
- [Player tabs](https://github.com/dinael/swdscorepad/blob/main/src/components/SWDtabs/SWDtabs.tsx): `src/components/SWDtabs/SWDtabs.tsx`
- [Player scorepad](https://github.com/dinael/swdscorepad/blob/main/src/components/SWDscorepad/SWDscorepad.tsx): `src/components/SWDscorepad/SWDscorepad.tsx`
- [Score categories](https://github.com/dinael/swdscorepad/blob/main/src/data/inputValues.tsx): `src/data/inputValues.tsx`
- [Victory actions](https://github.com/dinael/swdscorepad/blob/main/src/components/SWDvictories/SWDvictories.tsx): `src/components/SWDvictories/SWDvictories.tsx`

### Settings and language

- [Game context](https://github.com/dinael/swdscorepad/blob/main/src/context/GameContext.tsx): `src/context/GameContext.tsx`
- [Header settings](https://github.com/dinael/swdscorepad/blob/main/src/components/SWDheader/SWDheader.tsx): `src/components/SWDheader/SWDheader.tsx`

### Views and translations

- [Translation setup](https://github.com/dinael/swdscorepad/blob/main/src/i18n.ts): `src/i18n.ts`
- [Locale messages](https://github.com/dinael/swdscorepad/blob/main/src/locales/en.json): `src/locales/en.json`
- [Splash view](https://github.com/dinael/swdscorepad/blob/main/src/view/splash/Splash.tsx): `src/view/splash/Splash.tsx`
- [Error view](https://github.com/dinael/swdscorepad/blob/main/src/view/ErrorPage.tsx): `src/view/ErrorPage.tsx`

### Other components

- **Player**

## Connections

- Player → React entry: opens app
- React entry → App shell: renders
- React entry → Translation setup: loads translations
- App shell → Game context: provides state
- App shell → Header settings: renders
- App shell → Route dispatch: renders
- App shell → Footer: renders
- Header settings → Game context: toggles expansions
- Header settings → Translation setup: changes language
- Translation setup → Locale messages: loads messages
- Route dispatch → Scorepad view: routes scorepad
- Route dispatch → Splash view: routes splash
- Route dispatch → Error view: routes fallback
- Scorepad view → Game context: reads expansions
- Scorepad view → Player tabs: renders players
- Scorepad view → Player scorepad: renders score entry
- Scorepad view → Victory actions: dispatches victory actions
- Score categories → Player scorepad: supplies categories
- Player scorepad → Scorepad view: reports totals
- Player tabs → Scorepad view: reports active player
