# rohit12-web/tempo-chess architecture

> Architecture diagram of the GitHub repository rohit12-web/tempo-chess, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/rohit12-web/tempo-chess
- Repository: https://github.com/rohit12-web/tempo-chess

## Overview

Tempo is a browser-only chess and learning app. A player creates or selects a local profile, chooses local play, bot play, puzzles or opening study, then reviews results and progress from Home or Replay. The core rules engine supports game and study-board behavior; puzzle, lesson and opening content supplies learning material, while profile helpers retain progress in browser storage. The README documents the page-level workflow, but page source files are not present in the supplied tree, so those interfaces are represented at the existing `js` directory level.

Main entry points: [`js`](https://github.com/rohit12-web/tempo-chess/tree/main/js) (App pages), [`js/core/engine.js`](https://github.com/rohit12-web/tempo-chess/blob/main/js/core/engine.js) (Chess rules), [`js/core/bot.js`](https://github.com/rohit12-web/tempo-chess/blob/main/js/core/bot.js) (Chess bot), [`js/helpers/profile.js`](https://github.com/rohit12-web/tempo-chess/blob/main/js/helpers/profile.js) (Local profiles)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Player experience"]
  node_pages["App pages"]
  node_preview["Preview board<br/>[preview-board.js]"]
end

subgraph group_chess["Chess runtime"]
  node_engine["Chess rules<br/>[engine.js]"]
  node_bot["Chess bot<br/>[bot.js]"]
  node_worker["Bot worker<br/>[bot-worker.js]"]
  node_studyboard["Study board<br/>[study-board.js]"]
end

subgraph group_learning["Learning content"]
  node_puzzles["Puzzle collection<br/>[puzzle-data.js]"]
  node_lessons["Rules lessons<br/>[lesson-data.js]"]
  node_openings["Opening lines<br/>[opening-data.js]"]
  node_practice["Practice tracking<br/>[practice-data.js]"]
  node_notebook["Notebook data<br/>[notebook-data.js]"]
  node_notebookui["Notebook dialog<br/>[notebook-dialog.js]"]
end

subgraph group_support["Shared services"]
  node_profile["Local profiles<br/>[profile.js]"]
  node_storage[("Browser storage")]
  node_gamedata["Game records<br/>[game-data.js]"]
  node_menus["Select menus<br/>[select-menu.js]"]
  node_preferences["Preferences<br/>[preferences.js]"]
  node_theme["Themes<br/>[theme.js]"]
  node_sound["Move sound<br/>[sound.js]"]
end

node_player(("Player"))

node_player -->|"uses"| node_pages
node_pages -->|"selects profile"| node_profile
node_profile -->|"reads and writes"| node_storage
node_pages -->|"plays chess"| node_engine
node_pages -->|"requests moves"| node_bot
node_worker -->|"searches with"| node_bot
node_worker -->|"loads rules"| node_engine
node_bot -->|"evaluates positions"| node_engine
node_studyboard -->|"uses game state"| node_engine
node_pages -->|"shows study and replay"| node_studyboard
node_pages -->|"offers puzzles"| node_puzzles
node_pages -.->|"teaches rules"| node_lessons
node_pages -->|"teaches openings"| node_openings
node_pages -.->|"saves game results"| node_gamedata
node_practice -->|"updates progress"| node_profile
node_pages -.->|"tracks puzzle attempts"| node_practice
node_pages -.->|"opens notebook"| node_notebookui
node_notebookui -.->|"uses notebook data"| node_notebook
node_pages -.->|"enhances controls"| node_menus
node_pages -.->|"configures experience"| node_preferences
node_pages -.->|"switches theme"| node_theme
node_pages -->|"plays move sound"| node_sound
node_pages -.->|"renders previews"| node_preview

click node_pages "https://github.com/rohit12-web/tempo-chess/tree/main/js"
click node_profile "https://github.com/rohit12-web/tempo-chess/blob/main/js/helpers/profile.js"
click node_engine "https://github.com/rohit12-web/tempo-chess/blob/main/js/core/engine.js"
click node_bot "https://github.com/rohit12-web/tempo-chess/blob/main/js/core/bot.js"
click node_worker "https://github.com/rohit12-web/tempo-chess/blob/main/js/core/bot-worker.js"
click node_studyboard "https://github.com/rohit12-web/tempo-chess/blob/main/js/helpers/study-board.js"
click node_gamedata "https://github.com/rohit12-web/tempo-chess/blob/main/js/helpers/game-data.js"
click node_puzzles "https://github.com/rohit12-web/tempo-chess/blob/main/js/data/puzzle-data.js"
click node_lessons "https://github.com/rohit12-web/tempo-chess/blob/main/js/data/lesson-data.js"
click node_openings "https://github.com/rohit12-web/tempo-chess/blob/main/js/data/opening-data.js"
click node_practice "https://github.com/rohit12-web/tempo-chess/blob/main/js/helpers/practice-data.js"
click node_notebook "https://github.com/rohit12-web/tempo-chess/blob/main/js/helpers/notebook-data.js"
click node_notebookui "https://github.com/rohit12-web/tempo-chess/blob/main/js/helpers/notebook-dialog.js"
click node_menus "https://github.com/rohit12-web/tempo-chess/blob/main/js/helpers/select-menu.js"
click node_preferences "https://github.com/rohit12-web/tempo-chess/blob/main/js/helpers/preferences.js"
click node_theme "https://github.com/rohit12-web/tempo-chess/blob/main/js/helpers/theme.js"
click node_sound "https://github.com/rohit12-web/tempo-chess/blob/main/js/helpers/sound.js"
click node_preview "https://github.com/rohit12-web/tempo-chess/blob/main/js/helpers/preview-board.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_pages,node_preview toneBlue
class node_engine,node_bot,node_worker,node_studyboard toneAmber
class node_puzzles,node_lessons,node_openings,node_practice,node_notebook,node_notebookui toneMint
class node_profile,node_storage,node_gamedata,node_menus,node_preferences,node_theme,node_sound toneRose
class node_player toneIndigo
```

## Components

### Player experience

- [App pages](https://github.com/rohit12-web/tempo-chess/tree/main/js): `js`
- [Preview board](https://github.com/rohit12-web/tempo-chess/blob/main/js/helpers/preview-board.js): `js/helpers/preview-board.js`

### Chess runtime

- [Chess rules](https://github.com/rohit12-web/tempo-chess/blob/main/js/core/engine.js): `js/core/engine.js`
- [Chess bot](https://github.com/rohit12-web/tempo-chess/blob/main/js/core/bot.js): `js/core/bot.js`
- [Bot worker](https://github.com/rohit12-web/tempo-chess/blob/main/js/core/bot-worker.js): `js/core/bot-worker.js`
- [Study board](https://github.com/rohit12-web/tempo-chess/blob/main/js/helpers/study-board.js): `js/helpers/study-board.js`

### Learning content

- [Puzzle collection](https://github.com/rohit12-web/tempo-chess/blob/main/js/data/puzzle-data.js): `js/data/puzzle-data.js`
- [Rules lessons](https://github.com/rohit12-web/tempo-chess/blob/main/js/data/lesson-data.js): `js/data/lesson-data.js`
- [Opening lines](https://github.com/rohit12-web/tempo-chess/blob/main/js/data/opening-data.js): `js/data/opening-data.js`
- [Practice tracking](https://github.com/rohit12-web/tempo-chess/blob/main/js/helpers/practice-data.js): `js/helpers/practice-data.js`
- [Notebook data](https://github.com/rohit12-web/tempo-chess/blob/main/js/helpers/notebook-data.js): `js/helpers/notebook-data.js`
- [Notebook dialog](https://github.com/rohit12-web/tempo-chess/blob/main/js/helpers/notebook-dialog.js): `js/helpers/notebook-dialog.js`

### Shared services

- [Local profiles](https://github.com/rohit12-web/tempo-chess/blob/main/js/helpers/profile.js): `js/helpers/profile.js`
- **Browser storage**
- [Game records](https://github.com/rohit12-web/tempo-chess/blob/main/js/helpers/game-data.js): `js/helpers/game-data.js`
- [Select menus](https://github.com/rohit12-web/tempo-chess/blob/main/js/helpers/select-menu.js): `js/helpers/select-menu.js`
- [Preferences](https://github.com/rohit12-web/tempo-chess/blob/main/js/helpers/preferences.js): `js/helpers/preferences.js`
- [Themes](https://github.com/rohit12-web/tempo-chess/blob/main/js/helpers/theme.js): `js/helpers/theme.js`
- [Move sound](https://github.com/rohit12-web/tempo-chess/blob/main/js/helpers/sound.js): `js/helpers/sound.js`

### Other components

- **Player**

## Connections

- Player → App pages: uses (evidence: `README.md`)
- App pages → Local profiles: selects profile (evidence: `README.md`)
- Local profiles → Browser storage: reads and writes (evidence: `js/helpers/profile.js`)
- App pages → Chess rules: plays chess (evidence: `README.md`)
- App pages → Chess bot: requests moves (evidence: `README.md`)
- Bot worker → Chess bot: searches with (evidence: `js/core/bot-worker.js`)
- Bot worker → Chess rules: loads rules (evidence: `js/core/bot-worker.js`)
- Chess bot → Chess rules: evaluates positions (evidence: `js/core/bot.js`)
- Study board → Chess rules: uses game state (evidence: `js/helpers/study-board.js`)
- App pages → Study board: shows study and replay (evidence: `README.md`)
- App pages → Puzzle collection: offers puzzles (evidence: `README.md`)
- App pages → Rules lessons: teaches rules
- App pages → Opening lines: teaches openings (evidence: `README.md`)
- App pages → Game records: saves game results
- Practice tracking → Local profiles: updates progress (evidence: `js/helpers/practice-data.js`)
- App pages → Practice tracking: tracks puzzle attempts
- App pages → Notebook dialog: opens notebook
- Notebook dialog → Notebook data: uses notebook data
- App pages → Select menus: enhances controls
- App pages → Preferences: configures experience
- App pages → Themes: switches theme
- App pages → Move sound: plays move sound (evidence: `README.md`)
- App pages → Preview board: renders previews
