A modern chess learning web application that helps players improve through AI-powered analysis and personalized training.
- Interactive chessboard with drag-and-drop moves
- AI opponent powered by Stockfish engine
- Multiple difficulty levels (800-2500 rating)
- Real-time game state tracking
- Move history display
- Board flipping and game reset
- Import games from Lichess
- Import games from Chess.com
- Progress tracking during import
- Display imported game list with metadata
- Support for up to 100 games per import
- Landing page with feature descriptions
- Navigation to import games
- Foundation for future analysis features
-
Chess Engine: Stockfish.js running in Web Worker
- Non-blocking UI during analysis
- UCI protocol communication
- Configurable depth and skill level
-
Game Logic: Chess.js wrapper with utilities
- Move validation and generation
- PGN parsing and generation
- FEN handling
- Game phase detection
-
State Management: Zustand stores
- Game state (position, history, turn)
- Engine state (AI thinking, difficulty)
- Persistent game modes
-
API Integration:
- Lichess API client with rate limiting
- Chess.com API client with rate limiting
- CORS-compatible fetching
-
UI Components:
- ChessBoard (Chessground wrapper)
- Import Form with platform selection
- Progress indicators
- Responsive design for mobile/desktop
- Framework: Next.js 14 with App Router
- Language: TypeScript
- Chess Libraries:
- chess.js - Game logic
- chessground - Interactive board
- stockfish.js - Chess engine
- State: Zustand
- Styling: Tailwind CSS
- Storage: Client-side (localStorage, future IndexedDB)
npm installnpm run devOpen http://localhost:3000 in your browser.
npm run build
npm startchess-mentor/
├── app/ # Next.js app router pages
│ ├── page.tsx # Landing page
│ ├── play/page.tsx # Play against AI
│ ├── import/page.tsx # Import games
│ └── analysis/page.tsx # Analysis page
├── src/
│ ├── components/ # React components
│ │ ├── chess/ # Chess-related components
│ │ └── import/ # Import form components
│ ├── lib/ # Core libraries
│ │ ├── chess/ # Chess logic and PGN parsing
│ │ ├── engine/ # Stockfish controller and difficulty
│ │ ├── api/ # API clients for Lichess/Chess.com
│ │ └── storage/ # Local storage utilities
│ ├── store/ # Zustand state stores
│ ├── types/ # TypeScript type definitions
│ └── workers/ # Web Workers (Stockfish)
├── public/ # Static assets
│ └── stockfish.js # Stockfish engine
└── README.md # This file
- Navigate to
/play - Wait for the engine to initialize
- Make moves by dragging and dropping pieces
- The AI will respond automatically
- Use "Flip Board" to change orientation
- Use "Reset Game" to start over
- Navigate to
/import - Select platform (Lichess or Chess.com)
- Enter your username
- Choose number of games (10-100)
- Click "Import Games"
- View imported games in the list
The Analysis page framework is in place for future implementation of:
- Comprehensive game analysis with Stockfish
- Blunder detection and classification
- Move accuracy calculation
- Rating estimation
- Opening repertoire analysis
- Performance trends
- Chess game logic and move validation
- Stockfish Web Worker integration
- Engine controller with UCI protocol
- Difficulty calculation system
- Game state management (Zustand)
- Interactive chessboard component
- AI opponent with multiple difficulty levels
- Lichess API integration
- Chess.com API integration
- Import functionality with progress tracking
- Responsive UI design
- Rate limiting for API calls
- Game analysis implementation
- IndexedDB caching for games
- Real-time move feedback system
- Skill analyzer with rating estimation
- Blunder detection algorithm
- Opening repertoire analysis
- Performance visualization charts
- Move-by-move analysis view
- Tactical pattern recognition
- UI/UX polish and animations
- Performance optimization
- ✅ Build: Successful compilation
- ✅ First Contentful Paint: <2s (local)
- ✅ Chess engine initialization: <1s
- ⏳ Move feedback latency: <50ms (not yet implemented)
- ⏳ Stockfish depth 15 evaluation: <2s (varies by device)
- Stockfish worker initialization needs error handling
- Some TypeScript type warnings in ChessBoard component
- Analysis features are placeholder UI only
- No persistence of imported games yet
- Engine worker needs better error recovery
This is a learning project. Key areas for contribution:
- Implementing the analysis features
- Adding IndexedDB persistence
- Improving UI/UX with animations
- Adding more comprehensive error handling
- Writing tests for chess logic
- Optimizing bundle size
MIT License - See LICENSE file for details
- Stockfish - Chess engine
- Lichess - Open platform and API
- Chess.com - API access
- chessground - Interactive board
- chess.js - Chess logic
For questions or suggestions, please open an issue on GitHub.
Status: MVP Complete - Play feature fully functional, Import feature working, Analysis framework in place Last Updated: February 2026