A full-stack chess application for practicing specific openings (Vienna Game for white, Caro-Kann for black) with AI-powered coaching feedback using Gemini API.
- Practice Vienna Game (White) and Caro-Kann Defense (Black)
- Per-move AI coaching feedback on theory and intuition
- Configurable opponent difficulty (800-2800 rating)
- Real-time move validation and feedback
- Sidebar panel displaying move-by-move coaching
Backend:
- FastAPI
- python-chess (Stockfish integration)
- Google Gemini API (coaching feedback)
Frontend:
- React + TypeScript
- Vite
- Tailwind CSS
- react-chessboard
- chess.js
- Python 3.11+
- Node.js 20+
- Stockfish (installed via Docker or system)
- Gemini API key
- Navigate to backend directory:
cd backend- Create virtual environment and install dependencies:
uv venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
uv pip install -e .- Create
.envfile:
cp .env.example .env- Add your Gemini API key to
.env:
GEMINI_API_KEY=your_api_key_here
STOCKFISH_PATH=/usr/local/bin/stockfish # Optional if Stockfish is in PATH
- Run the backend:
uvicorn app.main:app --reload- Navigate to frontend directory:
cd frontend- Install dependencies:
npm install- Run the development server:
npm run devThe app will be available at http://localhost:5173
- Create
.envfile in the root directory:
GEMINI_API_KEY=your_api_key_here
- Build and run with Docker Compose:
docker compose up --buildBackend will be at http://localhost:8000
Frontend will be at http://localhost:3000
- Select an opening (Vienna Game or Caro-Kann Defense)
- Choose opponent difficulty (800-2800 rating)
- Select your color (White or Black)
- Click "Start Game"
- Make moves on the board
- View per-move coaching feedback in the sidebar
POST /api/game/start- Start a new gamePOST /api/game/move- Submit a player movePOST /api/game/opponent-move- Get opponent moveGET /api/game/{game_id}- Get game state
MIT