A chess AI project built with Python and FastAPI, containerized with Docker for easy deployment and development.
- Docker and Docker Compose installed
- Git
-
Clone the repository
git clone <your-repo-url> cd chess-ai
-
Start development environment
# Start all services (app, Redis, PostgreSQL) docker-compose up chess-ai-dev redis postgres # Or start just the app for development docker-compose up chess-ai-dev
-
Access the application
- API: http://localhost:8000
- API Documentation: http://localhost:8000/docs
# Build and start production services
docker-compose up chess-ai-prod redis postgres
# Or run in detached mode
docker-compose up -d chess-ai-prod redis postgres-
Create virtual environment
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install dependencies
pip install -r requirements.txt pip install -r requirements-dev.txt
-
Run the application
uvicorn main:app --reload
# Build development image
docker-compose build chess-ai-dev
# Build production image
docker-compose build chess-ai-prod
# View logs
docker-compose logs chess-ai-dev
# Execute commands in container
docker-compose exec chess-ai-dev bash
# Stop all services
docker-compose down
# Stop and remove volumes
docker-compose down -vchess-ai/
├── Dockerfile # Multi-stage Docker configuration
├── docker-compose.yml # Development and production services
├── .dockerignore # Files to exclude from Docker context
├── requirements.txt # Production dependencies
├── requirements-dev.txt # Development dependencies
├── main.py # FastAPI application (to be created)
└── README.md # This file
- chess-ai-dev: Development application with hot reload
- chess-ai-prod: Production application
- redis: Caching service for AI computations
- postgres: Database for storing game data
- Create the main FastAPI application (
main.py) - Implement chess engine logic
- Add AI algorithms (minimax, neural networks, etc.)
- Create API endpoints for game management
- Add unit tests and integration tests
- Fork the repository
- Create a feature branch
- Make your changes
- Run tests:
docker-compose exec chess-ai-dev pytest - Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.