A professional web-based application for managing football tournaments, teams, matches, and player statistics with real-time updates and beautiful UI.
- Tournament Management: Create and manage multiple tournaments with different formats (League, Knockout, Group Stage)
- Team Management: Register teams with coaches and track comprehensive statistics
- Match Scheduling: Schedule matches with venues and dates
- Live Standings: Real-time league tables with automatic point calculations
- Player Management: Track individual player statistics including goals, assists, and cards
- Dashboard: Interactive dashboard with key metrics and top performers
- RESTful API: Clean API architecture for all operations
- MongoDB Integration: NoSQL database for flexible data storage
- Responsive Design: Mobile-friendly interface with modern UI/UX
- Real-time Updates: Automatic statistics calculation and updates
- Professional UI: Gradient backgrounds, animations, and Font Awesome icons
- Backend: Java Servlets (Java 20)
- Database: MongoDB 4.11.1
- Frontend: HTML5, CSS3, JavaScript (ES6+)
- Server: Apache Tomcat 9.0
- Build Tool: Manual compilation with javac
- Libraries:
- MongoDB Java Driver (Sync)
- Gson for JSON processing
- Font Awesome for icons
FootballTournament/
βββ src/main/
β βββ java/
β β βββ config/
β β β βββ MongoDBConnection.java
β β βββ dao/
β β β βββ TeamDAO.java
β β β βββ TournamentDAO.java
β β β βββ MatchDAO.java
β β β βββ PlayerDAO.java
β β βββ model/
β β β βββ Team.java
β β β βββ Tournament.java
β β β βββ Match.java
β β β βββ Player.java
β β βββ service/
β β β βββ TournamentService.java
β β βββ FootballTournamentManager.java
β βββ webapp/
β βββ WEB-INF/
β β βββ lib/
β β β βββ mongodb-driver-sync-4.11.1.jar
β β β βββ mongodb-driver-core-4.11.1.jar
β β β βββ bson-4.11.1.jar
β β β βββ gson-2.10.1.jar
β β βββ web.xml
β βββ index.html
β βββ app.js
βββ build/
βββ classes/
βββ FootballTournament.war
- Java JDK 20 or higher
- MongoDB 4.0 or higher (running on localhost:27017)
- Apache Tomcat 9.0
- Modern web browser
-
Clone the repository
git clone https://github.com/abre0101/FootballTournament.git cd FootballTournament -
Download required JAR files Place these files in
src/main/webapp/WEB-INF/lib/: -
Ensure MongoDB is running
# MongoDB should be running on localhost:27017 # Database name: football_tournament
-
Compile the project
javac -cp "src/main/webapp/WEB-INF/lib/*;C:/Program Files/Apache Software Foundation/Tomcat 9.0/lib/servlet-api.jar" -d build/classes src/main/java/config/*.java src/main/java/model/*.java src/main/java/dao/*.java src/main/java/service/*.java src/main/java/*.java
-
Create WAR file
cd build/war jar -cvf ../FootballTournament.war *
-
Deploy to Tomcat
copy build\FootballTournament.war "C:\Program Files\Apache Software Foundation\Tomcat 9.0\webapps\"
-
Start Tomcat
$env:JAVA_HOME="C:\Program Files\Java\jdk-20" $env:CATALINA_HOME="C:\Program Files\Apache Software Foundation\Tomcat 9.0" & "$env:CATALINA_HOME\bin\catalina.bat" start
-
Access the application
http://localhost:8080/FootballTournament/
http://localhost:8080/FootballTournament/api
GET /tournaments- List all tournamentsGET /tournament/{id}- Get tournament by IDPOST /tournament- Create tournament- Parameters:
name,format(LEAGUE/KNOCKOUT/GROUP_STAGE)
- Parameters:
GET /teams- List all teamsGET /team/{id}- Get team by IDPOST /team- Create team- Parameters:
name,coach
- Parameters:
GET /players- List all playersGET /players/team/{teamId}- Get players by teamGET /players/topscorers- Get top 10 scorersPOST /player- Create player- Parameters:
name,jerseyNumber,position,teamId
- Parameters:
GET /matches- List all matchesGET /matches/{tournamentId}- Get matches by tournamentPOST /match- Schedule a match- Parameters:
tournamentId,homeTeamId,awayTeamId,homeTeamName,awayTeamName,venue,matchDate
- Parameters:
POST /match/result- Update match result- Parameters:
matchId,homeScore,awayScore
- Parameters:
GET /standings/{tournamentId}- Get tournament standings
fetch('/FootballTournament/api/tournament', {
method: 'POST',
headers: {'Content-Type': 'application/x-www-form-urlencoded'},
body: 'name=Premier League 2025&format=LEAGUE'
});fetch('/FootballTournament/api/team', {
method: 'POST',
headers: {'Content-Type': 'application/x-www-form-urlencoded'},
body: 'name=Manchester United&coach=Erik ten Hag'
});fetch('/FootballTournament/api/match', {
method: 'POST',
headers: {'Content-Type': 'application/x-www-form-urlencoded'},
body: 'tournamentId=123&homeTeamId=456&awayTeamId=789&homeTeamName=Man+Utd&awayTeamName=Liverpool&venue=Old+Trafford&matchDate=2025-12-15T15:00'
});fetch('/FootballTournament/api/match/result', {
method: 'POST',
headers: {'Content-Type': 'application/x-www-form-urlencoded'},
body: 'matchId=123&homeScore=3&awayScore=1'
});- Real-time statistics display
- Top teams leaderboard
- Quick access to all sections
- Visual metrics with icons
- Multiple tournament formats
- Status tracking (Upcoming, Ongoing, Completed)
- Team registration per tournament
- Comprehensive team statistics
- Win/Draw/Loss records
- Goals scored and conceded
- Goal difference calculation
- Points calculation (3 for win, 1 for draw)
- Automatic sorting by points, goal difference, and goals scored
- Position badges (Gold, Silver, Bronze)
- Complete match statistics
- Visual highlighting for top positions
Edit src/main/java/config/MongoDBConnection.java:
private static final String CONNECTION_STRING = "mongodb://localhost:27017";
private static final String DATABASE_NAME = "football_tournament";Default Tomcat port: 8080
To change, edit Tomcat's server.xml
- tournaments: Tournament information
- teams: Team details and statistics
- matches: Match schedules and results
- players: Player information and statistics
{
"_id": ObjectId("..."),
"name": "Manchester United",
"coach": "Erik ten Hag",
"wins": 15,
"draws": 5,
"losses": 3,
"goalsScored": 45,
"goalsConceded": 20
}- Separation of Concerns: DAO, Service, and Controller layers
- RESTful API Design: Clean, predictable endpoints
- Error Handling: Comprehensive try-catch blocks
- Responsive Design: Mobile-first approach
- Code Reusability: Modular JavaScript functions
- Database Indexing: Efficient MongoDB queries
- Clean Code: Well-commented and organized
- User authentication and authorization
- Match live commentary
- Player transfer system
- Advanced statistics and analytics
- Export data to PDF/Excel
- Email notifications
- Multi-language support
- Mobile app integration
This project is open source and available for educational purposes and will be improved time to time .
Abraham Worku
- GitHub: @abre0101
- Email: [email protected]
Created with β€οΈ for football enthusiasts and tournament organizers at Debre Markos University.
Contributions, issues, and feature requests are welcome! See CONTRIBUTING.md for details.
For support, please open an issue in the repository or contact GitHub: @abre0101
- Email: [email protected]
Made with Java, MongoDB, and passion for football! β½