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.
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
ODDS_API_KEY environment variable using the link above.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.
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.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.