Contributor Patterns
This repo is large enough that contributors need repeatable extension patterns, not just file searches.
Add a New API Endpoint
- Update or create the relevant domain router.
- Use the shared auth and DB dependency aliases.
- Inject domain services through dependency aliases, not direct construction.
- Register the router in the app router wiring.
Add a New Domain
Follow the canonical shape:
models.py
repository.py
service.py
schemas.py
types.py
exceptions.py
dependencies.py
router.py
tasks/ is the reference implementation for the full pattern.
Add a New Database Table
- Define the ORM model using the shared base.
- Use UUID foreign keys consistently.
- Create an Alembic revision.
- Review the migration before applying it.
Add a New Socket.IO Handler
- Create a handler class in
realtime/handlers/. - Register the command in the command enum/schema layer.
- Wire it into the handler factory.
Add a New Cron Job
- Create the job implementation in
workers/cron/jobs/. - Register the schedule/spec in the cron job registry.
Repo Rules Worth Remembering
- Use
uv runfor Python commands. - Run Ruff only on changed Python files before calling work complete.
- Use dependency aliases instead of bare
Depends(...)in route signatures. - Do not bypass the billing reservation path for billable work.
- Treat root docs and codemaps as aids, but prefer current code and env examples when they disagree.
Verification Commands
uv run pytest
uv run ruff check path/to/changed.py
uv run ruff format --check path/to/changed.py
curl http://localhost:8000/health