How it is built
The pieces
- Collect. A scheduled GitHub Actions job asks ESPN for finished matches, parses the commentary into one row per shot, and writes one small JSON file per match to Amazon S3. It resumes where it stopped and never downloads a finished match twice. Every night it catches up on the last few days for every competition.
- Check. Each match is reconciled against ESPN's own totals. Right now 14,277 of 15,751 stored matches (90.6%) agree exactly; the rest stay flagged and are retried, not hidden.
- Forecast. After the nightly run, a job rebuilds features from past matches only, trains Poisson models, tests them on newer matches, saves the forecasts, and later grades them. See Forecast.
- Publish. The site is static HTML rendered from Jinja2 templates over the stored files, so there is no server or database to run. A finished match shows up without anyone touching anything.
- Live. A separate job refreshes near-live scores every 15 minutes and publishes one tiny file.
Choices worth knowing
- Storage holds parsed results, not raw ESPN responses, which keeps it small and cheap.
- Players are keyed by ESPN athlete id so same-name players never merge.
- Forecasts are saved before matches and graded after, so the scorecard cannot be rewritten with hindsight.
- Fonts, icons and charts are served from the site itself, so a visit makes no third-party requests.
- Everything runs on free tiers plus a few cents of S3 storage.
Code, tests and design notes: GitHub repository. Built by Amir Mirkazemi.