# Project context This is a FastAPI service with a Postgres database. Python 3.13, dependencies managed with uv. ## Commands - Install: `uv sync` - Start the database: `docker compose up -d --wait` - Run the API: `uv run fastapi dev app/main.py`, then open `http://127.0.0.1:8000/docs` - Check your work: `uv run ruff check .`, `uv run ruff format --check .` and `uv run pytest` Run all three checks before you say a task is done, and report any that fail. ## Layout - `app/routers/` holds one module per resource. Routes stay thin and call services. - `app/services/` holds business logic. Services take a database session as an argument. - `app/models.py` holds SQLAlchemy models. Schema changes need an Alembic migration. - `tests/` mirrors `app/`. ## Rules - Type every function signature. Use Pydantic models for request and response bodies. - Read configuration from `app/settings.py`, never from `os.environ` directly. - Create migrations with `uv run alembic revision --autogenerate -m ""` and read the generated file before you keep it. - Do not edit files in `alembic/versions/` that are already on the main branch. - Ask before adding a dependency, deleting files or running commands that change the database outside the test container. ## Style @docs/style.md