ChessVerse is a web-based chess platform built with Django, allowing users to play multiplayer chess games against other players or single-player games against an AI opponent powered by python-chess and enhanced with Google’s Gemini AI. The application supports real-time gameplay using WebSockets, a responsive chessboard interface, and persistent game storage in SQLite. Features include game creation, joining, resignation, and viewing ongoing/completed games.
- Multiplayer chess with real-time move synchronization via WebSockets.
- Single-player mode against an AI opponent, integrating python-chess and Gemini AI for intelligent move generation.
- User authentication for secure game access.
- Interactive chessboard with drag-and-drop moves, powered by Chess.js and Chessboard.js.
- Persistent game state storage in SQLite, with FEN and PGN tracking.
- Real-time opponent status updates (online/offline) and game outcome handling (checkmate, draw, resignation).
- Responsive UI with Bootstrap styling and modals for game events.
Before setting up ChessVerse, ensure you have the following installed:
- Python 3.8+: Download
- Redis: For WebSocket group messaging.
- Ubuntu:
sudo apt-get install redis-server
- macOS:
brew install redis
- Windows: Use Docker (
docker run -d -p 6379:6379 redis
) or a Windows-compatible Redis build.
- Ubuntu:
- pip: Python package manager (included with Python).
- Google Gemini API Key: Obtain from Google AI Studio for AI features.
Clone ChessVerse to your local machine:
git clone https://github.com/mrmadness49/chessverse.git
cd chessverse
Create and activate a Python virtual environment:
python3 -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
Install required Python packages:
pip install django channels channels-redis python-chess[uci,gaviota] google-generativeai python-dotenv
ChessVerse uses CDN-hosted JavaScript libraries in game.html
. If you prefer local files:
- Create a
static
directory in the project root orchess
app directory. - Download or use npm to install:
npm install chess.js chessboard-js reconnecting-websocket jquery bootstrap
- Place files in
static/js/
andstatic/css/
(e.g.,chess.min.js
,chessboard-0.3.0.min.css
). - Run
python manage.py collectstatic
to gather static files.
Contributions are welcome! Fork the repository, make changes, and submit a pull request. Ensure tests pass and follow the project’s coding style.
MIT License - feel free to use, modify, and distribute.