A Next.js application for fetching, storing, and analyzing NBA box score data. This project provides a comprehensive pipeline for collecting game schedules and box scores, storing them in a DuckDB database, and presenting the data through a web interface.
This application allows you to:
- Fetch NBA game schedules and box scores
- Store game data in a DuckDB database
- Generate and maintain data schemas
- Query and analyze game statistics
- View data through a web interface
The data pipeline consists of several steps that must be executed in order:
- Fetch Game Schedule
npm run fetch-schedule
- Load Schedule into Database
npm run load-schedule
- Fetch Box Scores
npm run fetch-box-scores
- Load Box Scores into Database
npm run load-box-scores
- Generate Schemas (Optional)
npm run generate-schemas
Only needed when there are changes to the underlying data schema.
The application consists of two main pages:
The home page displays a chronological list of NBA games with their scores and status. It:
- Fetches both schedule and box score data in parallel
- Groups games by date for easy navigation
- Shows game status, period information, and scores
- Provides links to detailed box scores for each game
This dynamic route shows detailed statistics for a specific game. Features include:
- Complete box score with player statistics
- Team totals and shooting percentages
- Player performance metrics (points, rebounds, assists, etc.)
- Starter vs bench player differentiation
- Period-by-period scoring breakdown
First, run the development server:
npm run dev
Open http://localhost:3000 with your browser to see the result.
You can start editing the page by modifying app/page.tsx
. The page auto-updates as you edit the file.
This project uses next/font
to automatically optimize and load Geist, a custom font for Vercel.