How andyscanzio/nl-predict works
NL Predict is a browser-based Swiss National League standings projector. The workflow starts with a committed SIHF snapshot, derives current standings and form, applies a selectable model to remaining games, and simulates the season to estimate ranks and playoff-zone chances. The page presents current and projected tables, upcoming games, what-if outcomes, and projection-history charts. README documents snapshot ingestion and precomputed history; unsampled implementation details and their wiring are not inferred here.
Main entry points: App.tsx Page orchestration · projectionModels.ts Model registry · project.ts Projection and tables · ProjectedTable.tsx Projected table
Components 27
Snapshot data
- Snapshot builder
src/snapshot/buildSnapshot.ts - SIHF response parser
src/snapshot/sihfResponse.ts - Season snapshot
data/games.json - History precompute
scripts/projectionHistoryPlugin.ts - History cache
scripts/historyCache.ts
Projection models
- Elo model
src/domain/eloModel.ts - Season rate model
src/domain/seasonRate.ts - Matchup model
src/domain/matchupModel.ts - Split form rate
src/domain/splitFormRate.ts - Model registry
src/domain/projectionModels.ts
Projection engine
- Game form
src/domain/form.ts - Outcome probabilities
src/domain/outcomes.ts - Projection and tables
src/domain/project.ts - Season simulation
src/domain/seasonSimulation.ts - Cut lines
src/domain/cutLines.ts - Projection history
src/domain/projectionHistory.ts
Browser experience
- Page orchestration
src/ui/App.tsx - Browser entry
src/ui/main.tsx - Current table
src/ui/CurrentTable.tsx - Projected table
src/ui/ProjectedTable.tsx - Upcoming games
src/ui/UpcomingGames.tsx - Team detail
src/ui/TeamDetail.tsx - History charts
src/ui/projectionChart.ts - Model explanation
src/ui/ModelExplanation.tsx - Team names
src/ui/TeamName.tsx
Other components
- Visitor
- SIHF API
Connections 34
- SIHF API → Snapshot builder: provides results
README.md - Snapshot builder → SIHF response parser: parses response
src/snapshot/buildSnapshot.ts - Snapshot builder → Season snapshot: writes snapshot
README.md - Season snapshot → Browser entry: loads data
README.md - Browser entry → Page orchestration: renders
src/ui/main.tsx - Visitor → Page orchestration: uses page
- Page orchestration → Projection and tables: projects season
src/ui/App.tsx - Page orchestration → Current table: renders
src/ui/App.tsx - Page orchestration → Model explanation: renders
src/ui/App.tsx - Page orchestration → Projected table: renders
src/ui/App.tsx - Page orchestration → Upcoming games: renders
src/ui/App.tsx - Model registry → Elo model: registers
src/domain/projectionModels.ts - Model registry → Season rate model: registers
src/domain/projectionModels.ts - Model registry → Matchup model: registers
src/domain/projectionModels.ts - Model registry → Split form rate: registers
src/domain/projectionModels.ts - Projection and tables → Model registry: selects model
src/domain/projectionModels.ts - Elo model → Game form: scores games
src/domain/eloModel.ts - Elo model → Outcome probabilities: computes probabilities
src/domain/eloModel.ts - Matchup model → Game form: uses venue form
src/domain/matchupModel.ts - Matchup model → Outcome probabilities: computes probabilities
src/domain/matchupModel.ts - Season rate model → Outcome probabilities: computes probabilities
src/domain/seasonRate.ts - Projection and tables → Game form: derives form
src/domain/project.ts - Projection and tables → Season simulation: simulates standings
src/domain/project.ts - Season simulation → Cut lines: assigns zones
src/domain/seasonSimulation.ts - Projection history → Projection and tables: replays projection
src/domain/projectionHistory.ts - History precompute → Projection history: precomputes history
scripts/projectionHistoryPlugin.ts - History precompute → History cache: caches results
README.md - Projected table → Team detail: renders details
src/ui/ProjectedTable.tsx - Team detail → History charts: builds charts
src/ui/TeamDetail.tsx - Projected table → Projection history: reads history
src/ui/ProjectedTable.tsx - Team detail → Projection history: reads history
src/ui/TeamDetail.tsx - Current table → Team names: renders names
src/ui/CurrentTable.tsx - Projected table → Team names: renders names
src/ui/ProjectedTable.tsx - Upcoming games → Outcome probabilities: shows probabilities
src/ui/UpcomingGames.tsx