# petko-todorov/belot-scorer architecture

> Architecture diagram of the GitHub repository petko-todorov/belot-scorer, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-03). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/petko-todorov/belot-scorer
- Repository: https://github.com/petko-todorov/belot-scorer

## Overview

Belot Scorer 2 is a mobile Bridge-Belote score tracker. A player opens or creates a match, enters each team’s round points, and the app updates totals; when a game reaches its end condition, the player confirms completion and the match history records the result. The menu lists, resumes, and deletes saved matches. The graph follows the React route and game-state ownership shown in excerpts; README-described capabilities are included, but no unshown Android-to-web wiring is asserted.

Main entry points: [`src/pages/Game.jsx`](https://github.com/petko-todorov/belot-scorer/blob/main/src/pages/Game.jsx) (Game screen), [`src/routes/index.jsx`](https://github.com/petko-todorov/belot-scorer/blob/main/src/routes/index.jsx) (Route dispatch), [`src/pages/Menu.jsx`](https://github.com/petko-todorov/belot-scorer/blob/main/src/pages/Menu.jsx) (Match menu), [`src/hooks/useGame.js`](https://github.com/petko-todorov/belot-scorer/blob/main/src/hooks/useGame.js) (Game state)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_navigation["App navigation"]
  node_entry["React entry<br/>[main.jsx]"]
  node_app["App shell<br/>[App.jsx]"]
  node_routes["Route dispatch<br/>[index.jsx]"]
  node_home["Home screen<br/>[Home.jsx]"]
  node_menu["Match menu<br/>[Menu.jsx]"]
end

subgraph group_match["Match workflow"]
  node_game["Game screen<br/>[Game.jsx]"]
  node_state["Game state<br/>[useGame.js]"]
  node_scoring["Score validation<br/>[score.js]"]
end

subgraph group_presentation["Score presentation"]
  node_scoreinput["Score entry<br/>[ScoreInput.jsx]"]
  node_keypad["Numeric keypad<br/>[NumericKeypad.jsx]"]
  node_history["Game history<br/>[GameHistory.jsx]"]
  node_winmodal["End confirmation<br/>[ModalWin.jsx]"]
end

subgraph group_persistence["Local persistence"]
  node_storage[("Match storage<br/>[storage.js]")]
end

node_player(("Player"))

node_player -.->|"opens app"| node_entry
node_entry -->|"renders"| node_app
node_app -->|"renders routes"| node_routes
node_routes -->|"routes to"| node_home
node_routes -->|"routes to"| node_menu
node_routes -->|"routes to"| node_game
node_menu -->|"loads and deletes"| node_storage
node_menu -->|"opens match"| node_game
node_game -->|"uses state"| node_state
node_game -->|"renders entry"| node_scoreinput
node_game -->|"renders history"| node_history
node_game -->|"renders confirmation"| node_winmodal
node_scoreinput -->|"clamps input"| node_scoring
node_state -->|"clamps submitted score"| node_scoring
node_state -->|"loads and saves match"| node_storage

click node_entry "https://github.com/petko-todorov/belot-scorer/blob/main/src/main.jsx"
click node_app "https://github.com/petko-todorov/belot-scorer/blob/main/src/App.jsx"
click node_routes "https://github.com/petko-todorov/belot-scorer/blob/main/src/routes/index.jsx"
click node_home "https://github.com/petko-todorov/belot-scorer/blob/main/src/pages/Home.jsx"
click node_menu "https://github.com/petko-todorov/belot-scorer/blob/main/src/pages/Menu.jsx"
click node_game "https://github.com/petko-todorov/belot-scorer/blob/main/src/pages/Game.jsx"
click node_state "https://github.com/petko-todorov/belot-scorer/blob/main/src/hooks/useGame.js"
click node_scoring "https://github.com/petko-todorov/belot-scorer/blob/main/src/utils/score.js"
click node_scoreinput "https://github.com/petko-todorov/belot-scorer/blob/main/src/components/ScoreInput.jsx"
click node_keypad "https://github.com/petko-todorov/belot-scorer/blob/main/src/components/NumericKeypad.jsx"
click node_history "https://github.com/petko-todorov/belot-scorer/blob/main/src/components/GameHistory.jsx"
click node_winmodal "https://github.com/petko-todorov/belot-scorer/blob/main/src/components/ModalWin.jsx"
click node_storage "https://github.com/petko-todorov/belot-scorer/blob/main/src/utils/storage.js"

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_app,node_routes,node_home,node_menu toneBlue
class node_game,node_state,node_scoring toneAmber
class node_scoreinput,node_keypad,node_history,node_winmodal toneMint
class node_storage toneRose
class node_player toneIndigo
```

## Components

### App navigation

- [React entry](https://github.com/petko-todorov/belot-scorer/blob/main/src/main.jsx): `src/main.jsx`
- [App shell](https://github.com/petko-todorov/belot-scorer/blob/main/src/App.jsx): `src/App.jsx`
- [Route dispatch](https://github.com/petko-todorov/belot-scorer/blob/main/src/routes/index.jsx): `src/routes/index.jsx`
- [Home screen](https://github.com/petko-todorov/belot-scorer/blob/main/src/pages/Home.jsx): `src/pages/Home.jsx`
- [Match menu](https://github.com/petko-todorov/belot-scorer/blob/main/src/pages/Menu.jsx): `src/pages/Menu.jsx`

### Match workflow

- [Game screen](https://github.com/petko-todorov/belot-scorer/blob/main/src/pages/Game.jsx): `src/pages/Game.jsx`
- [Game state](https://github.com/petko-todorov/belot-scorer/blob/main/src/hooks/useGame.js): `src/hooks/useGame.js`
- [Score validation](https://github.com/petko-todorov/belot-scorer/blob/main/src/utils/score.js): `src/utils/score.js`

### Score presentation

- [Score entry](https://github.com/petko-todorov/belot-scorer/blob/main/src/components/ScoreInput.jsx): `src/components/ScoreInput.jsx`
- [Numeric keypad](https://github.com/petko-todorov/belot-scorer/blob/main/src/components/NumericKeypad.jsx): `src/components/NumericKeypad.jsx`
- [Game history](https://github.com/petko-todorov/belot-scorer/blob/main/src/components/GameHistory.jsx): `src/components/GameHistory.jsx`
- [End confirmation](https://github.com/petko-todorov/belot-scorer/blob/main/src/components/ModalWin.jsx): `src/components/ModalWin.jsx`

### Local persistence

- [Match storage](https://github.com/petko-todorov/belot-scorer/blob/main/src/utils/storage.js): `src/utils/storage.js`

### Other components

- **Player**

## Connections

- Player → React entry: opens app
- React entry → App shell: renders (evidence: `src/main.jsx`)
- App shell → Route dispatch: renders routes (evidence: `src/App.jsx`)
- Route dispatch → Home screen: routes to (evidence: `src/routes/index.jsx`)
- Route dispatch → Match menu: routes to (evidence: `src/routes/index.jsx`)
- Route dispatch → Game screen: routes to (evidence: `src/routes/index.jsx`)
- Match menu → Match storage: loads and deletes (evidence: `src/pages/Menu.jsx`)
- Match menu → Game screen: opens match (evidence: `src/pages/Menu.jsx`)
- Game screen → Game state: uses state (evidence: `src/pages/Game.jsx`)
- Game screen → Score entry: renders entry (evidence: `src/pages/Game.jsx`)
- Game screen → Game history: renders history (evidence: `src/pages/Game.jsx`)
- Game screen → End confirmation: renders confirmation (evidence: `src/pages/Game.jsx`)
- Score entry → Score validation: clamps input (evidence: `src/components/ScoreInput.jsx`)
- Game state → Score validation: clamps submitted score (evidence: `src/hooks/useGame.js`)
- Game state → Match storage: loads and saves match (evidence: `src/hooks/useGame.js`)
