Skip to content

About

Chess Vision Coach - point your camera at a physical chess board and get AI-powered move suggestions. OpenCV + Stockfish, deployed on Railway.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Chess Vision Coach

Python Version FastAPI OpenCV Stockfish

Point your phone camera at a chess board. Get your next move. No bullshit.

🌟 Overview

Chess Vision Coach is a lightweight, blazing-fast web application that helps you analyze over-the-board chess positions in real-time. Simply point your smartphone camera at a physical chess board, and the app will instantly suggest the best move using the powerful Stockfish engine.

✨ Features

  • Zero-weight Board Detection: Utilizes OpenCV for fast, accurate board detection without the need for heavy GPU models. Perfect for overhead phone cameras.
  • Persistent Engine: Stockfish is started once on boot and kept alive for all requests, ensuring zero restart overhead between moves.
  • Smart FEN Caching: The engine is only called when the board position actually changes, saving resources and battery life.
  • Multiple Play Modes: Choose between "Win Mode" for the strongest possible moves, or "Loss Mode" for more human-like, believable inaccuracies.
  • Adjustable Strength: Easily change the engine depth to match your desired Elo rating (approx. 800 to 2600+).

🚀 Quick Deploy

Get your own instance running in under a minute!

# 1. Deploy the Backend to Railway
cd backend && railway up

# 2. Deploy the Frontend to Cloudflare Pages
# - Edit API_BASE in frontend/app.js to point to your Railway URL
# - Push to GitHub and connect in Cloudflare Pages dashboard

🏗️ Architecture & Design

  • Frontend: Pure HTML/CSS/Vanilla JS for minimal footprint. Hosted on Cloudflare Pages for global Edge CDN delivery and custom Permissions-Policy headers (crucial for camera access).
  • Backend: FastAPI providing a robust, async API. Deployed on Railway for easy containerized hosting.
  • Vision: OpenCV was chosen over YOLOv8 for its zero-megabyte model size and ultra-fast inference on standard CPUs, making it ideal for the Railway free tier.
  • Chess Engine: Stockfish integrated via a persistent, thread-safe service wrapper that auto-recovers from any edge-case crashes.

📚 Documentation

For more detailed information, check out our comprehensive docs:


Built with ❤️ for chess enthusiasts everywhere.

About

Chess Vision Coach - point your camera at a physical chess board and get AI-powered move suggestions. OpenCV + Stockfish, deployed on Railway.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages