A fast, keyboard-driven basketball stat tracker for live games.
# Run the app (uv will auto-install dependencies)
./app.py
# Open browser to http://localhost:5000
Create a new game by entering the game name and player names
Live stat tracking with keyboard shortcuts, undo history, and comments
- Enter a game name (e.g., "Lakers vs Warriors")
- Add player names (space or comma separated)
- Click "Track New Game"
Player Selection:
- Type first letter of player name to select
↑/↓- Navigate between playersEnter- Edit selected player's stats manually
Recording Stats:
2- 2-point field goal3- 3-point field goalm- Missa- Assistt- Turnovers- Stealr- Reboundf- Free throw makeF- Free throw miss
Navigation:
[/]- Previous/next quarter (Q1-4, OT1-3)←/→- Decrement/increment hovered statEsc- Clear selection
Quick Entry:
- Hover over any stat cell
- Click to increment
- Or use keyboard shortcuts for selected player
- Tap player name to select
- Tap stat cells to increment values
- Tap quarter button to advance quarters
- Tap game name to edit
- Tap "+ Player" to add new players mid-game
Undo
- Every stat change is tracked in history
- Click "Undo" to reverse the last change
- View recent 5 changes, expand for older history
- Undo updates both UI and database
Comments
- Add game notes below the stats table
- Press Enter or blur to save comment
- Click any comment to edit
- Clear comment to delete
- Comments saved to database
Live Stats
- Real-time score and FG% calculation
- Automatic totals row
- Per-quarter tracking
- Sticky headers for scrolling
Minimal Mode
- Click "Minimal Mode" button to toggle clean display
- Hides UI elements: comments, history, controls, edit buttons, back button
- Shows only the stats table for focused tracking or screen sharing
- Perfect for presenting on secondary displays or during broadcasts
- Preference saved in browser localStorage
Runtime:
- Python 3.11+
- uv - Fast Python package manager
Backend:
- Flask - Web framework
- Peewee - Lightweight ORM
- SQLite - Database
Frontend:
- Vanilla JavaScript (no frameworks)
- HTMX - For error handling
- Server-side rendering with Jinja2
Dependencies (auto-installed by uv):
flask
peewee- Games - name, external_id (10-char public ID)
- Players - name, linked to game
- Stats - per-player stats (FG, FT, assists, etc.)
- Comments - game notes with timestamps
The app uses uv's inline script dependencies - no separate requirements.txt needed. Just run ./app.py and uv handles everything.
Data is stored in hoopsheet.db (SQLite) in the project directory.
MIT
This app was mostly vibe-coded with Claude Sonnet 4.5 - both the UI and backend.