Skip to content
cvp2004Public

About

Evently - Concurrent Ticket Management System

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

Β 

History

30 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Evently - Event Ticketing Platform

Spring Boot Java PostgreSQL Redis License

Evently is a comprehensive event management and ticketing platform built with Spring Boot. It provides a complete solution for managing venues, events, shows, and ticket bookings with support for payments, refunds, and email notifications.

πŸš€ Features

Core Functionality

  • Event Management: Create and manage events with categories and status tracking
  • Venue Management: Set up venues with customizable seating arrangements
  • Show Scheduling: Schedule multiple shows for events at different venues and times
  • Ticket Booking: Real-time seat selection and booking system
  • Payment Processing: Integrated payment handling with status tracking
  • Refund Management: Automated refund processing for cancellations
  • Email Notifications: Asynchronous email notifications for bookings and cancellations

Technical Features

  • RESTful API: Comprehensive REST API for both users and administrators
  • Database Migrations: Flyway-based database schema management
  • Caching: Redis integration for distributed locking and performance
  • Security: Header-based authentication for users and admins
  • Validation: Comprehensive input validation and error handling
  • Pagination: Efficient data pagination for large datasets
  • Async Processing: Background email processing with scheduling

πŸ“„ Documentation Index

πŸ—οΈ Architecture

Technology Stack

  • Backend: Spring Boot 3.5.5 with Java 21
  • Database: PostgreSQL 14 with Flyway migrations
  • Cache: Redis for distributed locking and caching
  • Build Tool: Maven
  • Containerization: Docker Compose

Database Schema

The platform uses a relational database with the following core entities:

  • Venues: Physical locations with seating capacity
  • Seats: Individual seat definitions with pricing
  • Events: Event information and metadata
  • Shows: Scheduled performances linking events to venues
  • Users: User account management
  • Bookings: User reservations for shows
  • Tickets: Individual seat tickets within bookings
  • Payments: Payment transaction records
  • Refunds: Refund processing records
  • Emails: Asynchronous email queue

Visual Diagrams

System Arcitecture Diagram

System Architecture Diagram

Database ER Diagram

Database ER Diagram

Booking Workflow Diagram

Booking Workflow Diagram

πŸš€ Quick Start

Prerequisites

  • Java 21 or higher
  • Maven 3.6 or higher
  • Docker and Docker Compose
  • Git

Installation

  1. Clone the repository

    git clone <repository-url>
    cd evently
  2. Start the required services

    docker-compose up -d

    This will start PostgreSQL and Redis services.

  3. Build and run the application

    ./mvnw spring-boot:run

    Or on Windows:

    mvnw.cmd spring-boot:run

πŸ“š API Documentation

Authentication

User APIs

All user API requests (except authentication) require the X-User-ID header with a valid user ID.

Admin APIs

All admin API requests require the X-Admin-User header set to true.

Key Endpoints

User Authentication

  • POST /api/v1/auth/signup - Register a new user
  • POST /api/v1/auth/signin - User login

Event Management

  • GET /api/v1/user/event/list - Browse available events
  • GET /api/v1/user/event/{id} - Get event details
  • GET /api/v1/user/show/{showId}/seats - View available seats

Booking Process

  • POST /api/v1/user/booking - Create a booking (reserve seats)
  • POST /api/v1/user/booking/payment - Process payment
  • GET /api/v1/user/booking/list - View booking history
  • DELETE /api/v1/user/booking/cancel - Cancel booking

Admin Management

  • GET /api/v1/admin/venue/list - Manage venues
  • GET /api/v1/admin/event/list - Manage events
  • GET /api/v1/admin/show/event/{eventId}/list - View shows for an event
  • GET /api/v1/admin/user/list - Manage users

For complete API documentation, see API Specification.

πŸ”„ Booking Workflow

  1. Seat Selection: Users browse available seats for a show
  2. Reservation: Seats are temporarily reserved for 5 minutes
  3. Payment: Users complete payment within the reservation window
  4. Confirmation: Successful payment confirms the booking
  5. Tickets: Individual tickets are generated for each seat
  6. Notifications: Email confirmations are sent asynchronously

πŸ› οΈ Development

Project Structure

src/
β”œβ”€β”€ main/
β”‚   β”œβ”€β”€ java/com/chaitanya/evently/
β”‚   β”‚   β”œβ”€β”€ Application.java              # Main application class
β”‚   β”‚   β”œβ”€β”€ config/                       # Configuration classes
β”‚   β”‚   β”œβ”€β”€ controller/                   # REST controllers
β”‚   β”‚   β”‚   β”œβ”€β”€ admin/                    # Admin-specific endpoints
β”‚   β”‚   β”‚   └── user/                     # User-specific endpoints
β”‚   β”‚   β”œβ”€β”€ dto/                          # Data Transfer Objects
β”‚   β”‚   β”œβ”€β”€ exception/                    # Exception handling
β”‚   β”‚   β”œβ”€β”€ model/                        # JPA entities
β”‚   β”‚   β”œβ”€β”€ repository/                   # Data access layer
β”‚   β”‚   β”œβ”€β”€ service/                      # Business logic
β”‚   β”‚   └── util/                         # Utility classes
β”‚   └── resources/
β”‚       β”œβ”€β”€ application.yml               # Application configuration
β”‚       └── db/migration/                 # Database migrations
└── test/                                 # Test classes

Database Migrations

The application uses Flyway for database migrations. Migration files are located in src/main/resources/db/migration/ and are automatically applied on startup.

Running Project

./mvnw spring-boot:run

Building for Production

./mvnw clean package
java -jar target/evently-0.0.1-SNAPSHOT.jar

πŸ”§ Configuration

Environment Configuration

The application uses environment variables for configuration. Key variables include:

# Database Configuration
POSTGRES_HOST=localhost
POSTGRES_PORT=5432
POSTGRES_DB=evently
POSTGRES_USER=user
POSTGRES_PASSWORD=pass

# Redis Configuration
REDIS_HOST=localhost
REDIS_PORT=6379
REDIS_PASSWORD=
REDIS_DATABASE=0

# Application Configuration
SPRING_APP_NAME=evently
DEFAULT_PAGE_SIZE=50

Application Properties

Key configuration options in application.yml:

spring:
  application:
    name: ${SPRING_APP_NAME:evently}

  datasource:
    url: jdbc:postgresql://${POSTGRES_HOST:localhost}:${POSTGRES_PORT:5432}/${POSTGRES_DB:evently_db}?options=-c%20TimeZone%3DAsia/Kolkata
    username: ${POSTGRES_USER:user}
    password: ${POSTGRES_PASSWORD:pass}
    driver-class-name: org.postgresql.Driver

  redis:
    host: ${REDIS_HOST:localhost}
    port: ${REDIS_PORT:6379}

  flyway:
    enabled: ${FLYWAY_ENABLED:true}
    locations: classpath:db/migration
    baseline-on-migrate: ${FLYWAY_BASELINE_ON_MIGRATE:true}
    table: ${FLYWAY_TABLE:flyway_schema_history}

logging:
  level:
    org.flywaydb: ${FLYWAY_LOG_LEVEL:INFO}
    org.springframework: ${SPRING_LOG_LEVEL:INFO}

app:
  pagination:
    default-page-size: ${DEFAULT_PAGE_SIZE:50}

Evently - Your complete event ticketing solution built with Spring Boot and modern Java technologies.

About

Evently - Concurrent Ticket Management System

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Contributors

Languages