How usrr961/statbotics works
Statbotics computes historical and realtime FRC Expected Points Added (EPA), then exposes those results through a website, REST endpoints, and a Python API. The main workflow is TBA data ingestion, per-year processing and EPA calculation, publication as Parquet/site data to Google Cloud Storage, DuckDB-backed querying, and presentation in the website. The README documents these broad capabilities; source excerpts and the SOURCE INDEX support selected implementation links. Some frontend-to-service and ingestion details are therefore shown only where documented, not inferred from names.
Main entry points: data/main.py Year data pipeline · main.tsx FRC analytics pages · db_duckdb/main.py DuckDB query layer · backend/main.py REST and site API
Components 21
Ingestion and ratings
- Year data pipeline
backend/src/data/main.py - TBA ingestion
backend/src/data/tba.py - EPA processing
backend/src/data/epa/main.py - EPA rating model
backend/src/models/epa/main.py - Realtime updates
backend/src/data/trailing.py
Storage and APIs
- Parquet artifacts
backend/src/google/parquet.py - Artifact publishing
backend/src/google/publish.py - Google Cloud Storage
backend/src/google/storage.py - DuckDB query layer
backend/src/db_duckdb/main.py - Entity models
backend/src/db/models/main.py - REST and site API
backend/main.py - Entity query handlers
backend/src/api/query.py
Website experience
- Frontend data access
frontend/src/api/storage.tsx - FRC analytics pages
frontend/src/pagesContent/team/main.tsx - Tables and visualizations
frontend/src/components/MatchTable.tsx - Event simulation
frontend/src/pagesContent/event/[event_id]/worker.ts
Model experimentation
- Model runner
models/runner.py - EPA model package
models/epa_model.py - Wins model
models/wins_model.py
Other components
- The Blue Alliance
- API and Python users
Connections 19
- The Blue Alliance → TBA ingestion: provides data
- Year data pipeline → TBA ingestion: runs ingestion
backend/src/data/main.py - Year data pipeline → EPA processing: processes years
backend/src/data/main.py - EPA processing → EPA rating model: calculates ratings
- Year data pipeline → Realtime updates: updates realtime
backend/main.py - Year data pipeline → Parquet artifacts: creates artifacts
backend/src/data/main.py - Parquet artifacts → Artifact publishing: publishes data
backend/src/google/parquet.py - Artifact publishing → Google Cloud Storage: writes blobs
backend/src/google/storage.py - Google Cloud Storage → DuckDB query layer: downloads artifacts
backend/src/db_duckdb/main.py - DuckDB query layer → Entity models: maps query rows
backend/src/db_duckdb/main.py - REST and site API → Entity query handlers: routes requests
backend/main.py - Entity query handlers → DuckDB query layer: queries entities
- API and Python users → REST and site API: requests statistics
- Frontend data access → REST and site API: fetches data
- FRC analytics pages → Frontend data access: loads team data
frontend/src/pagesContent/team/main.tsx - FRC analytics pages → Tables and visualizations: renders analytics
- FRC analytics pages → Event simulation: offers event simulation
- Model runner → EPA model package: runs model
models/runner.py - Model runner → Wins model: runs model
models/runner.py