Skip to content

Latest commit

 

History

History

web

README.md

DiamondAI — web

Live pitch-by-pitch MLB prediction UI. Visual design phase: everything on screen is simulated — no real APIs, no backend, no model calls. A scripted mock game advances one pitch every few seconds so live games feel live.

Run

npm install
npm run dev      # http://localhost:3000
npm run build    # production build (type-checked)

What's here

  • / — tonight's slate: live games (ticking score, inning, model win probability), upcoming games (pregame edge, probables), finals (result + model accuracy).
  • /game/[id] — the game view: scoreboard, Last pitch (what just happened) beside Next pitch (the model's live prediction), win probability chart with scoring-play markers, and a pitch feed comparing every prediction to reality with a running accuracy tally.

Mock data layer

The UI consumes only the types in lib/types.ts through two accessors in lib/mock.ts:

getGames(): Game[]
getGame(id: string): Game | undefined

A real data source (MLB feed + model server) replaces lib/mock.ts without touching any component. Games are generated by a seeded, deterministic simulator (lib/sim.ts) that follows simplified baseball rules — identical output on server and client, so hydration is stable and every reload opens the featured game at the same scripted moment (tie game, top 7).

The "live" ticker (components/useLiveGame.ts) advances a session-wide clock one pitch per ~3.2 s; schedule rows and game pages stay in sync across client-side navigation.

Design system

  • Base: dark slate grey (--color-canvas, --color-surface), hairline borders, Poppins (bold titles / semibold emphasis / regular body).
  • Accents carry meaning: red = live & away, blue = the model & home, white = reality. Missed predictions are muted slate, not red.
  • Tokens live in app/globals.css under @theme.