EventHub is a modern, full-featured event management platform built with Spring Boot 3.4.4 and Java 17. It provides comprehensive functionality for event organizers and attendees, including real-time notifications, payment processing, analytics dashboards, and automated event lifecycle management.
- Multi-type Event Support: Conferences, workshops, seminars, concerts, movies, sports, social events, and more
- Dual Ticket Tiers: General admission and VIP tickets with independent pricing and capacity management
- Event Lifecycle Automation: Automatic status transitions (Published → In Progress → Completed)
- Smart Capacity Management: Real-time ticket availability tracking with automatic updates
- Role-Based Access Control: Three distinct roles (Attendee, Organizer, Admin)
- Spring Security Integration: Secure authentication and authorization
- Profile Management: Complete user profile functionality with secure password updates
- 6-Digit ID System: Unique, human-readable identifiers for all entities
- Secure Payment Processing: Complete payment workflow with transaction tracking
- Comprehensive Refund Management:
- Organizer-initiated refunds
- Attendee refund requests
- Automated refunds on event cancellation
- Multi-status refund tracking (Requested, Approved, Rejected, Completed)
- Financial Security: Card information protection with last-four-digit storage only
- Live Dashboard Metrics: Revenue tracking, ticket sales, refund statistics
- Multi-dimensional Analytics:
- Organizer-level insights across all events
- Event-specific detailed analytics
- Revenue breakdown by ticket type (General vs VIP)
- Time-series sales data
- WebSocket-Powered Updates: Real-time data streaming every 5 seconds
- Real-Time WebSocket Notifications: Instant updates via
/topic/notifications/{userId} - Automated Event Reminders: Scheduled notifications for registered attendees
- Event Lifecycle Alerts: Cancellation notices, refund confirmations, status updates
- Persistent Notification History: Full audit trail with read/unread status
- Live Event Updates: WebSocket channels for different event states
/topic/events/published- New events/topic/events/inprogress- Currently running events/topic/events/completed- Finished events/topic/events/cancelled- Cancelled events
- Dynamic Status Management: Automated transitions based on event timing
Backend Framework: Spring Boot 3.4.4
Language: Java 17
Database: MySQL 8.0
Security: Spring Security 6.x
Real-time: WebSocket with STOMP
Build Tool: Maven
Testing: Spring Boot Test Suite
CI/CD: GitHub Actions
src/main/java/com/csci334/EventHub/
├── config/ # Configuration classes
│ ├── SecurityConfig.java # Security & CORS configuration
│ ├── WebConfig.java # Web MVC configuration
│ └── WebSocketConfig.java # WebSocket & STOMP setup
├── controller/ # REST API endpoints
│ ├── EventController.java # Event CRUD operations
│ ├── UserController.java # User management
│ ├── AuthController.java # Authentication
│ ├── RegistrationController.java # Event registration
│ ├── PaymentController.java # Payment processing
│ ├── NotificationController.java # Notification management
│ └── AnalyticsController.java # Analytics & reporting
├── service/ # Business logic layer
│ ├── EventService.java # Event lifecycle management
│ ├── UserService.java # User operations
│ ├── RegistrationService.java # Registration workflow
│ ├── PaymentService.java # Payment & refund logic
│ ├── NotificationService.java # Real-time notifications
│ └── AnalyticsService.java # Data analytics & reporting
├── entity/ # JPA entities
│ ├── Event.java # Core event model
│ ├── User.java # User model
│ ├── Registration.java # Event registration
│ ├── Payment.java # Payment transactions
│ ├── Ticket.java # Digital tickets
│ ├── Notification.java # Notification history
│ └── enums/ # Status enumerations
├── dto/ # Data Transfer Objects
│ ├── analytics/ # Analytics DTOs
│ └── ... # Request/Response DTOs
├── repository/ # Data access layer
└── utils/ # Utility classes
The application uses a comprehensive relational database design:
- Events: Core event information with automatic 6-digit IDs
- Users: Role-based user management with secure authentication
- Registrations: Event registration workflow with status tracking
- Payments: Secure payment processing with refund capabilities
- Tickets: Digital ticket generation and management
- Notifications: Persistent notification system with WebSocket integration
- Java 17 or higher
- Maven 3.6+
- MySQL 8.0 running on localhost:3306
- Git for version control
- Clone the repository
git clone https://github.com/your-username/EventHub-BE.git
cd EventHub-BE- Database Setup
CREATE DATABASE eventhub;
CREATE USER 'eventhub_user'@'localhost' IDENTIFIED BY 'your_password';
GRANT ALL PRIVILEGES ON eventhub.* TO 'eventhub_user'@'localhost';
FLUSH PRIVILEGES;- Configure Database Connection
Update
src/main/resources/application.properties:
spring.datasource.url=jdbc:mysql://localhost:3306/eventhub?useSSL=false&serverTimezone=UTC&allowPublicKeyRetrieval=true
spring.datasource.username=your_username
spring.datasource.password=your_password- Build and Run
# Install dependencies and run tests
./mvnw clean test
# Start the application
./mvnw spring-boot:run- Verify Installation
- Application runs on
http://localhost:8080 - WebSocket endpoint available at
ws://localhost:8080/ws - Health check:
GET /api/eventsshould return an empty array
POST /api/auth/login # User authentication
POST /api/auth/signup # User registrationGET /api/events # List all events
GET /api/events/{id} # Get event details
GET /api/events/type/{type} # Filter by event type
GET /api/events/organizer/{id} # Events by organizer
GET /api/events/upcoming # Upcoming events
GET /api/events/search?keyword= # Search events
POST /api/events # Create new event
PUT /api/events/{id} # Update event
DELETE /api/events/{id} # Delete event
PUT /api/events/{id}/cancel # Cancel event with passwordGET /api/registrations/user/{userId} # User's registrations
GET /api/registrations/event/{eventId} # Event registrations
POST /api/registrations # Register for event
PUT /api/registrations/{id}/approve # Approve registration
PUT /api/registrations/{id}/reject # Reject registrationPOST /api/payments/make # Process payment
POST /api/payments/{regId}/refund # Organizer refund
POST /api/payments/{regId}/request-refund # Request refund
PUT /api/payments/{regId}/approve-refund # Approve refund
PUT /api/payments/{regId}/reject-refund # Reject refundGET /api/analytics/organizers/{id}/overview # Organizer metrics
GET /api/analytics/organizers/{id}/sales # Sales data
GET /api/analytics/events/{id}/overview # Event-specific metrics
GET /api/analytics/events/{id}/sales # Event sales dataGET /api/notifications/users/{userId} # User notifications
PUT /api/notifications/{id}/read # Mark as read
POST /api/notifications/events/{id}/send-reminders # Send remindersconst socket = new SockJS('http://localhost:8080/ws');
const stompClient = Stomp.over(socket);
stompClient.connect({}, function (frame) {
// Subscribe to real-time updates
stompClient.subscribe('/topic/events/published', function (message) {
const newEvents = JSON.parse(message.body);
// Handle new event notifications
});
// Subscribe to personal notifications
stompClient.subscribe('/topic/notifications/' + userId, function (message) {
const notification = JSON.parse(message.body);
// Handle personal notifications
});
// Subscribe to analytics updates
stompClient.subscribe('/topic/analytics/' + organizerId, function (message) {
const analytics = JSON.parse(message.body);
// Update dashboard in real-time
});
});/topic/events/published- New events/topic/events/inprogress- Events currently running/topic/events/completed- Completed events/topic/events/cancelled- Cancelled events
/topic/notifications/{userId}- User-specific notifications
/topic/analytics/{organizerId}- Real-time organizer metrics/topic/sales/{organizerId}- Live sales data/topic/analytics/event/{eventId}- Event-specific analytics
CORS is configured for frontend integration:
// Allowed origins for development
cfg.setAllowedOrigins(List.of("http://localhost:5173"));The application includes automated background processes:
- Event Status Updates: Every minute (IN_PROGRESS, COMPLETED)
- Analytics Broadcasting: Every 5 seconds
- Notification Delivery: Real-time via WebSocket
# JPA/Hibernate Configuration
spring.jpa.hibernate.ddl-auto=update
spring.jpa.show-sql=true
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL8Dialect
# Debug logging for services
logging.level.com.csci334.EventHub.service=DEBUG# Run all tests
./mvnw test
# Run tests with coverage
./mvnw test jacoco:report
# Run specific test class
./mvnw test -Dtest=EventServiceTestTests use a separate MySQL database:
# Test configuration
spring.datasource.url=jdbc:mysql://localhost:3306/eventhub_test
spring.datasource.username=root
spring.datasource.password=rootThe project includes a comprehensive GitHub Actions workflow:
- Test Phase: Automated testing with MySQL service
- Build Phase: Maven compilation and packaging
- Artifact Management: JAR file storage with SHA-based naming
- Multi-branch CI (all branches)
- Pull request validation
- MySQL 8.0 service container
- Maven dependency caching
- Build artifact retention (30 days)
- Java 17 with Temurin distribution
# Simulate CI environment
docker run --name mysql-test -e MYSQL_ROOT_PASSWORD=root -e MYSQL_DATABASE=eventhub_test -p 3306:3306 -d mysql:8.0
export SPRING_DATASOURCE_URL=jdbc:mysql://localhost:3306/eventhub_test
export SPRING_DATASOURCE_USERNAME=root
export SPRING_DATASOURCE_PASSWORD=root
./mvnw clean testgraph LR
A[PUBLISHED] --> B[IN_PROGRESS]
B --> C[COMPLETED]
A --> D[CANCELLED]
B --> D
- PUBLISHED → IN_PROGRESS: When current time >= event start time
- IN_PROGRESS → COMPLETED: When current time >= event end time
- Any Status → CANCELLED: Manual cancellation by organizer
- Organizer Authentication: Password verification required
- Automatic Refunds: All paid registrations receive automatic refunds
- Notification Broadcast: All attendees notified via WebSocket
- Status Updates: Registrations and tickets marked accordingly
- Capacity Restoration: Ticket availability restored
The analytics system provides comprehensive insights:
- Financial Overview: Total revenue, refunds, net income
- Event Portfolio: Total events, upcoming, cancelled counts
- Ticket Analytics: Sales by type (General vs VIP)
- Performance Trends: Time-series sales data
- Revenue Tracking: Real-time income monitoring
- Attendance Management: Registration status breakdown
- Capacity Utilization: Ticket availability tracking
- Refund Analytics: Refund rate and reasons
Analytics data is automatically broadcast every 5 seconds to subscribed clients, enabling real-time dashboard updates without manual refresh.
- Spring Security 6.x: Modern security framework
- BCrypt Password Encoding: Secure password storage
- Role-Based Access: Three-tier permission system
- CORS Configuration: Frontend integration support
- Input Validation: Comprehensive DTO validation
- SQL Injection Prevention: JPA/Hibernate parameterized queries
- Sensitive Data Handling: Secure storage of payment information
- Password Verification: Event cancellation requires organizer password
- Lazy Loading: Efficient entity relationship loading
- Indexed Queries: Optimized database queries
- Connection Pooling: Efficient database connection management
- Transaction Management: Proper transaction boundaries
- Maven Dependency Caching: CI/CD optimization
- JPA Second-Level Cache: Entity caching for performance
- WebSocket Connection Reuse: Efficient real-time communication