Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

7 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Sports Event Manager Pro ๐Ÿ†

A comprehensive JavaFX-based desktop application for managing multi-sport tournaments, teams, matches, and standings with cloud-based data storage and multi-user authentication.

โœจ Features

๐Ÿ” User Authentication & Role-Based Access Control

  • 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

๐ŸŽฏ Multi-Sport 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

๐Ÿ‘ฅ Team Management

  • 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

โšฝ Match Scheduling & Results

  • 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

๐Ÿ† Live Standings

  • Real-time standings calculation
  • Automatic sorting by:
    1. Points (descending)
    2. Goal Difference (descending)
    3. 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)

๐ŸŸ๏ธ Tournament System

  • 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

๐ŸŽจ Modern Dark UI Theme

  • 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

โ˜๏ธ Cloud Database Integration

  • Supabase PostgreSQL backend
  • Connection pooling for optimal performance
  • Real-time data synchronization
  • Automatic connection status monitoring
  • Detailed connection diagnostics
  • SQLite fallback for offline mode

๐Ÿ”’ Security Features

  • Encrypted password storage
  • Session token management
  • Permission-based UI element control
  • User activity tracking
  • Secure credential storage

๐Ÿ› ๏ธ Technology Stack

  • 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

๐Ÿ“ Project Structure

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

๐Ÿš€ Prerequisites

  • 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

โš™๏ธ Setup Instructions

1. Clone the Repository

git clone <your-repository-url>
cd OOPJ_Mini-Project

2. Configure Database Connection

Option A: Using Supabase (Recommended)

  1. Create a free account at Supabase
  2. Create a new project
  3. Go to Settings โ†’ Database
  4. Copy your connection details
  5. 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
  1. Run the SQL schema from Supabase SQL Editor (see Database Schema section)

Option B: Using SQLite (Local Only)

No configuration needed! The application will automatically use SQLite if Supabase is unavailable.

3. Open Project in IntelliJ IDEA

  1. Launch IntelliJ IDEA
  2. Click File โ†’ Open
  3. Navigate to the project folder and select it
  4. Click OK
  5. IntelliJ will detect it as a Maven project and import it automatically

4. Verify Project SDK

  1. Go to File โ†’ Project Structure (Ctrl+Alt+Shift+S)
  2. Under Project Settings โ†’ Project
  3. Ensure SDK is set to Java 17 or higher
  4. Set Language level to "17 - Sealed types, always strict floating-point semantics"
  5. Click OK

5. Download Dependencies

  1. IntelliJ should automatically download dependencies
  2. If not, open Maven tool window (View โ†’ Tool Windows โ†’ Maven)
  3. Click the Reload button (circular arrows icon)
  4. Wait for all dependencies to download

6. Run the Application

Method 1: Run from Main class

  1. Navigate to src/main/java/com/sportsmanager/Main.java
  2. Right-click on the file
  3. Select Run 'Main.main()'

Method 2: Run Maven JavaFX goal

  1. Open Maven tool window
  2. Expand sports-event-manager โ†’ Plugins โ†’ javafx
  3. Double-click javafx:run

Method 3: Create Run Configuration

  1. Click Run โ†’ Edit Configurations
  2. Click + โ†’ Maven
  3. Name: "Sports Manager"
  4. Command line: javafx:run
  5. Click OK and run

7. Build Executable JAR (Optional)

mvn clean package

The JAR will be created in the target/ directory.

๐Ÿ“Š Database Schema

Supabase PostgreSQL Schema

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');

๐Ÿ‘ค User Roles & Permissions

Admin ๐Ÿ‘‘

  • Full system access
  • Manage sports (add/edit/delete)
  • Manage all teams and matches
  • View all tournaments
  • Delete any data
  • User management

Manager ๐Ÿ“‹

  • Create and manage tournaments
  • Add/edit teams and matches
  • View own tournaments only
  • Cannot delete sports
  • Limited to assigned sports

Player โšฝ

  • View-only access to data
  • Can register and login
  • Join tournaments via share codes
  • View standings and statistics
  • Cannot modify data

๐ŸŽฎ How to Use

First Time Setup

  1. 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"
  2. Login

    • Enter your username and password
    • Click "Login"
    • You'll be redirected to the main application

Managing Sports (Admin Only)

  1. Go to ๐ŸŽฏ Sports tab
  2. Enter sport name (e.g., "Football")
  3. Select scoring type from dropdown
  4. Click Add Sport
  5. Sports appear in the table below
  6. Double-click a sport to edit
  7. Select and click Delete to remove

Adding Teams

  1. Go to ๐Ÿ‘ฅ Teams tab
  2. Select a sport from the dropdown at the top
  3. Enter team name and coach name
  4. Click Add Team
  5. Teams appear with stats (0-0-0 initially)
  6. Use search bar to filter teams

Scheduling Matches

  1. Go to โšฝ Matches tab
  2. Select a sport from the dropdown
  3. Select Team 1 and Team 2
  4. Pick a match date (cannot be in past)
  5. Enter location
  6. Click Schedule Match

Updating Match Results

  1. Go to โšฝ Matches tab
  2. Select a scheduled match from the table
  3. Enter scores for both teams
  4. Click Update Result
  5. Standings automatically update!

Viewing Standings

  1. Go to ๐Ÿ† Standings tab
  2. Select a sport from the dropdown
  3. View real-time standings sorted by points
  4. Top 3 teams highlighted with colors
  5. Statistics summary shown at top

Managing Tournaments

  1. Go to ๐Ÿ† Tournaments tab
  2. Click Create Tournament
  3. Fill in tournament details:
    • Name
    • Sport
    • Type (League/Knockout/Group+Knockout)
    • Dates
    • Prize money (optional)
  4. Click Add Tournament
  5. Use Manage Teams to add teams
  6. Update status as tournament progresses
  7. Set winner when completed

Sharing Tournaments

  1. Select a tournament
  2. Note the Tournament ID shown
  3. Share this ID with other users
  4. They can use "Join Tournament" feature
  5. Enter the share code to participate

๐Ÿ”ง Configuration

config.properties

# 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=true

๐Ÿ› Troubleshooting

Issue: "JavaFX runtime components are missing"

Solution: Ensure JavaFX is properly configured in Maven dependencies. Run:

mvn clean install

Issue: Cannot connect to Supabase

Solution:

  1. Check config.properties has correct credentials
  2. Test connection in Supabase SQL Editor
  3. Verify project is active (not paused)
  4. Check firewall/VPN settings
  5. Application will fallback to SQLite automatically

Issue: Login fails with "Invalid credentials"

Solution:

  1. Verify username and password
  2. Check if user exists in database
  3. Try registering a new account
  4. Check database connection status

Issue: UI not displaying correctly

Solution:

  1. Verify style.css is being loaded
  2. Check console for errors
  3. Restart the application
  4. Clear Maven cache: mvn clean

Issue: Maven dependencies not downloading

Solution:

  1. Check internet connection
  2. Go to File โ†’ Settings โ†’ Build โ†’ Maven
  3. Click "Update" or "Reimport"
  4. Try: mvn clean install -U

Issue: Session expires too quickly

Solution: Adjust session timeout in config.properties:

session.timeout.minutes=30

๐Ÿ“ฑ Key Application Screens

Login Screen

Modern dark-themed login with gradient header and secure authentication

Main Dashboard

Multi-tab interface with:

  • ๐ŸŽฏ Sports Management
  • ๐Ÿ‘ฅ Team Management
  • ๐Ÿ† Live Standings
  • โšฝ Match Scheduling
  • ๐ŸŸ๏ธ Tournament System

Live Standings

Real-time standings with:

  • Color-coded top 3 positions
  • Automatic sorting by points
  • Goal difference tracking
  • Statistics summary

Match Management

  • Schedule matches with date/location
  • Update results with automatic standings calculation
  • Search and filter matches
  • Status tracking

Tournament System

  • Create and manage tournaments
  • Add/remove teams
  • Share tournaments via codes
  • Track tournament progress

๐ŸŽจ Theme Customization

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.

๐Ÿ”’ Security Features

  • โœ… 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

๐Ÿ“ˆ Future Enhancements

  • 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

๐Ÿค Contributing

This is an educational project for the OOPJ course. Contributions, suggestions, and feedback are welcome!

๐Ÿ“„ License

Educational project for Object-Oriented Programming with Java (OOPJ) course.

๐Ÿ‘จโ€๐Ÿ’ป Development Team

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

๐Ÿ“ž Support

For issues or questions:

  1. Check the Troubleshooting section
  2. Review console logs for error messages
  3. Verify database configuration
  4. Check Supabase connection status

Built with โค๏ธ using Java, JavaFX, and Supabase

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages