NBA IQ is an NBA analytics and machine learning platform built with React, TypeScript, Flask, and Supabase.
- Match prediction with backend ML inference
- MVP analysis and team comparison views
- Authenticated user flow with Supabase
- Responsive frontend built with Tailwind CSS
- React 19 + TypeScript
- Vite
- Tailwind CSS
- Axios
- Flask
- scikit-learn, XGBoost, pandas, numpy
- Supabase + Flask-CORS
- Node.js 18+
- npm
- Python 3.8+
- pip
- Supabase project credentials
git clone https://github.com/albrthuynh/NBAIQ.git
cd NBAIQCreate .env.local in the project root:
SUPABASE_URL=your_supabase_project_url
SUPABASE_ANON_KEY=your_supabase_anon_key
SUPABASE_SERVICE_ROLE=your_supabase_service_role_keycd backend
pip install -r requirements.txtcd frontend
npm installcd backend
python app.pyBackend runs at http://localhost:5000.
cd frontend
npm run devFrontend runs at http://localhost:5173 (or http://localhost:5174 if occupied).
Request body:
{
"home_team": "Chicago Bulls",
"home_season": 2025,
"away_team": "Indiana Pacers",
"away_season": 2025
}Response body:
{
"home_team": "Chicago Bulls",
"home_season": 2025,
"away_team": "Indiana Pacers",
"away_season": 2025,
"predicted_winner": "Chicago Bulls",
"home_win_probability": 0.7,
"away_win_probability": 0.3,
"model": "RandomForestClassifier"
}cd backend
python -m pytest test_api.pyIf pytest is missing in your environment:
pip install pytest- Backend CORS currently allows
http://localhost:5173andhttp://localhost:5174. - Update allowed origins in
backend/app.pyif your frontend runs on a different port.