A modern web application for visualizing NBA player shot charts with a React frontend and Python Flask backend.
- Frontend: React 18 with TypeScript, Vite, D3.js, Tailwind CSS
- Backend: Python Flask with nba_api library
- Development: Docker Compose for local development
- Clone the repository
- Run with Docker Compose:
docker-compose up --build
- Open http://localhost:3000
- Docker and Docker Compose
- Node.js 18+ (for local frontend development)
- Python 3.9+ (for local backend development)
# Start all services
docker-compose up
# Frontend only (requires backend running)
cd frontend
npm run dev
# Backend only
cd backend
python -m flask run --debugnba-shotchart-app/
├── frontend/ # React TypeScript frontend
│ ├── src/
│ │ ├── components/ # React components
│ │ ├── services/ # API services
│ │ ├── types/ # TypeScript interfaces
│ │ └── utils/ # Utility functions
│ ├── public/ # Static assets
│ └── package.json
├── backend/ # Python Flask backend
│ ├── app/
│ │ ├── services/ # Business logic
│ │ ├── models/ # Data models
│ │ ├── routes/ # API endpoints
│ │ └── utils/ # Utility functions
│ ├── requirements.txt
│ └── app.py
├── docker-compose.yml # Development environment
└── README.md
- Interactive shot chart visualization
- Real-time player search with typeahead
- Shot filtering by type, period, and season
- Responsive design for mobile devices
- Comprehensive error handling
- Performance optimized with caching
GET /api/health- Health checkGET /api/test- Simple test endpointGET /api/players/search?q={query}- Search playersGET /api/players/{id}- Get player detailsGET /api/players/{id}/shots- Get shot chart dataGET /api/seasons- Get available seasons
If you encounter issues:
-
Check if services are running:
curl http://localhost:5000/api/health
-
View logs:
docker-compose logs backend docker-compose logs frontend
-
Test API directly:
python test_api.py
-
Complete reset:
docker-compose down -v docker-compose up --build
See TROUBLESHOOTING.md for detailed debugging steps.