A comprehensive Spring Boot application that provides real-time tennis match predictions using AI algorithms. The application analyzes player statistics, head-to-head records, surface performance, and live match data to predict match winners, current game winners, and current set winners.
- Match Winner Prediction: Predicts the overall winner of a tennis match
- Current Game Winner Prediction: Predicts who will win the current game
- Current Set Winner Prediction: Predicts who will win the current set
- Player Statistics: Comprehensive player profiles including rankings, surface performance, and recent form
- Head-to-Head Records: Historical match data between players
- Live Match Data: Real-time statistics and score tracking
- Surface Analysis: Performance analysis on different court surfaces (Hard, Clay, Grass)
- RESTful API: Complete API for all prediction and data operations
- Real-time Updates: Auto-refreshing dashboard with live match data
- Modern UI: Beautiful, responsive web interface
- H2 Database: In-memory database with sample data
- Prediction Accuracy Tracking: Monitor prediction success rates
- Backend: Spring Boot 3.2.0
- Database: H2 (In-memory)
- Frontend: Thymeleaf, Bootstrap 5, JavaScript
- Build Tool: Maven
- Java Version: 17
- Java 17 or higher
- Maven 3.6 or higher
- Modern web browser
cd tennis-prediction-app
mvn clean install
mvn spring-boot:run
Open your browser and navigate to:
- Main Dashboard: http://localhost:8080/tennis-prediction/
- H2 Database Console: http://localhost:8080/tennis-prediction/h2-console
- JDBC URL:
jdbc:h2:mem:tennisdb
- Username:
sa
- Password:
password
- JDBC URL:
The application comes pre-loaded with:
- Novak Djokovic (Serbia)
- Carlos Alcaraz (Spain)
- Daniil Medvedev (Russia)
- Jannik Sinner (Italy)
- Andrey Rublev (Russia)
- Stefanos Tsitsipas (Greece)
- Alexander Zverev (Germany)
- Holger Rune (Denmark)
- Hubert Hurkacz (Poland)
- Taylor Fritz (USA)
- Live matches with real-time statistics
- Completed matches with full results
- Scheduled matches for future predictions
- Historical match data between all players
- Surface-specific performance records
- Recent match outcomes
POST /api/predictions/match-winner/{matchId}
- Predict match winnerPOST /api/predictions/game-winner/{matchId}
- Predict current game winnerPOST /api/predictions/set-winner/{matchId}
- Predict current set winnerGET /api/predictions/match/{matchId}
- Get all predictions for a matchGET /api/predictions/latest/{matchId}/{predictionType}
- Get latest predictionGET /api/predictions/accuracy
- Get prediction accuracy statistics
GET /api/matches
- Get all matchesGET /api/matches/live
- Get live matchesGET /api/matches/{matchId}
- Get match by IDGET /api/matches/tournament/{tournamentName}
- Get matches by tournamentGET /api/matches/surface/{surface}
- Get matches by surfacePOST /api/matches
- Create new matchPUT /api/matches/{matchId}
- Update match
GET /api/players
- Get all playersGET /api/players/{playerId}
- Get player by IDGET /api/players/name/{playerName}
- Get player by nameGET /api/players/top
- Get top ranked playersGET /api/players/country/{country}
- Get players by countryGET /api/players/surface/{surface}
- Get players by surface performanceGET /api/players/search/{namePattern}
- Search players by namePOST /api/players
- Create new playerPUT /api/players/{playerId}
- Update player
GET /api/head-to-head/{player1Id}/{player2Id}
- Get head-to-head recordGET /api/head-to-head/player/{playerId}
- Get player's head-to-head records
GET /api/statistics
- Get application statistics
The prediction system uses a weighted algorithm that considers:
- Player Rankings (15%): Current ATP rankings
- Head-to-Head Records (20%): Historical performance against opponent
- Surface Performance (15%): Win rates on specific surfaces
- Recent Form (15%): Recent match performance
- Live Statistics (25%): Current match statistics
- Match Momentum (10%): Current match flow and score
- Match Winner: Overall match outcome prediction
- Game Winner: Current game prediction (focuses on serving and immediate momentum)
- Set Winner: Current set prediction (considers set score and match momentum)
- Real-time Statistics: Live match count, prediction accuracy, player rankings
- Live Matches: Current matches with real-time scores and statistics
- Top Players: Ranked list of top players with performance metrics
- Recent Predictions: Latest predictions with confidence scores and reasoning
- Auto-refresh: Dashboard updates every 30 seconds
- Prediction Buttons: One-click predictions for match, game, and set winners
- Confidence Indicators: Visual confidence levels for predictions
- Detailed Reasoning: Explanation of prediction factors
- Responsive Design: Works on desktop, tablet, and mobile devices
- Player: Comprehensive player profiles with statistics
- Match: Live match data and scores
- HeadToHead: Historical match records between players
- MatchPrediction: Prediction results with confidence scores
- Players have multiple matches (as player1 or player2)
- Matches have multiple predictions (different types)
- Players have head-to-head records with other players
# Run with Maven mvn spring-boot:run # Or build and run JAR mvn clean package java -jar target/tennis-prediction-app-1.0.0.jar
- Build the application:
mvn clean package
- Deploy the JAR file to your server
- Configure database connection (switch from H2 to production database)
- Set up external API keys for live data feeds
# Server Configuration server.port=8080 server.servlet.context-path=/tennis-prediction # Database Configuration spring.datasource.url=jdbc:h2:mem:tennisdb spring.datasource.username=sa spring.datasource.password=password # Prediction Settings tennis.prediction.model.threshold=0.6 tennis.prediction.update-interval=30000
- Machine Learning Integration: Advanced ML models for better predictions
- External API Integration: Real-time data from FlashScore, ATP, etc.
- User Authentication: User accounts and personalized predictions
- Mobile App: Native mobile application
- Advanced Analytics: Detailed statistical analysis and visualizations
- Tournament Brackets: Tournament prediction and bracket management
- Microservices Architecture: Split into separate services
- Real-time WebSocket: Live updates via WebSocket
- Caching Layer: Redis for improved performance
- Containerization: Docker support for easy deployment
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests for new functionality
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
For support and questions:
- Create an issue in the repository
- Check the API documentation
- Review the sample data and configurations
- Start the application
- Navigate to http://localhost:8080/tennis-prediction/
- View the live matches
- Click "Predict Winner" on any live match
- See the prediction with confidence score and reasoning
The application is ready to use immediately with sample data and working predictions!