How s8n02000/mon-coach-echecs works
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: App.tsx App Shell · index.ts IPC Orchestrator · stockfish-service.ts Stockfish Service · maia-service.ts Maia Service
Components 24
Game and Interface
- App Shell
src/renderer/App.tsx - Game State
src/renderer/hooks/useChessGame.ts - Chessboard
src/renderer/components/Chessboard.tsx - Game Controls
src/renderer/components/GameControls.tsx - Move History
src/renderer/components/MoveHistory.tsx - Game Results
src/renderer/components/GameOverAlert.tsx - Settings
src/renderer/components/SettingsModal.tsx - Local Persistence
src/renderer/utils/storage.ts
Coaching Experience
- AI Coach Panel
src/renderer/components/CoachPanel.tsx - Progressive Hints
src/renderer/components/ProgressiveCoachWidget.tsx - Coach State
src/renderer/hooks/useProgressiveCoach.ts - Variation Simulation
src/renderer/components/SimulationToolbar.tsx - Blunder Warning
src/renderer/components/BlunderAlert.tsx
Desktop Services
- IPC Orchestrator
src/main/index.ts - Resource Paths
src/main/utils/paths.ts - Ollama Service
src/main/ai/ollama-service.ts - Prompt Builder
src/main/ai/prompt-builder.ts - Progressive Coach
src/main/coach/progressive-coach-service.ts
Chess Engines
- Stockfish Service
src/main/uci/stockfish-service.ts - Maia Service
src/main/uci/maia-service.ts - UCI Process
src/main/uci/uci-process.ts - UCI Parser
src/main/uci/uci-parser.ts
Other components
- Player
- Ollama Runtime
Connections 29
- Player → App Shell: plays in
README.md - App Shell → Game State: uses
src/renderer/App.tsx - App Shell → Chessboard: renders
src/renderer/App.tsx - App Shell → Game Controls: renders
src/renderer/App.tsx - App Shell → Move History: renders
src/renderer/App.tsx - App Shell → Game Results: renders
src/renderer/App.tsx - App Shell → Settings: renders
src/renderer/App.tsx - App Shell → AI Coach Panel: renders
src/renderer/App.tsx - App Shell → Progressive Hints: renders
src/renderer/App.tsx - App Shell → Variation Simulation: renders
src/renderer/App.tsx - App Shell → Blunder Warning: renders
src/renderer/App.tsx - Game State → Local Persistence: loads and saves
src/renderer/hooks/useChessGame.ts - App Shell → Local Persistence: saves settings
src/renderer/App.tsx - Progressive Hints → Coach State: uses
src/renderer/App.tsx - Coach State → IPC Orchestrator: requests hint data
src/renderer/hooks/useProgressiveCoach.ts - IPC Orchestrator → Stockfish Service: routes analysis
src/main/index.ts - IPC Orchestrator → Maia Service: routes opponent and model requests
src/main/index.ts - IPC Orchestrator → Ollama Service: routes coach requests
src/main/index.ts - IPC Orchestrator → Prompt Builder: translates variations
src/main/index.ts - IPC Orchestrator → Progressive Coach: requests hint analysis
src/main/index.ts - Ollama Service → Prompt Builder: builds prompts
src/main/ai/ollama-service.ts - Ollama Service → Ollama Runtime: queries locally
src/main/ai/ollama-service.ts - Progressive Coach → Stockfish Service: evaluates positions
src/main/coach/progressive-coach-service.ts - Stockfish Service → UCI Process: runs commands
src/main/uci/stockfish-service.ts - Stockfish Service → UCI Parser: parses output
src/main/uci/stockfish-service.ts - Stockfish Service → Resource Paths: locates binary
src/main/uci/stockfish-service.ts - Maia Service → UCI Process: runs engine
src/main/uci/maia-service.ts - Maia Service → Stockfish Service: uses service
src/main/uci/maia-service.ts - Maia Service → Resource Paths: locates models
src/main/uci/maia-service.ts