Generalized backend data science workbench: medallion architecture (bronze → silver → gold), pluggable source adapters, and a REST API compatible with sleeper-stream-scribe. Initial domain: NFL/Sleeper.
- Constitution:
.cursorrules - Spec:
TECH_SPEC.md - Roadmap:
PLAN.md
pip install -e .
python -m pytestpip install -e ".[api]"
uvicorn analytics_foundry.api:app --reloadThe app runs locally. Bronze data is stored in the local file structure so it persists and the Admin UI can reference it via the API.
- Data directory: Set
FOUNDRY_DATA_DIRto a path (e.g.dataor./data). Default isdata(relative to the process cwd). Bronze tables are stored as{FOUNDRY_DATA_DIR}/bronze/{source_id}/{table}.jsonl(JSON Lines). - Default league: Set
FOUNDRY_DEFAULT_LEAGUE_IDto override the default Sleeper league used when API requests omitleague_id. Built-in default:1261894762944802816. - Startup: The API loads existing bronze data from that directory; new ingest appends to the same files. The Admin UI at
/adminreads this data through the API (tables list and sample endpoints).
Frontend: set VITE_API_BASE_URL to this backend’s base URL (CORS enabled).
A minimal admin UI is served at /admin (e.g. http://localhost:8000/admin). It lets you:
- Enter one or more league IDs (default pre-filled), validate, and trigger league or broad NFL ingest; support for syncing multiple leagues at once
- Browse medallion tables (bronze, silver, gold) and view sample rows
- List and view SQL transformation definitions
- See a stub "job runs" list (last syncs; no scheduler yet)
Admin API routes live under /admin/*. The UI is unauthenticated and intended for local/dev use; add auth (e.g. API key or OIDC) before exposing publicly.