# alimfeld/tournicano architecture

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

- Interactive diagram: https://gitdiagram.com/alimfeld/tournicano
- Repository: https://github.com/alimfeld/tournicano

## Overview

Tournicano is a browser app for organizing doubles tournaments across formats such as Americano and Mexicano. A user manages players and groups, configures matching, creates rounds, records scores, and reviews standings; tournament state and settings persist locally. The graph includes the matching and tournament domain layers and the documented app pages. Evidence is limited to the README, source index, and excerpts provided; unsampled relationships are omitted where the caller is unclear.

Main entry points: [`src/model/tournament/Tournament.impl.ts`](https://github.com/alimfeld/tournicano/blob/main/src/model/tournament/Tournament.impl.ts) (Tournament model), [`src/model/matching/Matching.ts`](https://github.com/alimfeld/tournicano/blob/main/src/model/matching/Matching.ts) (Matching orchestration), [`src/App.ts`](https://github.com/alimfeld/tournicano/blob/main/src/App.ts) (App state), [`src/views/PlayersPage.ts`](https://github.com/alimfeld/tournicano/blob/main/src/views/PlayersPage.ts) (Players page)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App shell"]
  node_app["App state<br/>[App.ts]"]
  node_layout["Layout and navigation<br/>[Layout.ts]"]
  node_avatar["Avatar cache<br/>[AvatarCache.ts]"]
  node_header["Page header<br/>[Header.ts]"]
  node_help["Help card<br/>[HelpCard.ts]"]
  node_modal["Modal component<br/>[Modal.ts]"]
  node_groupsymbol["Group symbol<br/>[GroupSymbol.ts]"]
end

subgraph group_pages["Tournament UI"]
  node_players["Players page<br/>[PlayersPage.ts]"]
  node_rounds["Round page<br/>[RoundPage.ts]"]
  node_standings["Standings page<br/>[StandingsPage.ts]"]
  node_settings["Settings page<br/>[SettingsPage.ts]"]
end

subgraph group_domain["Tournament domain"]
  node_tournament["Tournament model<br/>[Tournament.impl.ts]"]
  node_players_model["Player state<br/>[Players.impl.ts]"]
  node_round_model["Round and scores<br/>[Rounds.impl.ts]"]
  node_context["Domain context<br/>[Context.ts]"]
  node_import["Tournament import<br/>[Import.ts]"]
  node_export["Tournament export<br/>[Export.ts]"]
  node_serialization["Tournament serialization<br/>[Serialization.ts]"]
  node_contracts["Tournament contracts<br/>[Tournament.ts]"]
  node_settings_model["Settings model<br/>[Settings.impl.ts]"]
  node_settings_contract["Settings contract<br/>[Settings.ts]"]
  node_mutable["Mutable state support<br/>[Mutable.ts]"]
end

subgraph group_matching["Matching engine"]
  node_matching["Matching orchestration<br/>[Matching.ts]"]
  node_spec["Format specifications<br/>[MatchingSpec.ts]"]
  node_partition["Player partitioning<br/>[Partitioning.ts]"]
  node_weights["Matching weights<br/>[WeightFunctions.ts]"]
  node_maximum["Maximum matching<br/>[MaximumMatching.ts]"]
end

node_user(("Tournament organizer"))
node_local[("Browser storage")]

node_user -->|"uses"| node_layout
node_layout -->|"creates"| node_app
node_app -->|"creates"| node_tournament
node_app -->|"creates"| node_settings_model
node_app -->|"loads and saves"| node_local
node_layout -->|"renders"| node_modal
node_players -->|"uses"| node_tournament
node_rounds -->|"uses"| node_tournament
node_standings -->|"uses"| node_tournament
node_settings -->|"uses"| node_settings_model
node_settings -->|"configures"| node_spec
node_tournament -->|"partitions players"| node_partition
node_tournament -->|"uses"| node_players_model
node_tournament -->|"uses"| node_round_model
node_tournament -->|"serializes"| node_serialization
node_tournament -->|"imports data"| node_import
node_tournament -->|"exports data"| node_export
node_players_model -->|"uses"| node_context
node_round_model -->|"uses"| node_context
node_settings_model -->|"implements"| node_settings_contract
node_settings_model -->|"uses"| node_mutable
node_matching -->|"uses"| node_spec
node_matching -->|"uses"| node_partition
node_matching -->|"uses"| node_weights
node_matching -->|"uses"| node_maximum
node_partition -->|"uses types"| node_matching
node_partition -->|"uses"| node_spec
node_weights -->|"uses types"| node_matching
node_weights -->|"uses"| node_spec
node_app -->|"sets avatar spec"| node_avatar
node_players -->|"renders"| node_header
node_rounds -->|"renders"| node_header
node_standings -->|"renders"| node_header
node_settings -->|"renders"| node_header
node_players -->|"renders"| node_groupsymbol
node_standings -->|"renders"| node_groupsymbol
node_rounds -->|"renders"| node_help
node_players -->|"renders"| node_help
node_standings -->|"renders"| node_help

click node_app "https://github.com/alimfeld/tournicano/blob/main/src/App.ts"
click node_layout "https://github.com/alimfeld/tournicano/blob/main/src/Layout.ts"
click node_players "https://github.com/alimfeld/tournicano/blob/main/src/views/PlayersPage.ts"
click node_rounds "https://github.com/alimfeld/tournicano/blob/main/src/views/RoundPage.ts"
click node_standings "https://github.com/alimfeld/tournicano/blob/main/src/views/StandingsPage.ts"
click node_settings "https://github.com/alimfeld/tournicano/blob/main/src/views/SettingsPage.ts"
click node_tournament "https://github.com/alimfeld/tournicano/blob/main/src/model/tournament/Tournament.impl.ts"
click node_players_model "https://github.com/alimfeld/tournicano/blob/main/src/model/tournament/Players.impl.ts"
click node_round_model "https://github.com/alimfeld/tournicano/blob/main/src/model/tournament/Rounds.impl.ts"
click node_context "https://github.com/alimfeld/tournicano/blob/main/src/model/tournament/Context.ts"
click node_import "https://github.com/alimfeld/tournicano/blob/main/src/model/tournament/Import.ts"
click node_export "https://github.com/alimfeld/tournicano/blob/main/src/model/tournament/Export.ts"
click node_serialization "https://github.com/alimfeld/tournicano/blob/main/src/model/tournament/Serialization.ts"
click node_contracts "https://github.com/alimfeld/tournicano/blob/main/src/model/tournament/Tournament.ts"
click node_settings_model "https://github.com/alimfeld/tournicano/blob/main/src/model/settings/Settings.impl.ts"
click node_settings_contract "https://github.com/alimfeld/tournicano/blob/main/src/model/settings/Settings.ts"
click node_mutable "https://github.com/alimfeld/tournicano/blob/main/src/model/core/Mutable.ts"
click node_matching "https://github.com/alimfeld/tournicano/blob/main/src/model/matching/Matching.ts"
click node_spec "https://github.com/alimfeld/tournicano/blob/main/src/model/matching/MatchingSpec.ts"
click node_partition "https://github.com/alimfeld/tournicano/blob/main/src/model/matching/Partitioning.ts"
click node_weights "https://github.com/alimfeld/tournicano/blob/main/src/model/matching/WeightFunctions.ts"
click node_maximum "https://github.com/alimfeld/tournicano/blob/main/src/model/matching/MaximumMatching.ts"
click node_avatar "https://github.com/alimfeld/tournicano/blob/main/src/views/AvatarCache.ts"
click node_header "https://github.com/alimfeld/tournicano/blob/main/src/views/Header.ts"
click node_help "https://github.com/alimfeld/tournicano/blob/main/src/views/HelpCard.ts"
click node_modal "https://github.com/alimfeld/tournicano/blob/main/src/views/Modal.ts"
click node_groupsymbol "https://github.com/alimfeld/tournicano/blob/main/src/views/GroupSymbol.ts"

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_layout,node_avatar,node_header,node_help,node_modal,node_groupsymbol toneBlue
class node_players,node_rounds,node_standings,node_settings,node_local toneAmber
class node_tournament,node_players_model,node_round_model,node_context,node_import,node_export,node_serialization,node_contracts,node_settings_model,node_settings_contract,node_mutable toneMint
class node_matching,node_spec,node_partition,node_weights,node_maximum toneRose
class node_user toneIndigo
```

## Components

### App shell

- [App state](https://github.com/alimfeld/tournicano/blob/main/src/App.ts): `src/App.ts`
- [Layout and navigation](https://github.com/alimfeld/tournicano/blob/main/src/Layout.ts): `src/Layout.ts`
- [Avatar cache](https://github.com/alimfeld/tournicano/blob/main/src/views/AvatarCache.ts): `src/views/AvatarCache.ts`
- [Page header](https://github.com/alimfeld/tournicano/blob/main/src/views/Header.ts): `src/views/Header.ts`
- [Help card](https://github.com/alimfeld/tournicano/blob/main/src/views/HelpCard.ts): `src/views/HelpCard.ts`
- [Modal component](https://github.com/alimfeld/tournicano/blob/main/src/views/Modal.ts): `src/views/Modal.ts`
- [Group symbol](https://github.com/alimfeld/tournicano/blob/main/src/views/GroupSymbol.ts): `src/views/GroupSymbol.ts`

### Tournament UI

- [Players page](https://github.com/alimfeld/tournicano/blob/main/src/views/PlayersPage.ts): `src/views/PlayersPage.ts`
- [Round page](https://github.com/alimfeld/tournicano/blob/main/src/views/RoundPage.ts): `src/views/RoundPage.ts`
- [Standings page](https://github.com/alimfeld/tournicano/blob/main/src/views/StandingsPage.ts): `src/views/StandingsPage.ts`
- [Settings page](https://github.com/alimfeld/tournicano/blob/main/src/views/SettingsPage.ts): `src/views/SettingsPage.ts`

### Tournament domain

- [Tournament model](https://github.com/alimfeld/tournicano/blob/main/src/model/tournament/Tournament.impl.ts): `src/model/tournament/Tournament.impl.ts`
- [Player state](https://github.com/alimfeld/tournicano/blob/main/src/model/tournament/Players.impl.ts): `src/model/tournament/Players.impl.ts`
- [Round and scores](https://github.com/alimfeld/tournicano/blob/main/src/model/tournament/Rounds.impl.ts): `src/model/tournament/Rounds.impl.ts`
- [Domain context](https://github.com/alimfeld/tournicano/blob/main/src/model/tournament/Context.ts): `src/model/tournament/Context.ts`
- [Tournament import](https://github.com/alimfeld/tournicano/blob/main/src/model/tournament/Import.ts): `src/model/tournament/Import.ts`
- [Tournament export](https://github.com/alimfeld/tournicano/blob/main/src/model/tournament/Export.ts): `src/model/tournament/Export.ts`
- [Tournament serialization](https://github.com/alimfeld/tournicano/blob/main/src/model/tournament/Serialization.ts): `src/model/tournament/Serialization.ts`
- [Tournament contracts](https://github.com/alimfeld/tournicano/blob/main/src/model/tournament/Tournament.ts): `src/model/tournament/Tournament.ts`
- [Settings model](https://github.com/alimfeld/tournicano/blob/main/src/model/settings/Settings.impl.ts): `src/model/settings/Settings.impl.ts`
- [Settings contract](https://github.com/alimfeld/tournicano/blob/main/src/model/settings/Settings.ts): `src/model/settings/Settings.ts`
- [Mutable state support](https://github.com/alimfeld/tournicano/blob/main/src/model/core/Mutable.ts): `src/model/core/Mutable.ts`

### Matching engine

- [Matching orchestration](https://github.com/alimfeld/tournicano/blob/main/src/model/matching/Matching.ts): `src/model/matching/Matching.ts`
- [Format specifications](https://github.com/alimfeld/tournicano/blob/main/src/model/matching/MatchingSpec.ts): `src/model/matching/MatchingSpec.ts`
- [Player partitioning](https://github.com/alimfeld/tournicano/blob/main/src/model/matching/Partitioning.ts): `src/model/matching/Partitioning.ts`
- [Matching weights](https://github.com/alimfeld/tournicano/blob/main/src/model/matching/WeightFunctions.ts): `src/model/matching/WeightFunctions.ts`
- [Maximum matching](https://github.com/alimfeld/tournicano/blob/main/src/model/matching/MaximumMatching.ts): `src/model/matching/MaximumMatching.ts`

### Other components

- **Tournament organizer**
- **Browser storage**

## Connections

- Tournament organizer → Layout and navigation: uses
- Layout and navigation → App state: creates (evidence: `src/Layout.ts`)
- App state → Tournament model: creates (evidence: `src/App.ts`)
- App state → Settings model: creates (evidence: `src/App.ts`)
- App state → Browser storage: loads and saves (evidence: `src/App.ts`)
- Layout and navigation → Modal component: renders (evidence: `src/Layout.ts`)
- Players page → Tournament model: uses (evidence: `src/views/PlayersPage.ts`)
- Round page → Tournament model: uses (evidence: `src/views/RoundPage.ts`)
- Standings page → Tournament model: uses (evidence: `src/views/StandingsPage.ts`)
- Settings page → Settings model: uses (evidence: `src/views/SettingsPage.ts`)
- Settings page → Format specifications: configures (evidence: `src/views/SettingsPage.ts`)
- Tournament model → Player partitioning: partitions players (evidence: `src/model/tournament/Tournament.impl.ts`)
- Tournament model → Player state: uses (evidence: `src/model/tournament/Tournament.impl.ts`)
- Tournament model → Round and scores: uses (evidence: `src/model/tournament/Tournament.impl.ts`)
- Tournament model → Tournament serialization: serializes (evidence: `src/model/tournament/Tournament.impl.ts`)
- Tournament model → Tournament import: imports data (evidence: `src/model/tournament/Tournament.impl.ts`)
- Tournament model → Tournament export: exports data (evidence: `src/model/tournament/Tournament.impl.ts`)
- Player state → Domain context: uses (evidence: `src/model/tournament/Players.impl.ts`)
- Round and scores → Domain context: uses (evidence: `src/model/tournament/Rounds.impl.ts`)
- Settings model → Settings contract: implements (evidence: `src/model/settings/Settings.impl.ts`)
- Settings model → Mutable state support: uses (evidence: `src/model/settings/Settings.impl.ts`)
- Matching orchestration → Format specifications: uses (evidence: `src/model/matching/Matching.ts`)
- Matching orchestration → Player partitioning: uses (evidence: `src/model/matching/Matching.ts`)
- Matching orchestration → Matching weights: uses (evidence: `src/model/matching/Matching.ts`)
- Matching orchestration → Maximum matching: uses (evidence: `src/model/matching/Matching.ts`)
- Player partitioning → Matching orchestration: uses types (evidence: `src/model/matching/Partitioning.ts`)
- Player partitioning → Format specifications: uses (evidence: `src/model/matching/Partitioning.ts`)
- Matching weights → Matching orchestration: uses types (evidence: `src/model/matching/WeightFunctions.ts`)
- Matching weights → Format specifications: uses (evidence: `src/model/matching/WeightFunctions.ts`)
- App state → Avatar cache: sets avatar spec (evidence: `src/App.ts`)
- Players page → Page header: renders (evidence: `src/views/PlayersPage.ts`)
- Round page → Page header: renders (evidence: `src/views/RoundPage.ts`)
- Standings page → Page header: renders (evidence: `src/views/StandingsPage.ts`)
- Settings page → Page header: renders (evidence: `src/views/SettingsPage.ts`)
- Players page → Group symbol: renders (evidence: `src/views/PlayersPage.ts`)
- Standings page → Group symbol: renders (evidence: `src/views/StandingsPage.ts`)
- Round page → Help card: renders (evidence: `src/views/RoundPage.ts`)
- Players page → Help card: renders (evidence: `src/views/PlayersPage.ts`)
- Standings page → Help card: renders (evidence: `src/views/StandingsPage.ts`)
