How yaswish/chess-advisor works
Chess Advisor is a private, browser-based chess analysis and play app. A player imports or sets up a position or game, navigates it on the board, and receives live engine analysis; they can then review a game, practise mistakes, or play Stockfish. The graph includes the documented opening, endgame, sharing, and personalization features. Some components are represented at their exact source path, but their internal connections are omitted where the supplied excerpts do not establish them.
Main entry points: App.tsx App shell · AnalysisView.tsx Analysis board · review.ts Game review · stockfish.ts Stockfish engine
Components 33
Application
- App shell
src/App.tsx - Analysis board
src/components/AnalysisView.tsx - Chess board
src/components/Board.tsx - Engine panel
src/components/EnginePanel.tsx - Review panel
src/components/ReviewPanel.tsx - Play view
src/components/PlayView.tsx - Position editor
src/components/SetupView.tsx - Import and share
src/components/Dialogs.tsx - Analysis tools
src/components/ToolTabs.tsx - Move sounds
src/audio/sound.ts
Chess workflows
- Live analysis
src/controllers/liveAnalysis.ts - Game review
src/controllers/review.ts - Play controller
src/controllers/play.ts - Game persistence
src/controllers/persistence.ts - Game imports
src/services/games.ts
Analysis and rules
- Chess rules
src/lib/chess.ts - Game tree
src/lib/tree.ts - Evaluation metrics
src/lib/eval.ts - Move grading
src/lib/review.ts - Move insights
src/lib/insights.ts - Tactics detection
src/lib/tactics.ts - PGN handling
src/lib/pgn.ts - Opening lookup
src/lib/openings.ts
Engine and data
- Stockfish engine
src/engine/stockfish.ts - Stockfish WebAssembly
public/engine/stockfish-19-lite-single.js - Cloud evaluations
src/engine/cloud.ts - Syzygy tablebases
src/engine/tablebase.ts
State and preferences
- Game analysis state
src/state/analysis.ts - Interface state
src/state/ui.ts - Saved preferences
src/state/settings.ts
Other components
- Player
- Lichess services
- Chess.com games
Connections 45
- Player → App shell: uses
README.md - App shell → Analysis board: renders
src/App.tsx - App shell → Play view: renders
src/App.tsx - App shell → Position editor: renders
src/App.tsx - App shell → Import and share: renders
src/App.tsx - Analysis board → Chess board: shows
src/components/AnalysisView.tsx - Analysis board → Engine panel: shows
src/components/AnalysisView.tsx - Analysis board → Analysis tools: shows
src/components/AnalysisView.tsx - Analysis board → Live analysis: requests analysis
src/components/AnalysisView.tsx - Analysis board → Game analysis state: reads and updates
src/components/AnalysisView.tsx - Live analysis → Stockfish engine: searches locally
src/controllers/liveAnalysis.ts - Live analysis → Cloud evaluations: checks cache
src/controllers/liveAnalysis.ts - Stockfish engine → Stockfish WebAssembly: runs worker
README.md - Stockfish engine → Evaluation metrics: parses scores
src/engine/stockfish.ts - Live analysis → Game analysis state: stores evaluations
src/controllers/liveAnalysis.ts - Review panel → Game review: starts review
src/components/ReviewPanel.tsx - Game review → Stockfish engine: searches positions
src/controllers/review.ts - Game review → Cloud evaluations: checks evaluations
src/controllers/review.ts - Game review → Move grading: grades moves
src/controllers/review.ts - Game review → Game analysis state: saves results
src/controllers/review.ts - Move grading → Evaluation metrics: converts scores
src/lib/review.ts - Play view → Play controller: controls game
src/components/PlayView.tsx - Play controller → Stockfish engine: requests moves
src/controllers/play.ts - Play controller → Game review: reviews finished game
src/controllers/play.ts - Play controller → Move sounds: plays sounds
src/controllers/play.ts - Position editor → Chess rules: validates positions
src/components/SetupView.tsx - Import and share → PGN handling: imports and exports
src/components/Dialogs.tsx - Import and share → Game imports: loads player games
src/components/Dialogs.tsx - Game imports → Lichess services: fetches games
README.md - Game imports → Chess.com games: fetches games
README.md - Analysis tools → Move insights: explains positions
README.md - Analysis tools → Opening lookup: shows continuations
README.md - Analysis tools → Syzygy tablebases: checks endgames
README.md - Move insights → Tactics detection: detects motifs
src/lib/insights.ts - Opening lookup → Lichess services: optional lookup
- Game persistence → Game analysis state: saves game
src/controllers/persistence.ts - App shell → Game persistence: restores session
src/App.tsx - App shell → Interface state: uses interface state
src/App.tsx - App shell → Saved preferences: loads preferences
src/App.tsx - Saved preferences → Move sounds: configures sound
src/audio/sound.ts - Analysis board → Game tree: navigates variations
src/components/AnalysisView.tsx - Game tree → Chess rules: applies moves
src/lib/tree.ts - Player → Position editor: sets up position
README.md - Player → Play view: plays engine game
README.md - Player → Review panel: reviews game
README.md