Train like a Grandmaster using Stockfish 18 + AI coaching (Gemini & GPT-4o).
Analyze positions, solve puzzles, study openings, and get human-like explanations for every move.
No installation. No servers required. Runs entirely in your browser.
⭐ If you like this project, please consider starring the repository.
Chess King is an AI-powered chess training platform designed to help players understand chess deeply rather than just memorize moves.
Most chess apps show the best move.
Chess King explains why it is the best move.
By combining Stockfish engine analysis with large language models, the system behaves like a real chess coach, helping players improve their thinking process.
The application runs entirely in the browser, using WebAssembly for engine analysis and modern AI models for natural explanations.
- ♟ Stockfish 18 running entirely in-browser (WASM)
- 🤖 AI chess coach powered by Gemini + GPT-4o
- 📊 Real-time engine evaluation bar
- 🧠 Human-like explanations for positions
- 🎯 Puzzle, opening, and endgame training
- 📈 Full game analysis with move classification
- ⚡ No backend required — fully browser based
Live Game with AI Coach Panel |
Training Mode — Puzzles, Openings & Endgames |
Deep Engine Analysis with Best Move, Hints & Position Analysis |
Chess King includes a conversational AI coach designed to guide players through positions like a human trainer.
Features include:
- Real-time AI explanations
- Conversational chess analysis
- Skill-level adaptive coaching
- Move suggestions with reasoning
The coach explains:
- Candidate moves
- Tactical ideas
- Strategic plans
- Calculation trees
Instead of simply telling the best move, it teaches how strong players think.
The project integrates Stockfish 18 compiled to WebAssembly, allowing deep engine analysis directly inside the browser.
Capabilities include:
- Multi-PV analysis
- Evaluation bar
- Best move suggestions
- Threat detection
- Position evaluation
All analysis runs locally in your browser without server calls.
The platform includes multiple training systems designed to improve chess skills.
Improve calculation and pattern recognition.
- 44 curated puzzles
- Tactical motif detection
- Guided hints
Practice opening theory.
- 54 opening lines
- Move-by-move explanations
- ECO opening recognition
Learn fundamental endgame techniques.
- 21 classic endgame scenarios
- Position-based training
- Engine verification
Review mistakes from previous games.
- Blunder detection
- Tactical explanation
- Improvement suggestions
Chess King analyzes entire games and provides detailed insights.
Analysis includes:
- Move quality classification
- Accuracy percentage
- Tactical pattern detection
- Opening recognition
Each move is categorized as:
- Excellent
- Good
- Inaccuracy
- Mistake
- Blunder
This helps players understand where and why mistakes happen.
The application includes a full interactive chess board system.
Features include:
- Drag-and-drop move input
- Legal move highlighting
- Arrow annotations
- Move history with PGN
- Position setup via FEN
- Save/load games using IndexedDB
- Board flipping
- Dark mode support
You can also play against a custom minimax chess engine with multiple difficulty levels.
- Node.js 18+
- npm or yarn
Clone the repository:
git clone https://github.com/Iamsdt/chess.git
cd chessInstall dependencies:
npm installStart the development server:
npm run devOpen:
http://localhost:5173
To enable AI coaching features, create a .env file:
VITE_GOOGLE_AI_API_KEY=your_google_gemini_api_key
VITE_OPENAI_API_KEY=your_openai_api_keyNote:
The project still works fully offline for chess analysis and training without API keys.
npm run build
npm run preview| Layer | Technology |
|---|---|
| Frontend | React 19 + Vite 6 |
| Styling | Tailwind CSS + Radix UI |
| Chess Logic | chess.js |
| Chess Board | react-chessboard |
| Engine | Stockfish 18 (WASM) |
| AI Models | Gemini + GPT-4o |
| State Management | Zustand |
| Storage | IndexedDB (idb) |
| Custom Engine | Minimax + Alpha-Beta pruning |
src/
├── components/
│ ├── board-panel.jsx
│ ├── chat-panel.jsx
│ ├── training-panel.jsx
│ ├── puzzle-mode.jsx
│ ├── opening-drill-mode.jsx
│ ├── endgame-mode.jsx
│ └── blunder-review-mode.jsx
│
├── hooks/
│ ├── use-engine-coach.js
│ ├── use-ai-chat.js
│ └── use-chess-clock.js
│
├── lib/
│ ├── engine.js
│ ├── stockfish.js
│ ├── intelligence.js
│ ├── analyzer.js
│ └── openings.js
│
├── store/
│ └── use-game-store.js
│
└── data/
├── puzzles.js
└── endgames.js
Planned improvements:
- Online multiplayer
- Chess database
- Opening explorer
- Game import from Lichess / Chess.com
- ELO rating system
- AI game commentary
- Advanced training modules
Contributions are welcome!
If you'd like to improve the project:
- Fork the repository
- Create a feature branch
- Commit your changes
- Submit a pull request
Ideas for contributions:
- Add more puzzles
- Expand opening database
- Improve UI/UX
- Add new training modes
MIT License
© Shudipto Trafder
Built with ♟️, AI, and a lot of ☕
Stop memorizing moves. Start understanding chess.


