Project case study
GameLens: an NFL model that is graded in public.
Aden Khan · Product and model owner. A full-stack prediction product that explains every pick, saves it before kickoff, freezes it, and scores it against the betting market.
- Stack
- Next.js 16, TypeScript
- Data
- ESPN public feeds
- Storage
- Neon Postgres, Drizzle
- Sample
- 141 games · Weeks 2‑11
The problem
Football prediction content usually falls into two camps: box scores that describe what happened without explaining why, and picks sold with no verifiable track record. Neither lets a reader judge whether a forecast deserves trust.
GameLens is built to answer three questions for every game and player: what does the model expect, why, and how has it done when it was wrong. Every prediction leads with its conclusion, exposes the supporting metrics, and is published next to its result.
My contributions
I built GameLens with v0, Vercel's AI coding assistant, which wrote most of the code. My role was product, model and QA owner:
- Product: defined the features and their order (explainable game and prop breakdowns, the season simulator with shareable scenarios, postmortems, the personal dashboard and the public archive).
- Model: set the methodology rules: efficiency over outcomes, the market as a prior, shrinkage for small samples, separate opening-line and current-line edges, and no prop edge without a stated price basis.
- QA: reviewed the live site page by page and reported concrete inconsistencies, such as one game showing different locked probabilities on different pages, a "frozen" closing line that kept moving, and a rank drop labeled as a rise. Each was traced to a root cause and fixed.
Architecture and data flow
A Next.js App Router app renders server-side from a shared season context, which is rebuilt in the background from ESPN's feeds. Pages, the AI-assisted Search and the consistency checks all read through the same loaders, so a number is computed once and displayed the same way everywhere.
- IngestESPN's public feeds: schedules, scores, play-by-play (GameLens computes its own approximate EPA from down, distance and field position), box scores, rosters, injuries and betting lines.
- RateOpponent-adjusted offensive and defensive EPA per play, blended with point margin and shrunk toward average for small samples.
- PredictRating gap plus home field gives a stats-only margin, blended with the opening line as a prior, then converted to a win probability.
- SaveEach upcoming pick is written to Postgres (Neon) with model version, input cutoff, market snapshot and an update count.
- FreezeAt kickoff the latest pregame save becomes read-only. Every page reads that one record from then on.
- GradeFinal scores are attached to the frozen record and scored on winner, spread, Brier and log loss against the market.
How predictions are generated, saved, frozen and graded
Generated. Before kickoff the model produces a win probability, a model spread and total, and an edge measured against both the opening line and the current line. Only the current-line edge drives recommendations.
Saved. Each refresh before kickoff updates a single row per game. The row keeps when it was first saved, when it was last updated, how many updates there were, the model version, the input cutoff and the market snapshot time. The site labels these rows Latest saved.
Frozen. Writes are refused once a game kicks off, so the last pregame save becomes Locked at kickoff. Rows saved before this metadata existed stay visibly labeled as legacy records.
Graded. Only the frozen record is graded, never a later recomputation. A cross-page audit on the Model page re-reads each record the way every page does and flags any field that disagrees.
How historical evaluation avoids future information
The season backtest rebuilds ratings for each week using only games completed before that week kicked off, then grades that week's picks against the opening line. Week 1 is excluded because no prior data exists.
Two safeguards go beyond that. Market comparisons use the book's reported closing price where available and label the rest as last-listed. And reconstructed results are always kept separate from the timestamped archive, so a reader can tell what the method would have done from what it actually posted in advance.
A difficult problem: one game, two locked predictions
During QA I found the same game showing NO 70% on the homepage and Slate but NO 63% on the game page and archive, with both labeled as locked at kickoff. The spreads disagreed too (−7 versus −4.5).
Root cause: after kickoff, the homepage and Slate kept re-running the model against ESPN's odds, which keep moving during a game. Only the game page read the saved record. A related bug made the "closing line" drift from 47.5 to 48.5 after kickoff, because it was read from the live feed instead of the saved snapshot.
Fix: one loader now returns the saved pregame record for any game that has started, and every surface reads from it. Closing lines come from the last pregame snapshot. An automated consistency audit compares the pages field by field so this kind of drift is caught rather than noticed by chance.
Current results
The reconstructed model picked 65.2% of winners (92 of 141) versus the market's 68.1% (96 of 141) in the reviewed sample. Brier score: model 0.216, market 0.206 (lower is better).
These figures are reconstructed from pre-kickoff data across Weeks 2‑11, not picks posted in advance. They update automatically as games are graded.
No recorded (saved before kickoff) games have been graded yet.
Matching the market is the realistic benchmark: betting lines already reflect a huge amount of information. Closing-line value figures on the site are also reconstructed and labeled that way.
Limitations and lessons
- Small sample. A few weeks of NFL games cannot separate skill from luck. The results above are evidence, not proof.
- Data gaps. Public feeds lack routes, snaps and charted coverage, so scheme and role labels are written as tendencies, and prop edges assume −110 when no price is published.
- Recorded history is short. Picks have only been saved before kickoff since Week 3; earlier weeks are reconstructions.
- Lesson: one source of truth beats careful copying. Every inconsistency I found came from two pages computing the same number separately.
- Lesson: labels are part of the model. Saying which line, window or snapshot a number uses mattered as much as the number itself.
Contact
Aden Khan · Product and model owner
- Email: adendk@gmail.com
- LinkedIn: linkedin.com/in/aden-khan-9b6785318
- Repository: private, available on request.