Real-Time Chess Commentary

Inspiration

As a 2200-rated chess player from a chess-loving family, I’ve always wanted my online games to feel like real broadcasts, something my family could genuinely enjoy watching. People love chess, Chess.com alone has over 200 million members, with nearly 20 million games played every day. Yet only a tiny fraction of those games ever receive the kind of professional broadcast treatment we associate with top-level tournaments. Perhaps the top few hundred players in the world. Everyone else plays in silence. This project is about changing that: giving everyday players the ability to share their games with friends and family, rewatch them later, and experience them with the same narrative, clarity, and excitement as a professionally broadcast match. The goal is to make high-quality chess storytelling accessible to everyone who plays the game. By bringing that style of narration to everyday online games, players can both relive their matches and understand them more deeply.

The question that sparked this project:
What if every online chess game had its own Grandmaster-style commentator?


What It Does

Real-Time Chess Commentary is an AI-powered system that delivers live, contextual commentary for online chess games. Turning any match into a broadcast-like experience.

Deployment

The app is deployed at: https://chess-commentary-frontend-zph6bbw55a-uc.a.run.app/

Profile features and the frontend render correctly. Live commentary may not function, as it depends on the ElevenLabs API and the key used may have run out of free credits.

With a valid ElevenLabs API key, the project runs on google cloud exactly as demonstrated in youtube video.

Core Features

  • Live Game Tracking
    Monitors ongoing games in real time via the Lichess API.
  • Intelligent Commentary
    Generates concise, broadcast-style commentary based on:
    • Personalized psychological and strategic insights gathered from the players previous games
    • Current position and tactical themes
    • Opening theory and game phase
    • Time pressure and momentum shifts
  • Professional Broadcast Interface
    • Live chessboard synced with commentary
    • Player ratings
    • Clean, TV-style dashboard
  • Voice Commentary
    High-quality, natural-sounding audio using ElevenLabs TTS.

How We Built It

Architecture Overview

An event-driven, real-time pipeline: Lichess API → Kafka → AI Commentary Engine → ElevenLabs TTS → WebSocket → Frontend

Tech Stack

Backend

  • Python
  • Confluent Kafka (real-time streaming)
  • FastAPI (WebSockets)
  • Chess.py (game logic & analysis)

Frontend

  • React + Vite
  • React-Chessboard
  • Tailwind CSS
  • WebSockets for live updates

Infrastructure

  • Docker
  • Kafka Streams on Kafka Confluent

Key Technical Challenges & Solutions

API Synchronization

Problem: Lichess API delays caused commentary to arrive before the board updated.
Solution: Commentary-driven board refresh logic to ensure perfect sync.

Real-Time State Management

Problem: Coordinating Kafka streams, WebSockets, and React state.
Solution: Robust deduplication and move-tracking logic to prevent inconsistencies.

UI Performance

Problem: Forced re-renders broke smooth chessboard animations. Solution: Optimized React state updates to preserve animation while maintaining accuracy.

Technical Wins

  • < 1s end-to-end latency from move to audio commentary
  • 100% board–commentary synchronization
  • Scalable Kafka-based architecture
  • Broadcast-quality UI and audio

Innovation Highlights

  • Commentary-first system design
  • Narrative-driven chess experience
  • Accessible for non-chess audiences

Why This Matters

  • Demonstrates real-time distributed systems
  • Combines AI, streaming, and frontend performance
  • Solves real synchronization and latency problems
  • Clear applications in education, broadcasting, and content creation

What’s Next

Near-Term Extensions

  • Chess.com integration
  • Engine evaluation for tactical moments
  • Opening book/historical context
  • More knowledgeable commentary (Stockfish Integration + use Gemini Pro as LLM)
  • Commentary replay and highlights

Long-Term Vision

  • Tournament broadcasting dashboards
  • Educational commentary modes
  • Multi-game monitoring
  • Automated highlight generation

Closing

Real-Time Chess Commentary reimagines how chess is experienced online now everyone can feel like a Grandmaster and share their games with their family and friends in a way that is engaging even for non chess fans.

Built With

Share this project:

Updates