Problem Statement
Analyzing chess games after playing them is essential for improvement, but existing tools either require paid subscriptions (Chess.com analysis) or have complex interfaces (Lichess analysis board). I wanted a simple, free tool that gives immediate insights into game quality.
Demo
Upload a PGN file or import directly from Chess.com/Lichess. The app analyzes every move against Stockfish and provides:
- Accuracy score — percentage of moves that match or are close to the engine's top choice
- Blunder detection — moves that lose significant evaluation (>1.5 pawns)
- Color-coded moves — green (good), yellow (inaccuracy), orange (mistake), red (blunder)
- Critical moments — positions where the game's outcome shifted
Architecture
Each move is evaluated by running Stockfish at depth 18 on the position before and after the move. The evaluation difference determines the classification:
- < 0.3 pawns loss → good move (green)
- 0.3 - 0.8 → inaccuracy (yellow)
- 0.8 - 1.5 → mistake (orange)
- > 1.5 → blunder (red)
Tech Stack
- Python / Flask — Backend API for PGN parsing and Stockfish integration
- python-chess — PGN parsing, move validation, FEN generation
- Stockfish — Chess engine for position evaluation (runs as subprocess)
- React — Frontend with interactive chessboard
- Chart.js — Evaluation graph showing advantage over time
Lessons Learned
-
Stockfish depth matters for accuracy — Depth 12 is fast but misses tactical nuances. Depth 18 takes ~0.5s per move but gives reliable evaluations. Depth 20+ is diminishing returns for amateur game analysis.
-
Chess.com and Lichess have different PGN formats — Chess.com includes clock times, Lichess includes evaluation annotations. The parser needs to handle both gracefully.
-
Mobile-responsive chessboards are tricky — The board needs to be square and resize with the viewport. CSS
aspect-ratio: 1plusmax-width: min(100vw, 560px)solved it.