
Features
- Player Analytics with season & playoff splits, shot-type breakdowns, and performance radar for any NBA player
- Cross-Era Comparisons enabling side-by-side stat comparisons (e.g., Michael Jordan ‘97 vs. Stephen Curry ‘22)
- Team Dashboards with standings, playoff-probability Sankey flows, and auto-refreshing KPI tiles
- AI Explain & Similar Players providing one-click Sonar explanations of stat lines and AI-picked comparable athletes
- Basketball AI Chat allowing users to ask an expert LLM about NBA history, rosters, or projections
- Credit-Based SaaS System with Firebase Auth, Google login, credit wallets, and admin tooling
Prerequisites
- Node.js 16+ and npm
- Python 3.8+ and pip
- Firebase project setup
- Perplexity API key (Sonar Pro)
- Basketball-Reference access
Installation
Configuration
Create.env
file in the backend directory:
Usage
-
Start Backend:
-
Start Frontend:
- Access Application: Open the frontend URL and explore NBA analytics with AI-powered insights
- Use AI Features: Click “AI Explain” on any player or stat to get intelligent analysis powered by Perplexity Sonar
Code Explanation
- Frontend: React with shadcn/ui components and Recharts for data visualization
- Backend: Python Flask API serving Basketball-Reference data and managing Perplexity API calls
- Data Pipeline: BRScraper for real-time data collection with Firebase caching
- AI Integration: Perplexity Sonar Pro for intelligent basketball analysis and explanations
- Authentication: Firebase Auth with Google login and credit-based access control
- Deployment: Frontend on Netlify, backend on Hugging Face Spaces with Docker