This is a full-stack web application for playing the Game of 24. The backend is built with Django and Django REST Framework, and the frontend is a single-page application built with Angular.
- Backend: Django API for solving Game of 24 puzzles.
- Frontend: Angular UI for interacting with the game.
- Code Quality: Pre-commit hooks for formatting (Black, Prettier) and linting.
- Testing: Unit tests for both Django and Angular.
Before you begin, ensure you have the following installed:
- Python 3.10+ and
pip - Node.js (LTS version recommended) and
npm
Follow these steps to set up your local development environment.
git clone <your-repository-url>
cd game24-project# Create and activate a Python virtual environment
python3 -m venv venv
source venv/bin/activate
# Install Python dependencies
pip install -r requirements.txt -r requirements-dev.txt# Navigate to the Angular app directory
cd game24_app
# Install Node.js dependencies
npm install
# Navigate back to the project root
cd ..This step is recommended to ensure your code adheres to the project's style guidelines.
pre-commit installYou need to run two servers concurrently in separate terminals.
Terminal 1: Start Django Backend
# From the project root, with virtualenv activated
python manage.py runserverThe backend API will be available at http://127.0.0.1:8000/.
Terminal 2: Start Angular Frontend
# From the game24_app directory
cd game24_app
npm startThe frontend will be available at http://localhost:4200/.
You can run tests for both the backend and frontend.
# From the project root, with virtualenv activated
python manage.py test# From the game24_app directory
npm test