The Real-Time Event Ticketing System is a simulation designed to manage ticket sales and purchases using the Producer-Consumer pattern. The system ensures concurrency management, allowing multiple vendors to release tickets and customers to retrieve them simultaneously in a real-time environment.
The project is built using Java for core functionalities, with a web application interface developed using React/Angular, Spring Boot, and MySQL.
- Real-Time Ticket Transactions: Simulates real-time ticket release and purchase.
- Concurrency Control: Implements the Producer-Consumer pattern for efficient handling of ticket operations.
- Dynamic Configuration: Allows users to configure ticketing parameters through a frontend interface.
- Persistence: Saves and retrieves configurations and logs using a MySQL database.
- User-Friendly Web Interface: Provides an intuitive interface for running simulations and viewing results.
- Frontend: React
- Backend: Spring Boot
- Database: MySQL
- Core Language: Java
The backend exposes several APIs for managing the simulation and configurations:
- Endpoint:
/api/simulation/start - Method: POST
- Request Body:
{ "ticketCapacity": 10, "totalTickets": 8, "vendors": 2, "customers": 3, "releaseRate": 1000, "retrievalRate": 500 } - Response:
{ "status": "Simulation started", "simulationId": "12345" }
- Endpoint:
/api/simulation/stop - Method: POST
- Request Body:
{ "simulationId": "12345" } - Response:
{ "status": "Simulation stopped", "summary": { "vendors": [...], "customers": [...] } }
- Endpoint:
/api/configurations/save - Method: POST
- Request Body:
{ "name": "Config1", "ticketCapacity": 10, "totalTickets": 8, "vendors": 2, "customers": 3, "releaseRate": 1000, "retrievalRate": 500 } - Response:
{ "status": "Configuration saved", "configId": "67890" }
- Endpoint:
/api/configurations/load/{configId} - Method: GET
- Response:
{ "configId": "67890", "name": "Config1", "ticketCapacity": 10, "totalTickets": 8, "vendors": 2, "customers": 3, "releaseRate": 1000, "retrievalRate": 500 }
- Endpoint:
/api/configurations - Method: GET
- Response:
[ { "configId": "67890", "name": "Config1", "ticketCapacity": 10, "totalTickets": 8, "vendors": 2, "customers": 3, "releaseRate": 1000, "retrievalRate": 500 }, ... ]
- Endpoint:
/api/configurations/delete/{configId} - Method: DELETE
- Response:
{ "status": "Configuration deleted" }
- Install Java 17+
- Install Node.js
- Install MySQL
- Install Spring Boot
- Clone the repository:
git clone https://github.com/PulithR/Real-Time-Event-Ticketing-System-with-Producer-Consumer-Pattern
- Navigate to the backend folder and build the project:
cd backend ./mvnw spring-boot:run - Configure the
application.propertiesfile with your MySQL credentials.
- Navigate to the frontend folder:
cd frontend - Install dependencies:
npm install
- Start the development server:
npm start
- Open your browser and navigate to
http://localhost:3000
web_app
│
├── server
│ ├── src
│ ├── pom.xml
│ └── ...
│
├── frontend
│ ├── src
│ ├── package.json
│ └── ...
│
└── README.md
- Pulith Rajanayake
- GitHub: PulithR
- Email: pulithr@gmail.com
Feel free to explore the project and provide feedback!