A browser-based chess application with a Python alpha-beta engine, PGN game analysis, and a React-powered interface.
- Play against the engine as White or Black.
- Board Analysis mode: move either side freely and inspect the current best move.
- Alpha-beta pruning with capture ordering and quiescence search to reduce tactical oversights.
- Position evaluation with material, pawn advancement, central control, mobility, and bishop-pair scoring.
- Opening-book responses for common opening positions.
- PGN paste/upload and move-by-move analysis.
- PGN labels for Book Move, Best Move, Brilliant, Good Move, Mistake, and Blunder.
- Back/forward PGN replay with board position, move highlights, best-move alternatives, and evaluation bar.
- Flip-board control, Chess.com Neo piece artwork, move sounds, and game-over popups.
- Backend: Python, Flask, python-chess
- Engine: Alpha-beta pruning, quiescence search, static evaluation
- Frontend: React 18 loaded through CDN
- Styling: Custom responsive CSS with a purple gradient design
Prerequisites: Python 3.10 or later.
cd C:\Users\HP\OneDrive\Documents\chess
py -m pip install -r requirements.txt
py app.pyOpen http://127.0.0.1:5000 in your browser.
- Select Vs Engine.
- Select White or Black. When Black is selected, the engine makes the opening White move.
- Click a piece, then a highlighted destination square.
- Use Flip to change board orientation.
- Select Board Analysis.
- Move legal pieces for either side.
- The engine calculates and displays a best continuation plus the evaluation bar.
- Open Analyze PGN.
- Paste a PGN game or upload a
.pgnfile. - Run the analysis.
- Select a move or use Back/Forward to replay it on the board.
- For mistakes and blunders, inspect the suggested best continuation.
app.py Flask API and chess engine
requirements.txt Python dependencies
templates/index.html React application shell
static/app.js React frontend
static/style.css Interface styling
The engine is intentionally self-contained and uses alpha-beta search rather than an external chess-engine binary. Chess.com Neo piece images and React are loaded from public CDNs, so an internet connection is needed for those visual/frontend assets.