Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

Real-Time Event Ticketing System with Producer-Consumer Pattern

Overview

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.

Features

  • 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.

Tech Stack

  • Frontend: React
  • Backend: Spring Boot
  • Database: MySQL
  • Core Language: Java

APIs

The backend exposes several APIs for managing the simulation and configurations:

1. Start Simulation

  • 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"
    }

2. Stop Simulation

  • Endpoint: /api/simulation/stop
  • Method: POST
  • Request Body:
    {
      "simulationId": "12345"
    }
  • Response:
    {
      "status": "Simulation stopped",
      "summary": {
        "vendors": [...],
        "customers": [...]
      }
    }

3. Save Configuration

  • 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"
    }

4. Load Configuration

  • Endpoint: /api/configurations/load/{configId}
  • Method: GET
  • Response:
    {
      "configId": "67890",
      "name": "Config1",
      "ticketCapacity": 10,
      "totalTickets": 8,
      "vendors": 2,
      "customers": 3,
      "releaseRate": 1000,
      "retrievalRate": 500
    }

5. Get All Configurations

  • Endpoint: /api/configurations
  • Method: GET
  • Response:
    [
      {
        "configId": "67890",
        "name": "Config1",
        "ticketCapacity": 10,
        "totalTickets": 8,
        "vendors": 2,
        "customers": 3,
        "releaseRate": 1000,
        "retrievalRate": 500
      },
      ...
    ]

6. Delete Configuration

  • Endpoint: /api/configurations/delete/{configId}
  • Method: DELETE
  • Response:
    {
      "status": "Configuration deleted"
    }

How to Run the Project

Prerequisites

  1. Install Java 17+
  2. Install Node.js
  3. Install MySQL
  4. Install Spring Boot

Backend Setup

  1. Clone the repository:
    git clone https://github.com/PulithR/Real-Time-Event-Ticketing-System-with-Producer-Consumer-Pattern
  2. Navigate to the backend folder and build the project:
    cd backend
    ./mvnw spring-boot:run
  3. Configure the application.properties file with your MySQL credentials.

Frontend Setup

  1. Navigate to the frontend folder:
    cd frontend
  2. Install dependencies:
    npm install
  3. Start the development server:
    npm start

Access the Application

  • Open your browser and navigate to http://localhost:3000

Project Structure

web_app
│
├── server
│   ├── src
│   ├── pom.xml
│   └── ...
│
├── frontend
│   ├── src
│   ├── package.json
│   └── ...
│
└── README.md

Contact


Feel free to explore the project and provide feedback!

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages