# singhdhairya17/chess_studio_py architecture

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

## Overview

Chess Studio is a small Flet chess app: a player configures a time control and optional AI opponent, starts a game, makes moves on the board, and sees clocks, move history, and game results. The `ChessApp` in `chess_studio/game.py` owns interactive game behavior and delegates chess helpers to `chess_studio/chess_core.py`; `chess_studio/runner.py` sets up the page and starts the app and clock loop. Stockfish is optional. The game source excerpt is partial, so only relationships supported by the README and visible code are shown.

Main entry points: [`chess_studio/game.py`](https://github.com/singhdhairya17/chess_studio_py/blob/main/chess_studio/game.py) (Chess app UI), [`chess_studio/runner.py`](https://github.com/singhdhairya17/chess_studio_py/blob/main/chess_studio/runner.py) (Page bootstrap), [`chess_studio/chess_core.py`](https://github.com/singhdhairya17/chess_studio_py/blob/main/chess_studio/chess_core.py) (Chess helpers), [`app.py`](https://github.com/singhdhairya17/chess_studio_py/blob/main/app.py) (Flet launcher)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_launch["App startup"]
  node_launcher["Flet launcher<br/>[app.py]"]
  node_runner["Page bootstrap<br/>[runner.py]"]
end

subgraph group_play["Chess gameplay"]
  node_game["Chess app UI<br/>[game.py]"]
  node_board["Chess rules"]
  node_game_controls["Game controls<br/>[game.py]"]
  node_clock["Game clocks<br/>[game.py]"]
  node_history["Move history<br/>[game.py]"]
  node_results["Game results<br/>[game.py]"]
end

subgraph group_support["Shared presentation"]
  node_helpers["Chess helpers<br/>[chess_core.py]"]
  node_theme["Page theme<br/>[theme.py]"]
  node_stockfish_config["Engine config<br/>[chess_core.py]"]
end

node_player(("Player"))
node_python_chess["python-chess"]
node_stockfish["Stockfish engine"]

node_player -->|"uses controls"| node_game
node_launcher -->|"starts"| node_runner
node_runner -->|"applies theme"| node_theme
node_runner -->|"creates and displays"| node_game
node_runner -->|"starts loop"| node_clock
node_game -->|"handles input"| node_game_controls
node_game -->|"updates position"| node_board
node_game -->|"updates clocks"| node_clock
node_game -->|"refreshes history"| node_history
node_game -->|"shows outcomes"| node_results
node_game -->|"uses helpers"| node_helpers
node_helpers -->|"uses rules"| node_python_chess
node_game -->|"uses board rules"| node_python_chess
node_game -->|"checks engine path"| node_stockfish_config
node_game -.->|"launches and queries"| node_stockfish

click node_launcher "https://github.com/singhdhairya17/chess_studio_py/blob/main/app.py"
click node_runner "https://github.com/singhdhairya17/chess_studio_py/blob/main/chess_studio/runner.py"
click node_game "https://github.com/singhdhairya17/chess_studio_py/blob/main/chess_studio/game.py"
click node_game_controls "https://github.com/singhdhairya17/chess_studio_py/blob/main/chess_studio/game.py"
click node_clock "https://github.com/singhdhairya17/chess_studio_py/blob/main/chess_studio/game.py"
click node_history "https://github.com/singhdhairya17/chess_studio_py/blob/main/chess_studio/game.py"
click node_results "https://github.com/singhdhairya17/chess_studio_py/blob/main/chess_studio/game.py"
click node_helpers "https://github.com/singhdhairya17/chess_studio_py/blob/main/chess_studio/chess_core.py"
click node_theme "https://github.com/singhdhairya17/chess_studio_py/blob/main/chess_studio/theme.py"
click node_stockfish_config "https://github.com/singhdhairya17/chess_studio_py/blob/main/chess_studio/chess_core.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_launcher,node_runner toneBlue
class node_game,node_board,node_game_controls,node_clock,node_history,node_results toneAmber
class node_helpers,node_theme,node_stockfish_config toneMint
class node_player,node_python_chess,node_stockfish toneIndigo
```

## Components

### App startup

- [Flet launcher](https://github.com/singhdhairya17/chess_studio_py/blob/main/app.py): `app.py`
- [Page bootstrap](https://github.com/singhdhairya17/chess_studio_py/blob/main/chess_studio/runner.py): `chess_studio/runner.py`

### Chess gameplay

- [Chess app UI](https://github.com/singhdhairya17/chess_studio_py/blob/main/chess_studio/game.py): `chess_studio/game.py`
- **Chess rules**
- [Game controls](https://github.com/singhdhairya17/chess_studio_py/blob/main/chess_studio/game.py): `chess_studio/game.py`
- [Game clocks](https://github.com/singhdhairya17/chess_studio_py/blob/main/chess_studio/game.py): `chess_studio/game.py`
- [Move history](https://github.com/singhdhairya17/chess_studio_py/blob/main/chess_studio/game.py): `chess_studio/game.py`
- [Game results](https://github.com/singhdhairya17/chess_studio_py/blob/main/chess_studio/game.py): `chess_studio/game.py`

### Shared presentation

- [Chess helpers](https://github.com/singhdhairya17/chess_studio_py/blob/main/chess_studio/chess_core.py): `chess_studio/chess_core.py`
- [Page theme](https://github.com/singhdhairya17/chess_studio_py/blob/main/chess_studio/theme.py): `chess_studio/theme.py`
- [Engine config](https://github.com/singhdhairya17/chess_studio_py/blob/main/chess_studio/chess_core.py): `chess_studio/chess_core.py`

### Other components

- **Player**
- **python-chess**
- **Stockfish engine**

## Connections

- Player → Chess app UI: uses controls
- Flet launcher → Page bootstrap: starts
- Page bootstrap → Page theme: applies theme
- Page bootstrap → Chess app UI: creates and displays
- Page bootstrap → Game clocks: starts loop
- Chess app UI → Game controls: handles input
- Chess app UI → Chess rules: updates position
- Chess app UI → Game clocks: updates clocks
- Chess app UI → Move history: refreshes history
- Chess app UI → Game results: shows outcomes
- Chess app UI → Chess helpers: uses helpers
- Chess helpers → python-chess: uses rules
- Chess app UI → python-chess: uses board rules
- Chess app UI → Engine config: checks engine path
- Chess app UI → Stockfish engine: launches and queries
