A comprehensive full-stack NBA game prediction application featuring machine learning-powered playoff predictions, real-time game analysis, and championship probability calculations.
- Conference Seeding: Predicted final standings for Eastern/Western conferences (1-15 rankings)
- Tournament Brackets: Complete playoff bracket generation with play-in tournament support
- Championship Odds: Monte Carlo simulation-based championship probabilities for all 30 teams
- Series Predictions: 7-game playoff series predictions with game-by-game breakdowns
- Tournament Simulation: Full playoff tournament simulation with upset analysis
- Real-time NBA game outcome predictions using advanced ML models
- Team-vs-team matchup analysis with confidence scores
- Historical prediction accuracy tracking
- Batch prediction processing for upcoming games
- AWS S3 integration for prediction storage and chart generation
- PostgreSQL database for team data and prediction metadata
- Interactive charts and visualizations
- Performance analytics and model accuracy metrics
React Frontend (Port 3000) โ Spring Boot Backend (Port 8080) โ Python ML Service (Port 5000)
โ
PostgreSQL Database + AWS S3 Storage
- Frontend: React 18, Chart.js, Axios, Custom Hooks
- Backend: Spring Boot, JPA/Hibernate, PostgreSQL
- ML Service: Python Flask, scikit-learn, XGBoost, NumPy/Pandas
- Storage: AWS S3, PostgreSQL
- DevOps: Docker, Docker Compose
- Docker & Docker Compose
- AWS Account with S3 access
- Node.js 18+, Python 3.8+, Java 21+
git clone <repository-url>
cd first-website
cp .env.example .env # Add your AWS credentials# Start PostgreSQL database
docker-compose up -d
# Start Spring Boot backend
cd backend/NBA-Model && mvn spring-boot:run
# Start Python ML service
cd ml-service && pip install -r requirements.txt && python app.py
# Start React frontend
cd frontend && npm install && npm run dev- Frontend: http://localhost:3000
- Backend API: http://localhost:8080
- ML Service: http://localhost:5000
POST /predict # Single game prediction
POST /batch/generate-predictions # Batch predictions with S3 storage
GET /teams/rankings # Team strength rankingsGET /playoffs/conference-standings # Eastern/Western conference predicted standings
GET /playoffs/bracket # Complete tournament bracket
GET /playoffs/championship-odds # Championship probability calculations
POST /playoffs/series-prediction # Predict 7-game playoff series
POST /playoffs/simulate-tournament # Full tournament simulationGET /api/v1/teams # All NBA teams
GET /api/v1/predictions/history # Prediction history
GET /api/v1/predictions/accuracy # Model accuracy stats// Get Eastern Conference predicted standings
const standings = await predictionService.getEasternConferenceStandings(1000);
// Returns: Teams 1-15 with projected wins/losses and playoff probability// Generate interactive tournament bracket
const bracket = await predictionService.generatePlayoffBracket();
// Returns: Complete bracket with play-in, all rounds, and predicted winners// Calculate championship probabilities (5000 simulations)
const odds = await predictionService.getChampionshipOdds(5000);
// Returns: Championship probability for all 30 teams// Predict Lakers vs Celtics playoff series
const series = await predictionService.predictPlayoffSeries(
1610612747, // Lakers
1610612738, // Celtics
'nba_finals'
);
// Returns: Series winner, game-by-game predictions, series lengthfirst-website/
โโโ frontend/ # React application
โ โโโ src/
โ โ โโโ components/ # React components
โ โ โโโ services/ # API service layer
โ โ โโโ hooks/ # Custom React hooks (usePlayoffs, etc.)
โ โ โโโ styles/ # CSS styling
โโโ backend/NBA-Model/ # Spring Boot application
โ โโโ src/main/java/com/better/nbamodel/
โ โโโ entity/ # JPA entities (Team, Prediction, etc.)
โ โโโ controller/ # REST controllers
โ โโโ service/ # Business logic
โ โโโ repository/ # Data access layer
โโโ ml-service/ # Python ML service
โโโ app.py # Flask application
โโโ services/ # ML prediction services
โโโ playoff_predictor.py # Playoff simulation logic
โโโ championship_calculator.py # Championship odds calculation
โโโ enhanced_prediction_service.py # Core ML models
- User selects teams โ Frontend team selection interface
- Prediction request โ React โ Spring Boot โ Python ML Service
- ML processing โ Playoff simulation, bracket generation, odds calculation
- Storage โ Predictions saved to PostgreSQL, charts stored in S3
- Response โ Real-time prediction results with visualizations
- Simulates remaining regular season games using team strength ratings
- Generates projected win-loss records for all 30 teams
- Calculates playoff probability based on historical performance thresholds
- Separates Eastern and Western conference analysis
- Creates complete playoff bracket structure
- Includes play-in tournament for 7th-10th seeds
- Predicts winners for each round using series simulation
- Supports both Eastern and Western conference brackets
- Monte Carlo simulation with 5000+ tournament runs
- Calculates championship odds for all teams
- Tracks round-by-round advancement probabilities
- Identifies most likely championship scenarios and potential upsets
- Predicts outcome of 7-game playoff series
- Game-by-game breakdown with home court advantage
- Accounts for playoff vs regular season performance differences
- Provides series length prediction and confidence metrics
- Fork the repository
- Create a feature branch (
git checkout -b feature/playoff-enhancement) - Commit changes (
git commit -am 'Add playoff bracket visualization') - Push to branch (
git push origin feature/playoff-enhancement) - Create Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
Built with โค๏ธ for NBA fans and data enthusiasts