Web app: gambitai.vercel.app
I had developed a simple two-player chess game built in Python + Pygame during my 1st year of college.
GambitAI is a 2-player chess web app where you can play with friends, get coached by Stockfish + Groq AI, and scout opponents using Lichess and Chess.com data.
- Classic 2 Player — play online with a friend via shareable room link, no account needed
- Dice Chess — a random piece is rolled before every move, you must move that piece
- AI Coach Mode — 3 lifelines per game, ask Stockfish + Groq for the best move with a reasoning
- Stockfish finds the best move at depth 10
- Groq API(llama-3.1-8b-instant) provides post game analysis and reasoning
- Post-game analysis — full game breakdown streamed word by word after match ends
- Opponent scouting — paste a Lichess/Chess.com profile URL or usernames to get ratings, win/loss stats and an AI scouting report before your game
- Real-time multiplayer via WebSockets
- Full chess rules
- Move highlighting and drag & drop board
- AI post-game analysis and reasoning
- Responsive — works on mobile and desktop
- Installable as a PWA — add to homescreen on any phone
Player A (Browser) ←── WebSocket ──→ FastAPI Server ←── WebSocket ──→ Player B (Browser)
│
python-chess (rules)
Stockfish (best move)
Groq LLaMA 3 (explanation)
Lichess API (scouting)
- Click Classic 2 Player
- Share the room ID with your opponent via WhatsApp or any messenger
- They open the link — no account needed
- Play!
- You get 3 lifelines per game
- Click "Ask Coach" when stuck
- Stockfish finds the best move at depth 10
- Groq explains why in plain english
- Accept or reject — your choice
- A piece type is randomly rolled before each move
- You must move that piece type
- Auto re-rolls if no legal moves exist
- Python 3.11+
- Node.js or Bun
- Groq API key from console.groq.com
cd backend
pip install -r requirements.txt
cp .env.example .env
# add your GROQ_API_KEY to .env
uvicorn app.main:app --reloadcd frontend
bun install
cp .env.example .env
# set VITE_API_URL=http://localhost:8000
bun run devOpen http://localhost:5173 in two tabs to test multiplayer locally.
Environment Variables
GROQ_API_KEY=your_groq_api_key
FRONTEND_URL=https://your-vercel-app.vercel.app
VITE_API_URL=https://your-render-app.onrender.com
VITE_WS_URL=wss://your-render-app.onrender.com
Android:
- Open gambitai.vercel.app in Chrome
- Tap three dots menu → "Add to Home Screen"
iPhone:
- Open gambitai.vercel.app in Safari
- Tap Share → "Add to Home Screen"
