Version 2.0 - OOP Inheritance Authentication
This project is a comprehensive Event Management System developed in Java with a focus on Object-Oriented Programming inheritance and role-based authentication. The system serves as a secure platform for administrators to manage events and users to register for them.
Key Features:
- OOP Inheritance Authentication - All services inherit authentication capabilities from a base
AuthServiceclass - Role-based Access Control - Admin and User roles with different privileges
- Token-based Event Creation - Secure token system for event management
- Password Management - Secure hashing, password changes, and reset functionality
- Session Management - Comprehensive login/logout system
- GUI Interface - Java Swing-based graphical user interface with login and signup forms
- Clean Build System - Separate compilation with automated build scripts
This system demonstrates advanced OOP concepts and secure authentication patterns.
The system uses pure inheritance for authentication, eliminating separate authentication service classes:
AuthService- Abstract base class providing authentication capabilitiesAdminService- Extends AuthService for admin operations (token generation)EventService- Extends AuthService for event managementRegistrationService- Extends AuthService for user registrationsUserService- Provides authentication without inheritance (prevents circular dependency)
- Secure Password Hashing - SHA-256 with salt
- Session Management - Login/logout with session tracking
- Role-based Authorization - Admin vs User privileges
- Token-based Operations - Secure event creation tokens
- Password Recovery - Reset tokens and secure password changes
This project follows a collaborative Git workflow to ensure code quality and team synchronization.
- Main Branch: The
mainbranch is the stable, definitive version of the project. Direct pushes tomainare not allowed. - Development Branch: A
devbranch is used as the primary integration branch for new features. - Feature Branches: All new work (features, bug fixes) must be done on a separate feature branch (e.g.,
feature/user-login,fix/registration-bug). - Pull Requests (PRs): When a feature is complete, the developer opens a Pull Request to merge their feature branch into the
devbranch. - Code Review: At least one other team member must review the Pull Request to check for bugs, style, and correctness before it can be merged. This maintains high code quality.
The project follows a clean architecture with separate source and build directories.
Event-ms/
├── .gitignore
├── LICENSE
├── README.md
├── build.ps1 <-- PowerShell build script
├── run.ps1 <-- PowerShell run script
├── build/ <-- Compiled classes (auto-generated)
│ └── classes/
│ └── com/eventms/
│ ├── Launcher.class
│ ├── model/ <-- All model .class files
│ └── service/ <-- All service .class files
└── src/ <-- Source code
├── database/
│ └── eventms_db.sql
└── main/java/
└── com/eventms/
├── Launcher.java
├── model/
│ ├── Admin.java
│ ├── Event.java
│ ├── EventStatus.java
│ ├── EventToken.java
│ ├── Registration.java
│ ├── RegistrationStatus.java
│ ├── Role.java
│ └── User.java
└── service/
├── AuthService.java <-- Base authentication class
├── AdminService.java <-- Extends AuthService
├── EventService.java <-- Extends AuthService
├── RegistrationService.java <-- Extends AuthService
└── UserService.java
- Java Development Kit (JDK) 11 or newer
- PowerShell (for Windows build scripts)
- An IDE like IntelliJ, Eclipse, or VS Code is recommended
-
Run the application (auto-builds if needed):
# Console demo version .\run.ps1 # GUI version .\run.ps1 -gui # Show help .\run.ps1 -help
-
Build only:
.\build.ps1
-
Build the application:
# Create build directory mkdir -p build/classes # Compile all classes javac -d "build/classes" -cp "src/main/java" src/main/java/com/eventms/model/*.java javac -d "build/classes" -cp "build/classes;src/main/java" src/main/java/com/eventms/service/*.java javac -d "build/classes" -cp "build/classes" src/main/java/com/eventms/Launcher.java
-
Run the application:
# GUI version java -cp "build/classes" com.eventms.Launcher
- Open the project folder in your IDE
- Locate
src/main/java/com/eventms/Launcher.java - Click the Run button - the IDE handles compilation automatically
- OOP Inheritance Authentication - All services extend
AuthServicebase class - Secure Password Hashing - SHA-256 with salt for password storage
- Session Management - Comprehensive login/logout system with session tracking
- Role-based Authorization - Admin vs User privileges with proper access control
- Password Management - Change passwords and reset with secure token system
- User Creation & Verification - Create users with email verification
- Role Promotion - Promote users to admin status
- Profile Management - Update user information and preferences
- Token-based Event Creation - Admins generate secure tokens for event creation
- Event Lifecycle - Create, update, cancel, and manage events
- Event Discovery - Users can browse and search for events
- Capacity Management - Automatic registration limits and waitlists
- Authenticated Registration - Users must be logged in to register
- Registration Status Tracking - Confirmed, pending, cancelled states
- Event Capacity Enforcement - Automatic capacity limit management
- Clean Build System - Automated PowerShell build and run scripts
- Comprehensive Testing - Full authentication flow demonstration in Main.java
- Error Handling - Proper exception handling with user-friendly messages
- Separation of Concerns - Clean architecture separating models, services, and main logic
- GUI Interface - Java Swing-based graphical user interface
- Login Form - Professional login interface with email and password fields
- Sign Up Form - Comprehensive registration form with validation
- Full name, email, contact number validation
- Password confirmation and strength checking
- Date of birth selector with dropdown menus
- Gender selection and terms agreement
- Main Dashboard - Post-login application interface
- User profile display and management
- Navigation menu for different features
- Status indicators and quick actions
- Form Validation - Real-time validation with user-friendly error messages
- Responsive Design - Clean, modern interface that works across different screen sizes
The system includes a comprehensive demo that showcases:
- User creation and verification
- Secure login with password hashing
- Role-based user promotion (USER to ADMIN)
- Admin-only token generation
- Token-based event creation
- Authenticated event registration
- Password change and reset functionality
- Token reusability for multiple events
- Secure logout and session management
- Authorization checks for all operations
- Base Class:
AuthServiceprovides common authentication functionality - Derived Classes:
AdminService,EventService,RegistrationServiceextendAuthService - Method Inheritance: All services inherit
requireAuthentication(),requireAdmin(),isAuthenticated()
- Protected Methods: Authentication methods are protected, allowing inheritance but preventing external access
- Private Fields: User credentials and session data are encapsulated within service classes
- Static References: Shared
UserServicereference through static field in base class
- Method Overriding: Services can override base authentication behavior if needed
- Interface Implementation: Models implement interfaces like
Displayablefor consistent behavior
- Abstract Base Class:
AuthServicecannot be instantiated directly - Service Layer: Business logic abstracted from data models
- Clean Interfaces: Services provide simple method interfaces hiding complex authentication logic
- [Sun Heng] - Project Lead & System Architect
- [Veat Bunchhour] - Team Coordinator
- [Cheav Vichar] - Member
- [Kheang Rachana] - Member
- [Mean Sambathpoty] - Member
This project follows a collaborative Git workflow to ensure code quality and team synchronization.
- Main Branch: The
mainbranch is the stable, production-ready version - Development Branch: The
devbranch is used for integration and testing - Feature Branches: All new work done on separate feature branches
- Pull Requests: Code review required before merging to
devormain - Clean Builds: Use automated build scripts to ensure consistent compilation
- Use
//comments instead of/* */ - Follow OOP inheritance patterns for authentication
- Maintain clean separation between models and services
- Include comprehensive error handling
This project is licensed under the MIT License - see the LICENSE file for details.
- Database Integration - Connect to actual database instead of in-memory storage
- Web Interface - Add REST API and web frontend
- Email Notifications - Send confirmation emails for registrations
- Advanced Search - Filter events by category, date, location
- Payment Integration - Handle paid events and transactions
- Mobile App - Cross-platform mobile application
Event Management System v2.0 - Demonstrating advanced OOP concepts with secure authentication