A comprehensive JavaFX-based desktop application for managing multi-sport tournaments, teams, matches, and standings with cloud-based data storage and multi-user authentication.
- Secure user registration and login system
- Password encryption using BCrypt
- Role-based permissions (Admin, Manager, Player)
- Session management with automatic token generation
- User profile management
- Support for multiple sports with different scoring systems:
- GOALS - Football, Hockey
- POINTS - Basketball, Volleyball
- RUNS - Cricket
- SETS - Tennis, Badminton
- Add, edit, and delete sports (Admin only)
- Real-time sport filtering across all modules
- Create and manage teams per sport
- Track team statistics:
- Wins, Draws, Losses
- Goals For/Against
- Goal Difference
- Total Points (3 for win, 1 for draw)
- Assign coaches to teams
- Search and filter teams
- Double-click to edit team details
- Schedule matches with date, time, and location
- Automatic team filtering based on selected sport
- Update match results with score tracking
- Automatic standings calculation upon result entry
- Match status tracking (Scheduled/Completed)
- Prevent scheduling matches in the past
- Search matches by teams or location
- Real-time standings calculation
- Automatic sorting by:
- Points (descending)
- Goal Difference (descending)
- Goals For (descending)
- Visual highlighting for top 3 positions:
- ๐ฅ Gold for 1st place
- ๐ฅ Silver for 2nd place
- ๐ฅ Bronze for 3rd place
- Statistics summary (total teams, matches, goals)
- Create and manage tournaments with:
- Tournament types (League, Knockout, Group + Knockout)
- Start and end dates
- Prize money tracking
- Status management (Upcoming, Ongoing, Completed, Cancelled)
- Winner assignment
- Tournament-specific features:
- Add/remove teams from tournaments
- Share tournaments via unique codes
- Tournament statistics dashboard
- User-specific tournament views (Managers see only their tournaments)
- Team management within tournaments
- Tournament member roles and permissions
- Beautiful gradient-based dark theme
- Neon purple accent colors
- Smooth animations and transitions
- Toast notifications for user feedback:
- โ Success notifications (green)
- โ Error notifications (red)
โ ๏ธ Warning notifications (orange)- โน๏ธ Info notifications (blue)
- Responsive table designs with hover effects
- Card-based layout for better organization
- Supabase PostgreSQL backend
- Connection pooling for optimal performance
- Real-time data synchronization
- Automatic connection status monitoring
- Detailed connection diagnostics
- SQLite fallback for offline mode
- Encrypted password storage
- Session token management
- Permission-based UI element control
- User activity tracking
- Secure credential storage
- Java 25 - Core programming language
- JavaFX 21 - Modern UI framework
- Supabase (PostgreSQL) - Cloud database
- SQLite - Local database fallback
- Maven - Build and dependency management
- JDBC - Database connectivity
- BCrypt - Password hashing
- Gson - JSON processing
- OkHttp - HTTP client for API calls
OOPJ_Mini-Project/
โโโ src/
โ โโโ main/
โ โโโ java/com/sportsmanager/
โ โ โโโ Main.java # Application entry point
โ โ โโโ controller/
โ โ โ โโโ LoginController.java # Login UI controller
โ โ โ โโโ RegistrationController.java # Registration UI controller
โ โ โ โโโ MainController.java # Main application controller
โ โ โโโ dao/
โ โ โ โโโ SupabaseConnection.java # Cloud database connection
โ โ โ โโโ SportDAO.java # Sport data access
โ โ โ โโโ TeamDAO.java # Team data access
โ โ โ โโโ MatchDAO.java # Match data access
โ โ โ โโโ TournamentDAO.java # Tournament data access
โ โ โ โโโ TournamentUserDAO.java # Tournament permissions
โ โ โโโ model/
โ โ โ โโโ User.java # User entity
โ โ โ โโโ Sport.java # Sport entity
โ โ โ โโโ Team.java # Team entity
โ โ โ โโโ Match.java # Match entity
โ โ โ โโโ Tournament.java # Tournament entity
โ โ โ โโโ Player.java # Player entity
โ โ โโโ util/
โ โ โโโ SessionManager.java # Session & permissions
โ โ โโโ NotificationUtil.java # Toast notifications
โ โ โโโ ConfigManager.java # Configuration manager
โ โโโ resources/
โ โโโ fxml/
โ โ โโโ login.fxml # Login screen layout
โ โ โโโ registration.fxml # Registration layout
โ โ โโโ main.fxml # Main UI layout
โ โโโ css/
โ โ โโโ style.css # Dark theme styles
โ โโโ config.properties # Database configuration
โ โโโ application.properties # App settings
โโโ pom.xml # Maven configuration
โโโ sports_manager_local.db # SQLite fallback (auto-created)
โโโ README.md # This file
- Java Development Kit (JDK) 17 or higher
- IntelliJ IDEA (Community or Ultimate Edition)
- Maven (Usually bundled with IntelliJ)
- Supabase Account (for cloud database) - Optional, SQLite fallback available
git clone <your-repository-url>
cd OOPJ_Mini-Project- Create a free account at Supabase
- Create a new project
- Go to Settings โ Database
- Copy your connection details
- Update
src/main/resources/config.properties:
# Supabase Configuration
supabase.url=YOUR_SUPABASE_URL
supabase.anon.key=YOUR_ANON_KEY
# Database Connection
supabase.db.host=YOUR_HOST
supabase.db.port=6543
supabase.db.name=postgres
supabase.db.user=postgres.YOUR_PROJECT_REF
supabase.db.password=YOUR_PASSWORD- Run the SQL schema from Supabase SQL Editor (see Database Schema section)
No configuration needed! The application will automatically use SQLite if Supabase is unavailable.
- Launch IntelliJ IDEA
- Click File โ Open
- Navigate to the project folder and select it
- Click OK
- IntelliJ will detect it as a Maven project and import it automatically
- Go to File โ Project Structure (Ctrl+Alt+Shift+S)
- Under Project Settings โ Project
- Ensure SDK is set to Java 17 or higher
- Set Language level to "17 - Sealed types, always strict floating-point semantics"
- Click OK
- IntelliJ should automatically download dependencies
- If not, open Maven tool window (View โ Tool Windows โ Maven)
- Click the Reload button (circular arrows icon)
- Wait for all dependencies to download
Method 1: Run from Main class
- Navigate to
src/main/java/com/sportsmanager/Main.java - Right-click on the file
- Select Run 'Main.main()'
Method 2: Run Maven JavaFX goal
- Open Maven tool window
- Expand sports-event-manager โ Plugins โ javafx
- Double-click javafx:run
Method 3: Create Run Configuration
- Click Run โ Edit Configurations
- Click + โ Maven
- Name: "Sports Manager"
- Command line:
javafx:run - Click OK and run
mvn clean packageThe JAR will be created in the target/ directory.
Run this SQL in your Supabase SQL Editor:
-- Enable UUID extension
CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
-- Users Table
CREATE TABLE profiles (
id UUID PRIMARY KEY DEFAULT uuid_generate_v4(),
username VARCHAR(50) UNIQUE NOT NULL,
full_name VARCHAR(100) NOT NULL,
email VARCHAR(100) UNIQUE NOT NULL,
role VARCHAR(20) DEFAULT 'player' CHECK (role IN ('admin', 'manager', 'player')),
avatar_url TEXT,
phone VARCHAR(20),
is_active BOOLEAN DEFAULT true,
last_login TIMESTAMP,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
-- User Credentials (Separate for security)
CREATE TABLE user_credentials (
user_id UUID PRIMARY KEY REFERENCES profiles(id) ON DELETE CASCADE,
password_hash TEXT NOT NULL,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
-- Sports Table
CREATE TABLE sports (
id SERIAL PRIMARY KEY,
name VARCHAR(50) UNIQUE NOT NULL,
scoring_type VARCHAR(20) NOT NULL CHECK (scoring_type IN ('GOALS', 'POINTS', 'RUNS', 'SETS')),
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
-- Teams Table
CREATE TABLE teams (
id SERIAL PRIMARY KEY,
name VARCHAR(100) NOT NULL,
coach VARCHAR(100) NOT NULL,
wins INTEGER DEFAULT 0,
losses INTEGER DEFAULT 0,
draws INTEGER DEFAULT 0,
points INTEGER DEFAULT 0,
goals_for INTEGER DEFAULT 0,
goals_against INTEGER DEFAULT 0,
sport_id INTEGER NOT NULL REFERENCES sports(id) ON DELETE CASCADE,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
UNIQUE(name, sport_id)
);
-- Matches Table
CREATE TABLE matches (
id SERIAL PRIMARY KEY,
team1_name VARCHAR(100) NOT NULL,
team2_name VARCHAR(100) NOT NULL,
match_date DATE NOT NULL,
location VARCHAR(200) NOT NULL,
team1_score INTEGER DEFAULT 0,
team2_score INTEGER DEFAULT 0,
status VARCHAR(20) DEFAULT 'Scheduled' CHECK (status IN ('Scheduled', 'Completed')),
sport_id INTEGER NOT NULL REFERENCES sports(id) ON DELETE CASCADE,
tournament_id INTEGER REFERENCES tournaments(id) ON DELETE SET NULL,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
-- Tournaments Table
CREATE TABLE tournaments (
id SERIAL PRIMARY KEY,
name VARCHAR(100) NOT NULL,
sport_id INTEGER NOT NULL REFERENCES sports(id) ON DELETE CASCADE,
tournament_type VARCHAR(20) NOT NULL CHECK (tournament_type IN ('league', 'knockout', 'group_knockout')),
start_date DATE NOT NULL,
end_date DATE,
status VARCHAR(20) DEFAULT 'upcoming' CHECK (status IN ('upcoming', 'ongoing', 'completed', 'cancelled')),
description TEXT,
prize_money DECIMAL(10,2) DEFAULT 0,
winner_team_id INTEGER REFERENCES teams(id) ON DELETE SET NULL,
share_code VARCHAR(20) UNIQUE,
created_by UUID REFERENCES profiles(id) ON DELETE SET NULL,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
-- Tournament Teams (Many-to-Many)
CREATE TABLE tournament_teams (
tournament_id INTEGER REFERENCES tournaments(id) ON DELETE CASCADE,
team_id INTEGER REFERENCES teams(id) ON DELETE CASCADE,
joined_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (tournament_id, team_id)
);
-- Tournament Members (User access to tournaments)
CREATE TABLE tournament_members (
tournament_id INTEGER REFERENCES tournaments(id) ON DELETE CASCADE,
user_id UUID REFERENCES profiles(id) ON DELETE CASCADE,
role VARCHAR(20) DEFAULT 'viewer' CHECK (role IN ('admin', 'manager', 'viewer')),
joined_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (tournament_id, user_id)
);
-- Insert default sports
INSERT INTO sports (name, scoring_type) VALUES
('Football', 'GOALS'),
('Basketball', 'POINTS'),
('Cricket', 'RUNS'),
('Tennis', 'SETS'),
('Hockey', 'GOALS'),
('Volleyball', 'POINTS');- Full system access
- Manage sports (add/edit/delete)
- Manage all teams and matches
- View all tournaments
- Delete any data
- User management
- Create and manage tournaments
- Add/edit teams and matches
- View own tournaments only
- Cannot delete sports
- Limited to assigned sports
- View-only access to data
- Can register and login
- Join tournaments via share codes
- View standings and statistics
- Cannot modify data
-
Register an Account
- Click "Register here" on login screen
- Fill in username (min 3 chars), full name, email
- Set password (min 6 chars)
- Select role (start with "player" or "manager")
- Click "Create Account"
-
Login
- Enter your username and password
- Click "Login"
- You'll be redirected to the main application
- Go to ๐ฏ Sports tab
- Enter sport name (e.g., "Football")
- Select scoring type from dropdown
- Click Add Sport
- Sports appear in the table below
- Double-click a sport to edit
- Select and click Delete to remove
- Go to ๐ฅ Teams tab
- Select a sport from the dropdown at the top
- Enter team name and coach name
- Click Add Team
- Teams appear with stats (0-0-0 initially)
- Use search bar to filter teams
- Go to โฝ Matches tab
- Select a sport from the dropdown
- Select Team 1 and Team 2
- Pick a match date (cannot be in past)
- Enter location
- Click Schedule Match
- Go to โฝ Matches tab
- Select a scheduled match from the table
- Enter scores for both teams
- Click Update Result
- Standings automatically update!
- Go to ๐ Standings tab
- Select a sport from the dropdown
- View real-time standings sorted by points
- Top 3 teams highlighted with colors
- Statistics summary shown at top
- Go to ๐ Tournaments tab
- Click Create Tournament
- Fill in tournament details:
- Name
- Sport
- Type (League/Knockout/Group+Knockout)
- Dates
- Prize money (optional)
- Click Add Tournament
- Use Manage Teams to add teams
- Update status as tournament progresses
- Set winner when completed
- Select a tournament
- Note the Tournament ID shown
- Share this ID with other users
- They can use "Join Tournament" feature
- Enter the share code to participate
# Application Info
app.name=Sports Event Manager Pro
app.version=3.0
app.environment=production
# Supabase Configuration
supabase.url=YOUR_SUPABASE_URL
supabase.anon.key=YOUR_ANON_KEY
# Database Connection
supabase.db.host=YOUR_HOST
supabase.db.port=6543
supabase.db.name=postgres
supabase.db.user=postgres.YOUR_PROJECT_REF
supabase.db.password=YOUR_PASSWORD
# Local SQLite Fallback
local.db.enabled=true
local.db.path=sports_manager_local.db
# Points System
points.win=3
points.draw=1
points.loss=0
# Features Toggle
feature.tournaments.enabled=true
feature.players.enabled=true
feature.notifications.enabled=trueSolution: Ensure JavaFX is properly configured in Maven dependencies. Run:
mvn clean installSolution:
- Check
config.propertieshas correct credentials - Test connection in Supabase SQL Editor
- Verify project is active (not paused)
- Check firewall/VPN settings
- Application will fallback to SQLite automatically
Solution:
- Verify username and password
- Check if user exists in database
- Try registering a new account
- Check database connection status
Solution:
- Verify
style.cssis being loaded - Check console for errors
- Restart the application
- Clear Maven cache:
mvn clean
Solution:
- Check internet connection
- Go to File โ Settings โ Build โ Maven
- Click "Update" or "Reimport"
- Try:
mvn clean install -U
Solution: Adjust session timeout in config.properties:
session.timeout.minutes=30Modern dark-themed login with gradient header and secure authentication
Multi-tab interface with:
- ๐ฏ Sports Management
- ๐ฅ Team Management
- ๐ Live Standings
- โฝ Match Scheduling
- ๐๏ธ Tournament System
Real-time standings with:
- Color-coded top 3 positions
- Automatic sorting by points
- Goal difference tracking
- Statistics summary
- Schedule matches with date/location
- Update results with automatic standings calculation
- Search and filter matches
- Status tracking
- Create and manage tournaments
- Add/remove teams
- Share tournaments via codes
- Track tournament progress
The application uses a dark theme with customizable colors in style.css:
- Primary Color:
#667eea(Purple) - Success Color:
#48bb78(Green) - Danger Color:
#f56565(Red) - Warning Color:
#ed8936(Orange) - Info Color:
#4299e1(Blue)
Modify these in src/main/resources/css/style.css to customize the look.
- โ Password encryption with BCrypt
- โ Session token management
- โ Role-based access control
- โ SQL injection prevention via PreparedStatements
- โ Separate credential storage
- โ Connection pooling for security
- โ Automatic session timeout
- Player statistics tracking
- Match scheduling calendar view
- Export data to PDF/Excel
- Real-time match updates
- Email notifications
- Mobile app version
- Multi-language support
- Advanced analytics dashboard
- Tournament bracket visualization
- Social media integration
This is an educational project for the OOPJ course. Contributions, suggestions, and feedback are welcome!
Educational project for Object-Oriented Programming with Java (OOPJ) course.
Developed as a mini-project for OOPJ course demonstrating:
- Object-Oriented Programming principles
- JavaFX GUI development
- Database integration
- Cloud services integration
- User authentication
- Role-based access control
For issues or questions:
- Check the Troubleshooting section
- Review console logs for error messages
- Verify database configuration
- Check Supabase connection status
Built with โค๏ธ using Java, JavaFX, and Supabase