# shivamshuroy448/checkmatelab architecture

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

- Interactive diagram: https://gitdiagram.com/shivamshuroy448/checkmatelab
- Repository: https://github.com/shivamshuroy448/checkmatelab

## Overview

CheckmateLab is a browser-based chess analysis and training dashboard. A player makes or imports a position, receives engine evaluation and a recommended move, and can review openings or solve tactical puzzles. The graph also preserves documented game review, account/leaderboard, and companion-assistant capabilities. Source excerpts show the app’s core imports and the engine’s external evaluation requests; some documented features and auxiliary import paths lack sampled wiring, so those links are dashed and marked unverified.

Main entry points: [`src/app.js`](https://github.com/shivamshuroy448/checkmatelab/blob/main/src/app.js) (App controller), [`src/stockfishEngine.js`](https://github.com/shivamshuroy448/checkmatelab/blob/main/src/stockfishEngine.js) (Position evaluator), [`src/boardRenderer.js`](https://github.com/shivamshuroy448/checkmatelab/blob/main/src/boardRenderer.js) (Interactive board), [`content/parser.js`](https://github.com/shivamshuroy448/checkmatelab/blob/main/content/parser.js) (Chess.com board parser)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Player experience"]
  node_app["App controller<br/>[app.js]"]
  node_board["Interactive board<br/>[boardRenderer.js]"]
  node_game_state["Chess game state<br/>[app.js]"]
  node_game_import["Game and position import<br/>[app.js]"]
  node_screen_capture["Screen capture"]
  node_image_vision["Board image analysis"]
  node_sounds["Chess sound effects<br/>[soundEffects.js]"]
end

subgraph group_analysis["Position analysis"]
  node_engine["Position evaluator<br/>[stockfishEngine.js]"]
  node_lichess["Lichess cloud evaluation"]
  node_stockfish_online["Stockfish Online API"]
  node_opening_detector["ECO opening detector<br/>[openings.js]"]
  node_gemini["Gemini coach and vision<br/>[geminiAiEngine.js]"]
end

subgraph group_training["Training and review"]
  node_review["Game review and accuracy<br/>[app.js]"]
  node_puzzles["Tactical puzzle catalog<br/>[puzzles.js]"]
  node_profile["Account and ELO profile<br/>[app.js]"]
  node_leaderboard["Live leaderboard<br/>[app.js]"]
end

subgraph group_companion["Chess-site companion"]
  node_site_parser["Chess.com board parser<br/>[parser.js]"]
  node_site_overlay["Companion overlay"]
end

node_player(("Player"))
node_site_user(("Chess-site user"))
node_google["Google Identity Services"]
node_leaderboard_service["Leaderboard service"]

node_player -->|"uses"| node_app
node_app -->|"controls"| node_game_state
node_app -->|"renders"| node_board
node_board -->|"reports clicks"| node_app
node_app -.->|"loads positions"| node_game_import
node_screen_capture -.->|"supplies FEN"| node_game_import
node_image_vision -.->|"supplies FEN"| node_game_import
node_app -->|"requests evaluation"| node_engine
node_engine -->|"queries"| node_lichess
node_engine -->|"falls back to"| node_stockfish_online
node_app -->|"identifies openings"| node_opening_detector
node_app -->|"loads puzzles"| node_puzzles
node_app -.->|"provides review"| node_review
node_app -.->|"supports sign-in"| node_profile
node_profile -.->|"authenticates with"| node_google
node_app -.->|"shows rankings"| node_leaderboard
node_leaderboard -.->|"gets live rankings"| node_leaderboard_service
node_app -->|"uses effects"| node_sounds
node_site_user -.->|"plays on site"| node_site_parser
node_site_parser -.->|"provides position"| node_site_overlay
node_site_overlay -->|"requests evaluation"| node_lichess

click node_app "https://github.com/shivamshuroy448/checkmatelab/blob/main/src/app.js"
click node_board "https://github.com/shivamshuroy448/checkmatelab/blob/main/src/boardRenderer.js"
click node_game_state "https://github.com/shivamshuroy448/checkmatelab/blob/main/src/app.js"
click node_game_import "https://github.com/shivamshuroy448/checkmatelab/blob/main/src/app.js"
click node_screen_capture "https://github.com/shivamshuroy448/checkmatelab/blob/main/src/screenCaptureEngine.js"
click node_image_vision "https://github.com/shivamshuroy448/checkmatelab/blob/main/src/imageVisionEngine.js"
click node_engine "https://github.com/shivamshuroy448/checkmatelab/blob/main/src/stockfishEngine.js"
click node_opening_detector "https://github.com/shivamshuroy448/checkmatelab/blob/main/src/openings.js"
click node_gemini "https://github.com/shivamshuroy448/checkmatelab/blob/main/src/geminiAiEngine.js"
click node_review "https://github.com/shivamshuroy448/checkmatelab/blob/main/src/app.js"
click node_puzzles "https://github.com/shivamshuroy448/checkmatelab/blob/main/src/puzzles.js"
click node_profile "https://github.com/shivamshuroy448/checkmatelab/blob/main/src/app.js"
click node_leaderboard "https://github.com/shivamshuroy448/checkmatelab/blob/main/src/app.js"
click node_sounds "https://github.com/shivamshuroy448/checkmatelab/blob/main/src/soundEffects.js"
click node_site_parser "https://github.com/shivamshuroy448/checkmatelab/blob/main/content/parser.js"
click node_site_overlay "https://github.com/shivamshuroy448/checkmatelab/blob/main/public/chess-ai-helper.user.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_app,node_board,node_game_state,node_game_import,node_screen_capture,node_image_vision,node_sounds,node_site_user toneBlue
class node_engine,node_lichess,node_stockfish_online,node_opening_detector,node_gemini toneAmber
class node_review,node_puzzles,node_profile,node_leaderboard toneMint
class node_site_parser,node_site_overlay toneRose
class node_player,node_google,node_leaderboard_service toneIndigo
```

## Components

### Player experience

- [App controller](https://github.com/shivamshuroy448/checkmatelab/blob/main/src/app.js): `src/app.js`
- [Interactive board](https://github.com/shivamshuroy448/checkmatelab/blob/main/src/boardRenderer.js): `src/boardRenderer.js`
- [Chess game state](https://github.com/shivamshuroy448/checkmatelab/blob/main/src/app.js): `src/app.js`
- [Game and position import](https://github.com/shivamshuroy448/checkmatelab/blob/main/src/app.js): `src/app.js`
- [Screen capture](https://github.com/shivamshuroy448/checkmatelab/blob/main/src/screenCaptureEngine.js): `src/screenCaptureEngine.js`
- [Board image analysis](https://github.com/shivamshuroy448/checkmatelab/blob/main/src/imageVisionEngine.js): `src/imageVisionEngine.js`
- [Chess sound effects](https://github.com/shivamshuroy448/checkmatelab/blob/main/src/soundEffects.js): `src/soundEffects.js`

### Position analysis

- [Position evaluator](https://github.com/shivamshuroy448/checkmatelab/blob/main/src/stockfishEngine.js): `src/stockfishEngine.js`
- **Lichess cloud evaluation**
- **Stockfish Online API**
- [ECO opening detector](https://github.com/shivamshuroy448/checkmatelab/blob/main/src/openings.js): `src/openings.js`
- [Gemini coach and vision](https://github.com/shivamshuroy448/checkmatelab/blob/main/src/geminiAiEngine.js): `src/geminiAiEngine.js`

### Training and review

- [Game review and accuracy](https://github.com/shivamshuroy448/checkmatelab/blob/main/src/app.js): `src/app.js`
- [Tactical puzzle catalog](https://github.com/shivamshuroy448/checkmatelab/blob/main/src/puzzles.js): `src/puzzles.js`
- [Account and ELO profile](https://github.com/shivamshuroy448/checkmatelab/blob/main/src/app.js): `src/app.js`
- [Live leaderboard](https://github.com/shivamshuroy448/checkmatelab/blob/main/src/app.js): `src/app.js`

### Chess-site companion

- [Chess.com board parser](https://github.com/shivamshuroy448/checkmatelab/blob/main/content/parser.js): `content/parser.js`
- [Companion overlay](https://github.com/shivamshuroy448/checkmatelab/blob/main/public/chess-ai-helper.user.js): `public/chess-ai-helper.user.js`

### Other components

- **Player**
- **Chess-site user**
- **Google Identity Services**
- **Leaderboard service**

## Connections

- Player → App controller: uses (evidence: `README.md`)
- App controller → Chess game state: controls (evidence: `src/app.js`)
- App controller → Interactive board: renders (evidence: `src/app.js`)
- Interactive board → App controller: reports clicks (evidence: `src/boardRenderer.js`)
- App controller → Game and position import: loads positions (evidence: `src/app.js`)
- Screen capture → Game and position import: supplies FEN
- Board image analysis → Game and position import: supplies FEN
- App controller → Position evaluator: requests evaluation (evidence: `src/app.js`)
- Position evaluator → Lichess cloud evaluation: queries (evidence: `src/stockfishEngine.js`)
- Position evaluator → Stockfish Online API: falls back to (evidence: `src/stockfishEngine.js`)
- App controller → ECO opening detector: identifies openings (evidence: `src/app.js`)
- App controller → Tactical puzzle catalog: loads puzzles (evidence: `src/app.js`)
- App controller → Game review and accuracy: provides review (evidence: `README.md`)
- App controller → Account and ELO profile: supports sign-in (evidence: `README.md`)
- Account and ELO profile → Google Identity Services: authenticates with (evidence: `README.md`)
- App controller → Live leaderboard: shows rankings (evidence: `README.md`)
- Live leaderboard → Leaderboard service: gets live rankings (evidence: `README.md`)
- App controller → Chess sound effects: uses effects (evidence: `src/app.js`)
- Chess-site user → Chess.com board parser: plays on site
- Chess.com board parser → Companion overlay: provides position
- Companion overlay → Lichess cloud evaluation: requests evaluation (evidence: `public/chess-ai-helper.user.js`)
