Skip to main content
In progress

SochMate

A chess improvement tool that analyses games move-by-move using the Stockfish engine. Paste a Chess.com link, Lichess URL, or raw PGN and get a full breakdown of every decision you made.

  • Chess
  • Python
  • FastAPI
  • Next.js
  • React
  • PostgreSQL
  • Side Project
View on GitHub

SochMate cover

The name comes from “Soch” (सोच) — the Hindi/Urdu word for thought. That’s the whole point: to help you think better at chess, not just play faster.

Most post-game analysis tools tell you what the engine would have played. SochMate tries to tell you why your move was a problem and what was actually happening on the board at that moment.

What it does

Paste in a Chess.com game link, a Lichess URL, or raw PGN notation and SochMate runs the full game through Stockfish, producing a move-by-move breakdown:

  • Move classification — every half-move is labelled Best, Excellent, Good, Inaccuracy, Mistake, or Blunder based on centipawn loss thresholds
  • Accuracy score — computed using Chess.com’s formula so the numbers feel familiar
  • Tactical pattern detection — forks, pins, skewers, hanging pieces, discovered attacks, back-rank threats
  • Critical moments — the moves where the evaluation swung hardest, surfaced automatically
  • Opening recognition — matched against 194 ECO variations via EPD lookup
  • Single-sentence explanations — a plain-English line for each move explaining what went wrong or right

How I built it

The backend is FastAPI with Celery workers handling the analysis pipeline asynchronously. Each worker keeps its own singleton Stockfish instance — Stockfish isn’t thread-safe, so process-based concurrency was the right call here.

The analysis flow goes: PGN input → format detection → position reconstruction → engine evaluation → classification → tactical pattern detection → explanation generation → accuracy calculation → database persistence.

PostgreSQL stores everything: users, raw PGN, per-move evaluations (centipawn and mate scores, before/after FEN states, classification labels, tactical tags), aggregated summaries, and auth sessions.

The frontend is Next.js 16 with React 19 and Tailwind CSS 4. Chess.js handles move validation and board state; React Chessboard renders the interactive board.

Stack: FastAPI · PostgreSQL 16 · Redis · Celery · Stockfish 16/18 · Next.js · React 19 · TypeScript · Tailwind CSS 4

Deployed on: Railway (backend) · Vercel (frontend)

What’s next

  • Accuracy trend charts across your game history
  • Auto-import by Chess.com username
  • AI-powered explanations via Claude API
  • Shareable analysis links
  • Mobile responsiveness