Yogan Labs
Projects / Yogan Hockey

Free live app

Live

Yogan Hockey. Live NHL scores, with an AI pick for every game.

A family hockey dashboard at hockey.yogan.dev: live scores, standings, teams and players from ESPN, a live stream of each game that turns into a replay when it ends, and a pick for every game made by a model before puck drop.

  • Updated Oct 12, 2026
  • 7 technologies
  • Code only
  • Public repo
Details
The Yogan Hockey home page
hockey.yogan.dev, captured Nov 2026

The problem

Sports apps are slow and full of ads, and a live scoreboard is a hard real-time problem: many viewers, one flaky upstream API, and nothing should poll when nobody is watching.

Who it is for

Anyone building a real-time app on Cloudflare, or a feature where a model makes a structured call that people later check against the result.

What you will learn

  • Run two Agents on Durable Objects: one Scoreboard and one Agent per game, which poll ESPN only while a viewer is connected.
  • Push live state to browsers over the Agents socket, with browsers kept read-only.
  • Cache an unreliable upstream in KV, and forget exactly the right keys when a game goes final.
  • Archive finished games and their plays to D1 with Drizzle, so a live page becomes a replay.
  • Make a model answer in a fixed JSON shape, retry once, fall back to a second model, and cap calls per day in your own code.

The AI parts

  • Workers AI gpt-oss-120b picks each game, with Llama 3.3 70B as the fallback.
  • Every call goes through AI Gateway, which keeps a log of prompts and responses.
  • A JSON schema holds the model to a pick, a win probability, a short reason and key factors.
  • Each pick is graded right or wrong from the final score, and the season record is on the dashboard.
  • Cloudflare Agents SDK
  • TanStack Start
  • Durable Objects
  • Workers AI
  • AI Gateway
  • D1
  • KV

Open these first

  1. 01
    docs/spec.mdThe whole design in one file, ending with what is still unproven.
  2. 02
    apps/web/agents/prediction.tsHow a pick is made: models, retries, the daily cap.
  3. 03
    apps/web/agents/scoreboard-agent.tsThe one Agent that watches the slate and starts each pick.
  4. 04
    apps/web/agents/game-agent.tsOne Agent per game: live plays, then the archive.
  5. 05
    apps/web/agents/viewer-polled-agent.tsPolling that starts with the first viewer and stops with the last.
  6. 06
    packages/espn/src/client.tsThe ESPN client every read goes through.

Run it

Terminal
mise installpnpm installpnpm devpnpm testpnpm typecheck

Honest status

Live

Live at hockey.yogan.dev, where the model's picks stood at 208 right and 163 wrong this season on November 27, 2026. It is a rebuild of an earlier Elixir version, and the last parity items are tracked in the repo. The repo has no license file, so ask before you reuse the code.

Up next