A comprehensive Chess 960 (Fischer Random) game review website that allows users to analyze their games with Stockfish engine analysis. The UI closely resembles Chess.com's game review interface with a modern dark theme.
- Chess.com Integration: Fetch games by username, date range, or direct URL
- Lichess Integration: Fetch games by username, date range, or direct URL
- Direct Import: Import games via PGN or FEN notation
- Proper handling of Fischer Random starting positions (all 960 positions)
- Correct castling rules for Chess 960
- Automatic detection and display of starting position number (1-960)
- Browser-based Stockfish.js (WebAssembly) for fast analysis
- Configurable analysis depth (default: 18)
- Multi-PV analysis showing top 3 engine lines
- Real-time position evaluation
- Interactive Chess Board: Drag and drop pieces, arrow annotations, smooth animations
- Evaluation Bar: Visual representation of position evaluation
- Move Classification:
- โจ Brilliant (cyan/teal)
- ! Great (blue)
- โ Best/Excellent (green)
- โ Good (light green)
- โก Book (gray)
- ?! Inaccuracy (yellow)
- ? Mistake (orange)
- ?? Blunder (red)
- โ Missed Win (red)
- Accuracy Score: Per-player accuracy percentage based on centipawn loss
- Move List Panel: Scrollable, clickable move list with color-coded badges
- Engine Lines: Top 3 engine lines with evaluations and continuations
โ/โ: Previous/Next moveHome/End: First/Last moveF: Flip board
- Dark theme matching Chess.com's aesthetic
- Smooth 60fps animations
- Responsive design (tablet/desktop)
- Modern, clean interface
- Frontend: React 19.2 + TypeScript 5.9
- Build Tool: Vite 7.2
- Styling: Tailwind CSS 3.4
- Chess Logic: chess.js for move validation
- Board: chessground for interactive chess board
- Engine: Stockfish.js (WebAssembly) - runs entirely in browser
- APIs: Chess.com & Lichess public APIs
- Node.js 18+ and npm
-
Clone the repository: ```bash git clone https://github.com/MegaCoderNerd/960analysis.git cd 960analysis ```
-
Install dependencies: ```bash npm install ```
-
Start the development server: ```bash npm run dev ```
-
Open your browser and navigate to `http://localhost:5173\`
```bash npm run build ```
The production build will be in the `dist` folder.
```bash npm run preview ```
-
Direct Import (Recommended for testing):
- Click the "Direct" tab
- Select "PGN" or "FEN"
- Paste your game notation
- Click "Import"
-
Lichess:
- Click the "Lichess" tab
- Enter a Lichess username or game URL
- Select from the list of Chess960 games
-
Chess.com:
- Click the "Chess.com" tab
- Enter a Chess.com username
- Select year and month
- Choose from the filtered Chess960 games
Once a game is loaded:
- Use the navigation buttons or arrow keys to move through the game
- The Stockfish engine automatically analyzes each position
- View the evaluation bar, engine lines, and move classifications
- Check player accuracy scores in the left sidebar
- Click on any move in the move list to jump to that position
```pgn [Event "Chess960 Game"] [Site "Online"] [Date "2024.01.01"] [White "Player1"] [Black "Player2"] [Result "1-0"]
- e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Nf6 5. O-O Be7 6. Re1 b5 7. Bb3 d6 8. c3 O-O 9. h3 Nb8 10. d4 Nbd7 1-0 ```
``` src/ โโโ components/ โ โโโ Board/ # Chess board, evaluation bar, controls โ โโโ Analysis/ # Engine lines, accuracy display, move classification โ โโโ GameImport/ # Import components for different sources โ โโโ MoveList/ # Move list and move items โ โโโ Layout/ # Header and footer โโโ hooks/ # Custom React hooks โ โโโ useStockfish.ts # Stockfish engine hook โ โโโ useChessGame.ts # Chess game state management โ โโโ useGameImport.ts # Game import logic โโโ services/ # API integrations โ โโโ chesscom.ts # Chess.com API โ โโโ lichess.ts # Lichess API โ โโโ analysis.ts # Analysis utilities โโโ utils/ # Utility functions โ โโโ chess960.ts # Chess 960 position handling โ โโโ moveClassification.ts # Move quality classification โ โโโ accuracy.ts # Accuracy calculation โโโ types/ # TypeScript type definitions โโโ workers/ # Web Workers โ โโโ stockfish.worker.ts # Stockfish Web Worker โโโ App.tsx # Main application component ```
- Endpoint: `https://api.chess.com/pub/player/{username}/games/{YYYY}/{MM}\`
- Documentation: Chess.com API Docs
- Rate Limiting: Respectful use recommended
- Endpoint: `https://lichess.org/api/games/user/{username}\`
- Documentation: Lichess API Docs
- Rate Limiting: 10 requests per minute for game export
- Stockfish analysis runs in a Web Worker for non-blocking UI
- Analysis is cached to avoid re-computation
- Chessground provides smooth 60fps board animations
- Lazy loading of Stockfish WASM on first analysis
- Chrome/Edge: โ Full support
- Firefox: โ Full support
- Safari: โ Full support (WebAssembly required)
- Mobile browsers:
โ ๏ธ Limited support (desktop recommended)
Contributions are welcome! Please feel free to submit a Pull Request.
MIT License - feel free to use this project for learning or building your own chess analysis tools.
- Stockfish - The powerful chess engine
- chess.js - Chess move validation
- chessground - Interactive chess board
- Chess.com - UI design inspiration
- Lichess - Open-source chess platform
For issues, questions, or feature requests, please open an issue on GitHub.
Made with โ๏ธ by MegaCoderNerd