The League Manager API manages all leagues for the Project SRC stack.
| Component | Technology |
|---|---|
| Framework | FastAPI |
| Package Mgr | uv |
| Database | Supabase |
| Linter | ruff |
| Logging | structlog |
Configuration is done through environment variables in .env:
| Variable | Description |
|---|---|
MOCK |
Run with mocked data (true/false) |
TEST |
Run in test mode (true/false) |
VERSION |
API version |
SUPABASE_URL |
Supabase project URL |
SUPABASE_KEY |
Supabase anon key |
SECRET_KEY |
JWT encryption key |
ALGORITHM |
JWT algorithm (default: HS256) |
ACCESS_TOKEN_EXPIRE_MINUTES |
Token expiration time |
-
Create a Supabase project
-
Copy the URL and anon key to
.env:# .env SUPABASE_URL=https://your-project.supabase.co SUPABASE_KEY=your-anon-key
For local development with Supabase CLI:
supabase start
# Use the provided URL (typically http://127.0.0.1:54321)# Install dependencies
uv sync
# Install dev dependencies
uv sync --group devuv run python src/main.pyThe API will be available at http://localhost:8000
# Run linter
uv run ruff check src/
# Format code
uv run ruff format src/uv run pytest src/
uv run pytest --cov=src/ src/user ──────┬── driver
├── manager
└── steward
country ────┬── track
└── team ─────── contract
└── driver
league ─────┼── race ─────── participation
├── league_team
├── league_driver
└── league_track
user- Base user accountsdriver- Driver profiles with statsmanager- Team manager profilessteward- Race steward profilescountry- Country reference datateam- Racing teamstrack- Race tracks/circuitsleague- Racing leagues/seasonsrace- Race eventscontract- Driver-team contractsparticipation- Race entriesleague_team- Teams in a leagueleague_driver- Drivers in a leagueleague_track- Tracks in a league
docker build -t league-manager:latest .
docker run -d --name league-manager --env-file .env league-manager:latest