Currently in the initial development phase.
- Docker
- Docker Compose
-
Start the development environment:
docker compose --env-file .env.dev -f docker-compose.dev.yml up --build
-
Access the API:
- API: http://127.0.0.1:8000
- Interactive Docs (Swagger): http://127.0.0.1:8000/docs
-
Stop the environment:
docker compose -f docker-compose.dev.yml down
-
(Optional - only if you want a completely clean slate) stop and remove volumes:
docker compose -f docker-compose.dev.yml down -v
Environment variables are configured in .env.dev:
DB_NAME,DB_USER,DB_PASSWORD,DB_PORT- Database configurationPOSTGRES_PASSWORD- PostgreSQL superuser passwordAPP_PORT- API port (default: 8000)
If one finds they need to update dependencies (requirements.txt), the following steps can be followed:
- If a new package is required, add it to requirements.in
- Setup and activate a Python (v3.14) virtual environment. For example, with conda use:
conda create -n tictac-api python=3.14 && conda activate tictac-api - Install pip-tools:
pip install pip-tools - Compile new requirements:
pip-compile --upgrade - (Optional) Test the update locally in your environment:
pip-sync
Note: If you need to update the Python version, make sure to adjust the steps above accordingly and to update the Python image in the Dockerfile.
This project uses pre-commit hooks to automatically format Python code with Black before each commit. This ensures consistent code style across the project.
Setup (one-time):
-
Setup and activate a Python (v3.14) virtual environment if you haven't already:
conda create -n tictac-api python=3.14 && conda activate tictac-api -
Install dependencies:
pip install -r requirements.txt
-
Install the pre-commit hooks:
pre-commit install
Usage:
Once installed, the hooks will run automatically on git commit. If Black reformats any files, the commit will be aborted and you'll need to:
- Review the changes Black made
- Stage the reformatted files:
git add <files> - Commit again:
git commit
Manual formatting:
You can also run Black manually on all files:
black .Or run all pre-commit hooks manually without committing:
pre-commit run --all-filesConfiguration:
- Pre-commit hooks are configured in .pre-commit-config.yaml