The Real-Time Event Ticketing System is a dynamic, high-performance application for managing ticket releases and purchases in real-time. The system ensures data integrity through multi-threading and synchronization, supporting the following features:
- Setting maximum ticket limits for events and ticket pools.
- Adding vendors to release tickets and customers to purchase them at configurable rates.
- Monitoring ticket availability and sales.
- Stopping and resetting the system dynamically.
The project is organized as follows:
src/main/java/com/example/ticketingSystem
│
├── Controller
│ └── TicketingController.java # Handles API requests and system controls
│
├── Config
│ └── ApplicationCOnfiguration.java # Handles CLI system controls
│
├── Modules
│ ├── Vendor.java # Defines the Vendor class
│ ├── Customer.java # Defines the Customer class
│ └── Ticket.java # Defines the Ticket class
│
├── Services
│ ├── VendorService.java # Handles ticket release logic for vendors
│ ├── CustomerService.java # Handles ticket purchase logic for customers
│ └── TicketPoolService.java # Manages ticket operations and data synchronization
│
└── TicketingSystemApplication.java # Main Spring Boot application entry point
└── CLIConfiguration.java # Main CLI application entry point
-
Java Development Kit (JDK)
Ensure you have JDK 21 (or above) installed. Download here. -
Maven
Install Maven for building the application. Download here. -
Node.js and Angular CLI
For the frontend (if integrated), install:- Node.js (v16 or later): Download Node.js.
- Angular CLI: Install Angular CLI.
-
IDE
Use an IDE like IntelliJ IDEA, Eclipse, or VS Code for a better development experience.
-
Clone the Repository
Open your terminal and execute the following commands:git clone https://github.com/your-repository/ticketing-system.git cd ticketing-system
To build the backend, run the following command:
mvn clean install
mvn spring-boot:run
cd frontend
npm install
ng serve
Backend: http://localhost:8080 Frontend: http://localhost:4200
Set Ticket Limits Use the following API endpoints to configure ticket limits:
Set event ticket limit: plaintext POST /api/eventticket/set-max-event-tickets
Body: { "maxEventTickets": 100 }
Set pool ticket limit: plaintext POST /api/eventticket/set-max-pool-tickets
Body: { "maxPoolTickets": 50 }
Start vendors and customers to simulate ticket transactions:
Start a vendor: plaintext POST /api/eventticket/start-vendor?vendorId=1&ticketReleaseRate=5
Start a customer: plaintext POST /api/eventticket/start-customer?customerId=1&customerRetrievalRate=3
Monitor Status
plaintext Use GET /api/eventticket/status to view:
Stop and Reset the System
Use plaintext POST /api/eventticket/stop to stop all processes and reset the ticket pool.
Displays ticket statistics (available and sold).
Buttons to start/stop the system and add vendors/customers dynamically.
The Ticketing System provides many API resources that enable vendors and customers to release and purchase tickets simultaneously.
Currently, the Ticketing System APIs do not require explicit authentication as this is a local system designed for coursework.
Below are the available endpoints and their functionalities:
Method: POST
Description: Start the ticketing process for a vendor.
Method: POST
Description: Set the maximum number of tickets available for an event.
Method: POST
Description: Start the ticketing process for a customer.
Method: POST
Description: Stop the ticketing system and halt ticket allocations.
Method: GET
Description: Check the current status of the ticketing system.
| Status Code | Description |
|---|---|
| 400 | Bad Request – Invalid or missing parameters. |
| 401 | Unauthorized – API key or token is missing or invalid. |
| 404 | Not Found – The requested endpoint or resource does not exist. |
| 500 | Internal Server Error – Unexpected server error. |
bash GET http://localhost:8080/api/eventticket/status
bash
{ "availableTickets": 100, "soldTickets": 200 }