Some checks failed
Build Docker Image / build (pull_request) Has been cancelled
Provide targeted context for each app subdirectory so Claude Code understands local patterns without relying on the root CLAUDE.md. Also simplifies root CLAUDE.md dev/prod environment sections. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1.5 KiB
1.5 KiB
Major Domo Database API
FastAPI backend serving SBA fantasy league data. Peewee ORM with PostgreSQL.
Architecture
- Routers: Domain-based in
app/routers_v3/under/api/v3/prefix - ORM: Peewee — always specify
Meta.table_nameto match PostgreSQL naming - Auth: OAuth2 bearer token via
API_TOKENenv var - Error handling:
@handle_db_errorsdecorator (logging, rollback, HTTP errors) - POST models: Use
Optional[int] = Noneforidfields (DB auto-generates) - Logging: Rotating file handler (
/tmp/sba-database.log, 8MB max, 5 backups)
Development Environment
- Dev server location:
10.10.0.42 - Start all services:
docker-compose up(PostgreSQL + API + Adminer) - Pull and start:
docker-compose pull && docker-compose up --build(rebuilds image with latest changes) - Sync from production:
docker-compose --profile sync up sync-prod(one-time production data sync)
Production Environment
- Production deployment: Uses same
docker-compose upworkflow - Production server access:
ssh akamaithencd container-data/sba-database
Important
- All active code is in
/app— root-levelmain.py,db_engine.pyare legacy, not in use - PostgreSQL only (no SQLite fallback)
- Migrations are SQL files in
migrations/, applied manually via psql - API docs auto-generated at
/api/docs - NEVER run or test against the local docker compose — always deploy to and test against the dev server (
10.10.0.42:814). The local container has no meaningful data.