# s8n02000/mon-coach-echecs architecture

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

- Interactive diagram: https://gitdiagram.com/s8n02000/mon-coach-echecs
- Repository: https://github.com/s8n02000/mon-coach-echecs

## Overview

Mon Coach Échecs is a local-first desktop chess-training app. The player makes moves in the renderer; game state and settings are maintained locally, while the desktop process routes engine evaluation, opponent moves, and coaching requests. Stockfish supplies tactical analysis, Maia provides human-like play, and Ollama turns engine-grounded context into natural-language explanations. The interface also supports blunder warnings, progressive hints, variation simulation, game history, and settings. Edges follow shown imports and calls or README-described capabilities; renderer-to-desktop IPC details are only partly sampled, so uncertain links are omitted.

Main entry points: [`src/renderer/App.tsx`](https://github.com/s8n02000/mon-coach-echecs/blob/main/src/renderer/App.tsx) (App Shell), [`src/main/index.ts`](https://github.com/s8n02000/mon-coach-echecs/blob/main/src/main/index.ts) (IPC Orchestrator), [`src/main/uci/stockfish-service.ts`](https://github.com/s8n02000/mon-coach-echecs/blob/main/src/main/uci/stockfish-service.ts) (Stockfish Service), [`src/main/uci/maia-service.ts`](https://github.com/s8n02000/mon-coach-echecs/blob/main/src/main/uci/maia-service.ts) (Maia Service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_play["Game and Interface"]
  node_app["App Shell<br/>[App.tsx]"]
  node_game["Game State<br/>[useChessGame.ts]"]
  node_board["Chessboard<br/>[Chessboard.tsx]"]
  node_controls["Game Controls<br/>[GameControls.tsx]"]
  node_history["Move History<br/>[MoveHistory.tsx]"]
  node_gameover["Game Results<br/>[GameOverAlert.tsx]"]
  node_settings["Settings<br/>[SettingsModal.tsx]"]
  node_storage[("Local Persistence<br/>[storage.ts]")]
end

subgraph group_coach["Coaching Experience"]
  node_coachpanel["AI Coach Panel<br/>[CoachPanel.tsx]"]
  node_progressive["Progressive Hints"]
  node_coachhook["Coach State"]
  node_simulation["Variation Simulation"]
  node_blunder["Blunder Warning<br/>[BlunderAlert.tsx]"]
end

subgraph group_desktop["Desktop Services"]
  node_main["IPC Orchestrator<br/>[index.ts]"]
  node_paths["Resource Paths<br/>[paths.ts]"]
  node_ollama["Ollama Service<br/>[ollama-service.ts]"]
  node_prompt["Prompt Builder<br/>[prompt-builder.ts]"]
  node_coachservice["Progressive Coach"]
end

subgraph group_engines["Chess Engines"]
  node_stockfish["Stockfish Service"]
  node_maia["Maia Service<br/>[maia-service.ts]"]
  node_uci["UCI Process<br/>[uci-process.ts]"]
  node_parser["UCI Parser<br/>[uci-parser.ts]"]
end

node_player(("Player"))
node_ollama_server["Ollama Runtime"]

node_player -->|"plays in"| node_app
node_app -->|"uses"| node_game
node_app -->|"renders"| node_board
node_app -->|"renders"| node_controls
node_app -->|"renders"| node_history
node_app -->|"renders"| node_gameover
node_app -->|"renders"| node_settings
node_app -->|"renders"| node_coachpanel
node_app -->|"renders"| node_progressive
node_app -->|"renders"| node_simulation
node_app -->|"renders"| node_blunder
node_game -->|"loads and saves"| node_storage
node_app -->|"saves settings"| node_storage
node_progressive -->|"uses"| node_coachhook
node_coachhook -->|"requests hint data"| node_main
node_main -->|"routes analysis"| node_stockfish
node_main -->|"routes opponent and model requests"| node_maia
node_main -->|"routes coach requests"| node_ollama
node_main -->|"translates variations"| node_prompt
node_main -->|"requests hint analysis"| node_coachservice
node_ollama -->|"builds prompts"| node_prompt
node_ollama -->|"queries locally"| node_ollama_server
node_coachservice -->|"evaluates positions"| node_stockfish
node_stockfish -->|"runs commands"| node_uci
node_stockfish -->|"parses output"| node_parser
node_stockfish -->|"locates binary"| node_paths
node_maia -->|"runs engine"| node_uci
node_maia -->|"uses service"| node_stockfish
node_maia -->|"locates models"| node_paths

click node_app "https://github.com/s8n02000/mon-coach-echecs/blob/main/src/renderer/App.tsx"
click node_game "https://github.com/s8n02000/mon-coach-echecs/blob/main/src/renderer/hooks/useChessGame.ts"
click node_board "https://github.com/s8n02000/mon-coach-echecs/blob/main/src/renderer/components/Chessboard.tsx"
click node_controls "https://github.com/s8n02000/mon-coach-echecs/blob/main/src/renderer/components/GameControls.tsx"
click node_history "https://github.com/s8n02000/mon-coach-echecs/blob/main/src/renderer/components/MoveHistory.tsx"
click node_gameover "https://github.com/s8n02000/mon-coach-echecs/blob/main/src/renderer/components/GameOverAlert.tsx"
click node_settings "https://github.com/s8n02000/mon-coach-echecs/blob/main/src/renderer/components/SettingsModal.tsx"
click node_storage "https://github.com/s8n02000/mon-coach-echecs/blob/main/src/renderer/utils/storage.ts"
click node_coachpanel "https://github.com/s8n02000/mon-coach-echecs/blob/main/src/renderer/components/CoachPanel.tsx"
click node_progressive "https://github.com/s8n02000/mon-coach-echecs/blob/main/src/renderer/components/ProgressiveCoachWidget.tsx"
click node_coachhook "https://github.com/s8n02000/mon-coach-echecs/blob/main/src/renderer/hooks/useProgressiveCoach.ts"
click node_simulation "https://github.com/s8n02000/mon-coach-echecs/blob/main/src/renderer/components/SimulationToolbar.tsx"
click node_blunder "https://github.com/s8n02000/mon-coach-echecs/blob/main/src/renderer/components/BlunderAlert.tsx"
click node_main "https://github.com/s8n02000/mon-coach-echecs/blob/main/src/main/index.ts"
click node_paths "https://github.com/s8n02000/mon-coach-echecs/blob/main/src/main/utils/paths.ts"
click node_ollama "https://github.com/s8n02000/mon-coach-echecs/blob/main/src/main/ai/ollama-service.ts"
click node_prompt "https://github.com/s8n02000/mon-coach-echecs/blob/main/src/main/ai/prompt-builder.ts"
click node_coachservice "https://github.com/s8n02000/mon-coach-echecs/blob/main/src/main/coach/progressive-coach-service.ts"
click node_stockfish "https://github.com/s8n02000/mon-coach-echecs/blob/main/src/main/uci/stockfish-service.ts"
click node_maia "https://github.com/s8n02000/mon-coach-echecs/blob/main/src/main/uci/maia-service.ts"
click node_uci "https://github.com/s8n02000/mon-coach-echecs/blob/main/src/main/uci/uci-process.ts"
click node_parser "https://github.com/s8n02000/mon-coach-echecs/blob/main/src/main/uci/uci-parser.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_game,node_board,node_controls,node_history,node_gameover,node_settings,node_storage toneBlue
class node_coachpanel,node_progressive,node_coachhook,node_simulation,node_blunder toneAmber
class node_main,node_paths,node_ollama,node_prompt,node_coachservice toneMint
class node_stockfish,node_maia,node_uci,node_parser toneRose
class node_player,node_ollama_server toneIndigo
```

## Components

### Game and Interface

- [App Shell](https://github.com/s8n02000/mon-coach-echecs/blob/main/src/renderer/App.tsx): `src/renderer/App.tsx`
- [Game State](https://github.com/s8n02000/mon-coach-echecs/blob/main/src/renderer/hooks/useChessGame.ts): `src/renderer/hooks/useChessGame.ts`
- [Chessboard](https://github.com/s8n02000/mon-coach-echecs/blob/main/src/renderer/components/Chessboard.tsx): `src/renderer/components/Chessboard.tsx`
- [Game Controls](https://github.com/s8n02000/mon-coach-echecs/blob/main/src/renderer/components/GameControls.tsx): `src/renderer/components/GameControls.tsx`
- [Move History](https://github.com/s8n02000/mon-coach-echecs/blob/main/src/renderer/components/MoveHistory.tsx): `src/renderer/components/MoveHistory.tsx`
- [Game Results](https://github.com/s8n02000/mon-coach-echecs/blob/main/src/renderer/components/GameOverAlert.tsx): `src/renderer/components/GameOverAlert.tsx`
- [Settings](https://github.com/s8n02000/mon-coach-echecs/blob/main/src/renderer/components/SettingsModal.tsx): `src/renderer/components/SettingsModal.tsx`
- [Local Persistence](https://github.com/s8n02000/mon-coach-echecs/blob/main/src/renderer/utils/storage.ts): `src/renderer/utils/storage.ts`

### Coaching Experience

- [AI Coach Panel](https://github.com/s8n02000/mon-coach-echecs/blob/main/src/renderer/components/CoachPanel.tsx): `src/renderer/components/CoachPanel.tsx`
- [Progressive Hints](https://github.com/s8n02000/mon-coach-echecs/blob/main/src/renderer/components/ProgressiveCoachWidget.tsx): `src/renderer/components/ProgressiveCoachWidget.tsx`
- [Coach State](https://github.com/s8n02000/mon-coach-echecs/blob/main/src/renderer/hooks/useProgressiveCoach.ts): `src/renderer/hooks/useProgressiveCoach.ts`
- [Variation Simulation](https://github.com/s8n02000/mon-coach-echecs/blob/main/src/renderer/components/SimulationToolbar.tsx): `src/renderer/components/SimulationToolbar.tsx`
- [Blunder Warning](https://github.com/s8n02000/mon-coach-echecs/blob/main/src/renderer/components/BlunderAlert.tsx): `src/renderer/components/BlunderAlert.tsx`

### Desktop Services

- [IPC Orchestrator](https://github.com/s8n02000/mon-coach-echecs/blob/main/src/main/index.ts): `src/main/index.ts`
- [Resource Paths](https://github.com/s8n02000/mon-coach-echecs/blob/main/src/main/utils/paths.ts): `src/main/utils/paths.ts`
- [Ollama Service](https://github.com/s8n02000/mon-coach-echecs/blob/main/src/main/ai/ollama-service.ts): `src/main/ai/ollama-service.ts`
- [Prompt Builder](https://github.com/s8n02000/mon-coach-echecs/blob/main/src/main/ai/prompt-builder.ts): `src/main/ai/prompt-builder.ts`
- [Progressive Coach](https://github.com/s8n02000/mon-coach-echecs/blob/main/src/main/coach/progressive-coach-service.ts): `src/main/coach/progressive-coach-service.ts`

### Chess Engines

- [Stockfish Service](https://github.com/s8n02000/mon-coach-echecs/blob/main/src/main/uci/stockfish-service.ts): `src/main/uci/stockfish-service.ts`
- [Maia Service](https://github.com/s8n02000/mon-coach-echecs/blob/main/src/main/uci/maia-service.ts): `src/main/uci/maia-service.ts`
- [UCI Process](https://github.com/s8n02000/mon-coach-echecs/blob/main/src/main/uci/uci-process.ts): `src/main/uci/uci-process.ts`
- [UCI Parser](https://github.com/s8n02000/mon-coach-echecs/blob/main/src/main/uci/uci-parser.ts): `src/main/uci/uci-parser.ts`

### Other components

- **Player**
- **Ollama Runtime**

## Connections

- Player → App Shell: plays in (evidence: `README.md`)
- App Shell → Game State: uses (evidence: `src/renderer/App.tsx`)
- App Shell → Chessboard: renders (evidence: `src/renderer/App.tsx`)
- App Shell → Game Controls: renders (evidence: `src/renderer/App.tsx`)
- App Shell → Move History: renders (evidence: `src/renderer/App.tsx`)
- App Shell → Game Results: renders (evidence: `src/renderer/App.tsx`)
- App Shell → Settings: renders (evidence: `src/renderer/App.tsx`)
- App Shell → AI Coach Panel: renders (evidence: `src/renderer/App.tsx`)
- App Shell → Progressive Hints: renders (evidence: `src/renderer/App.tsx`)
- App Shell → Variation Simulation: renders (evidence: `src/renderer/App.tsx`)
- App Shell → Blunder Warning: renders (evidence: `src/renderer/App.tsx`)
- Game State → Local Persistence: loads and saves (evidence: `src/renderer/hooks/useChessGame.ts`)
- App Shell → Local Persistence: saves settings (evidence: `src/renderer/App.tsx`)
- Progressive Hints → Coach State: uses (evidence: `src/renderer/App.tsx`)
- Coach State → IPC Orchestrator: requests hint data (evidence: `src/renderer/hooks/useProgressiveCoach.ts`)
- IPC Orchestrator → Stockfish Service: routes analysis (evidence: `src/main/index.ts`)
- IPC Orchestrator → Maia Service: routes opponent and model requests (evidence: `src/main/index.ts`)
- IPC Orchestrator → Ollama Service: routes coach requests (evidence: `src/main/index.ts`)
- IPC Orchestrator → Prompt Builder: translates variations (evidence: `src/main/index.ts`)
- IPC Orchestrator → Progressive Coach: requests hint analysis (evidence: `src/main/index.ts`)
- Ollama Service → Prompt Builder: builds prompts (evidence: `src/main/ai/ollama-service.ts`)
- Ollama Service → Ollama Runtime: queries locally (evidence: `src/main/ai/ollama-service.ts`)
- Progressive Coach → Stockfish Service: evaluates positions (evidence: `src/main/coach/progressive-coach-service.ts`)
- Stockfish Service → UCI Process: runs commands (evidence: `src/main/uci/stockfish-service.ts`)
- Stockfish Service → UCI Parser: parses output (evidence: `src/main/uci/stockfish-service.ts`)
- Stockfish Service → Resource Paths: locates binary (evidence: `src/main/uci/stockfish-service.ts`)
- Maia Service → UCI Process: runs engine (evidence: `src/main/uci/maia-service.ts`)
- Maia Service → Stockfish Service: uses service (evidence: `src/main/uci/maia-service.ts`)
- Maia Service → Resource Paths: locates models (evidence: `src/main/uci/maia-service.ts`)
