šŸˆ NFL Bet Slip

A fake-money NFL betting app. Pick sides against the spread, the over/under, and moneylines on real games, and track your bankroll and record over the season. For fun only — no real money.

Try it

Open the app

What it does

  • Pulls the current NFL slate with real lines (spreads, totals, moneylines) from The Odds API.
  • You start with a $1,000 fake bankroll and can place as many bets as your bankroll allows: against the spread, over/under, or moneyline.
  • Bets are auto-settled when games finish — your bankroll and record update automatically (medals: W / L / Push).
  • Moneyline bets pay out at the real American odds you locked in at placement; spreads and totals pay even money. The line you bet is stored on the ticket, so your pricing never moves after you place the bet.
  • A full bet history shows every ticket with its result.

Setup (one step)

The app needs a free The Odds API key (free tier: 500 requests/month, enough for personal use — each page refresh uses a couple of credits):

šŸ‘‰ Add ODDS_API_KEY here: https://www.val.town/x/michaelfreedman/nfl-betting-app/environment-variables?key=ODDS_API_KEY

  1. Grab a free key at https://the-odds-api.com (choose the Free plan).
  2. Add it as the ODDS_API_KEY environment variable using the link above.
  3. Reload the app — the slate and odds will appear.

Note: The Odds API reports the NFL season's current slate (regular season onward). During the offseason there are no games with odds, and the app shows an empty state.

Architecture

Rendering mermaid diagram...
  • index.ts — Hono backend: serves the SPA and the JSON API (/api/games, /api/bets, /api/history, /api/reset).
  • lib/data.ts — The Odds API client: fetches odds (lines) and scores (final results), merges them, maps team names to logos, and settles games.
  • lib/db.ts — SQLite layer: bankroll, bet placement, and bet settlement.
  • frontend/lib/api.ts + frontend/components/ — the React UI.

Data + settlement details

  • spread is stored as the home team's line (negative = home favored). Spread picks settle against the final margin; a tie is a push (stake refunded).
  • overUnder bets push if the total lands exactly on the line.
  • On each load, finished games are settled against the lines stored on your tickets and the bankroll is credited/lossed atomically.
  • Team logos and abbreviations are resolved locally; odds and scores come live from The Odds API.

View source