This project is a full-stack bowling game management system, utilizing a Python backend with a RESTful API and a React frontend. The backend includes game logic to manage and record bowling scores, and integrates with a large language model (LLM) to generate natural language summaries of the game state. The frontend provides a user interface to interact with the system.
- Create and manage bowling games
- Record rolls and calculate scores according to bowling rules
- Retrieve game scores, statistial summaries and historical graph
- Integration with OpenAI's GPT-4 for natural language summaries
- Dockerized setup for easy deployment
- Python 3.12.X
- Docker and Docker Compose installed
- OpenAI API Key for LLM integration
Clone the project from GitHub using the following command:
git clone https://github.com/austinlight-aigeek/bowling-app
cd bowling-app
You will need to set up two .env
files—one in the project root directory and one in the backend/ directory.
Root .env
File
Create an .env
file in the root directory and set your OpenAI API key and postgresql credentials:
OPENAI_API_KEY=your_openai_api_key
POSTGRES_USER = postgres
POSTGRES_PASSWORD = postgres
POSTGRES_SERVER = localhost
POSTGRES_PORT = 5432
POSTGRES_DB = bowling
Refer to env.development
for the structure.
Backend .env
File
Copy the provided .env.mock
from backend/
file into the backend/
directory and rename it to .env
. This file contains the necessary environment variables for the backend services.
Navigate to the backend folder and create a virtual environment:
cd backend
python -m venv venv
- For Windows:
source venv/Scripts/activate
- For macOS/Linux:
source venv/bin/activate
Install the necessary Python packages by running:
pip install -r requirements.txt
Navigate back to the project root and build the Docker containers:
docker-compose up --build
After the Docker containers are running, navigate to the backend/ directory and run the following command to apply database migrations:
alembic upgrade head
Ensure that all services (backend, frontend, PostgreSQL) are running correctly in Docker.
Open your browser and navigate to:
http://localhost:3000
You can run unit and integration tests to verify the functionality of the backend.
- Unit tests are located in backend/tests/unit/
- Integration tests are located in backend/tests/integration/
To run the tests, use:
pytest
For additional details, you can refer to the project documentation and video instructions:
- Project Documentation: []
- Video Instructions: []
- Ensure Docker is running and all services are up using
docker ps
. - Verify that the OpenAI API key is correctly set in the root
.env
file. - Check if the virtual environment is activated before running backend commands.