# mahordev/ticket-booking-hub architecture

> Architecture diagram of the GitHub repository mahordev/ticket-booking-hub, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-12). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mahordev/ticket-booking-hub
- Repository: https://github.com/mahordev/ticket-booking-hub

## Overview

TicketHub is a microservices platform for event ticketing. A customer authenticates, browses events and shows, reserves seats, creates a booking, pays, and receives confirmation and a ticket by email. The graph keeps those domain stages distinct and includes the supporting identity, gateway, and event-messaging layers. README statements establish the cross-service journey; source-index references and excerpts support selected internal calls. Several service implementations and their wiring were not sampled, so uncertain connections are omitted.

Main entry points: [`tickethub-booking-service/src/main/java/org/tickethub/bookingservice/service/impl/BookingServiceImpl.java`](https://github.com/mahordev/ticket-booking-hub/blob/main/tickethub-booking-service/src/main/java/org/tickethub/bookingservice/service/impl/BookingServiceImpl.java) (Booking lifecycle), [`api-gateway/src/main/java/com/tickethub/gateway`](https://github.com/mahordev/ticket-booking-hub/tree/main/api-gateway/src/main/java/com/tickethub/gateway) (API gateway), [`PaymentService/src/main/java/org/tickethub/paymentservice/controller/PaymentController.java`](https://github.com/mahordev/ticket-booking-hub/blob/main/PaymentService/src/main/java/org/tickethub/paymentservice/controller/PaymentController.java) (Payment API), [`PaymentService/src/main/java/org/tickethub/paymentservice/service/impl/PaymentServiceImpl.java`](https://github.com/mahordev/ticket-booking-hub/blob/main/PaymentService/src/main/java/org/tickethub/paymentservice/service/impl/PaymentServiceImpl.java) (Payment lifecycle)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_edge["Access and identity"]
  node_gateway["API gateway"]
  node_user_service["User accounts<br/>[UserService.java]"]
  node_user_store[("User records<br/>[User.java]")]
end

subgraph group_catalog["Event catalog"]
  node_event_api["Event catalog API"]
  node_venue_show["Venue and shows<br/>[Show.java]"]
  node_seat_catalog["Seat inventory<br/>[ShowSeat.java]"]
  node_media["Poster media"]
end

subgraph group_booking["Booking and tickets"]
  node_booking_api["Booking API"]
  node_booking_flow["Booking lifecycle"]
  node_seat_locks["Seat locking"]
  node_booking_store[("Booking records<br/>[Booking.java]")]
  node_tickets["Ticket issuance"]
end

subgraph group_payment["Payments"]
  node_payment_api["Payment API"]
  node_payment_flow["Payment lifecycle"]
  node_payment_store[("Payment records<br/>[Payment.java]")]
end

subgraph group_notify["Notifications"]
  node_notification_consumer["Notification consumers"]
  node_delivery["Notification delivery"]
  node_notification_store[("Delivery records<br/>[Notification.java]")]
  node_email["Email delivery"]
end

node_customer(("Customer"))
node_razorpay["Razorpay"]
node_event_broker["Kafka events"]

node_customer -->|"sends requests"| node_gateway
node_gateway -.->|"forwards auth"| node_user_service
node_user_service -->|"persists users"| node_user_store
node_gateway -->|"routes requests"| node_event_api
node_customer -->|"browses events"| node_event_api
node_event_api -.->|"serves catalog"| node_venue_show
node_event_api -.->|"serves availability"| node_seat_catalog
node_customer -.->|"uploads posters"| node_media
node_gateway -->|"routes requests"| node_booking_api
node_customer -->|"books seats"| node_booking_api
node_booking_api -->|"delegates booking"| node_booking_flow
node_booking_flow -.->|"locks seats"| node_seat_locks
node_booking_flow -.->|"records booking"| node_booking_store
node_booking_flow -.->|"issues ticket"| node_tickets
node_gateway -->|"routes requests"| node_payment_api
node_customer -->|"initiates payment"| node_payment_api
node_payment_api -->|"delegates payment"| node_payment_flow
node_payment_api -->|"checks booking"| node_booking_flow
node_payment_flow -.->|"records payment"| node_payment_store
node_payment_flow -->|"creates checkout"| node_razorpay
node_razorpay -->|"posts webhook"| node_payment_api
node_payment_flow -->|"publishes outcomes"| node_event_broker
node_booking_flow -->|"publishes confirmation"| node_event_broker
node_event_broker -->|"delivers events"| node_notification_consumer
node_notification_consumer -.->|"requests delivery"| node_delivery
node_delivery -->|"records status"| node_notification_store
node_delivery -->|"sends email"| node_email

click node_gateway "https://github.com/mahordev/ticket-booking-hub/tree/main/api-gateway/src/main/java/com/tickethub/gateway"
click node_user_service "https://github.com/mahordev/ticket-booking-hub/blob/main/UserService/src/main/java/com/tickethub/user/service/UserService.java"
click node_user_store "https://github.com/mahordev/ticket-booking-hub/blob/main/UserService/src/main/java/com/tickethub/user/entity/User.java"
click node_event_api "https://github.com/mahordev/ticket-booking-hub/blob/main/EventService/src/main/java/com/tickethub/event/controller/EventController.java"
click node_venue_show "https://github.com/mahordev/ticket-booking-hub/blob/main/EventService/src/main/java/com/tickethub/event/entity/Show.java"
click node_seat_catalog "https://github.com/mahordev/ticket-booking-hub/blob/main/EventService/src/main/java/com/tickethub/event/entity/ShowSeat.java"
click node_media "https://github.com/mahordev/ticket-booking-hub/blob/main/EventService/src/main/java/com/tickethub/event/service/impl/S3StorageService.java"
click node_booking_api "https://github.com/mahordev/ticket-booking-hub/blob/main/tickethub-booking-service/src/main/java/org/tickethub/bookingservice/controller/BookingController.java"
click node_booking_flow "https://github.com/mahordev/ticket-booking-hub/blob/main/tickethub-booking-service/src/main/java/org/tickethub/bookingservice/service/impl/BookingServiceImpl.java"
click node_seat_locks "https://github.com/mahordev/ticket-booking-hub/blob/main/tickethub-booking-service/src/main/java/org/tickethub/bookingservice/service/impl/SeatLockServiceImpl.java"
click node_booking_store "https://github.com/mahordev/ticket-booking-hub/blob/main/tickethub-booking-service/src/main/java/org/tickethub/bookingservice/entity/Booking.java"
click node_tickets "https://github.com/mahordev/ticket-booking-hub/blob/main/tickethub-booking-service/src/main/java/org/tickethub/bookingservice/service/impl/TicketServiceImpl.java"
click node_payment_api "https://github.com/mahordev/ticket-booking-hub/blob/main/PaymentService/src/main/java/org/tickethub/paymentservice/controller/PaymentController.java"
click node_payment_flow "https://github.com/mahordev/ticket-booking-hub/blob/main/PaymentService/src/main/java/org/tickethub/paymentservice/service/impl/PaymentServiceImpl.java"
click node_payment_store "https://github.com/mahordev/ticket-booking-hub/blob/main/PaymentService/src/main/java/org/tickethub/paymentservice/entity/Payment.java"
click node_notification_consumer "https://github.com/mahordev/ticket-booking-hub/blob/main/NotificationService/src/main/java/org/tickethub/notificationservice/kafka/BookingConfirmedConsumer.java"
click node_delivery "https://github.com/mahordev/ticket-booking-hub/blob/main/NotificationService/src/main/java/org/tickethub/notificationservice/service/impl/NotificationDeliveryService.java"
click node_notification_store "https://github.com/mahordev/ticket-booking-hub/blob/main/NotificationService/src/main/java/org/tickethub/notificationservice/entity/Notification.java"
click node_email "https://github.com/mahordev/ticket-booking-hub/blob/main/NotificationService/src/main/java/org/tickethub/notificationservice/service/impl/EmailNotificationServiceImpl.java"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_gateway,node_user_service,node_user_store toneBlue
class node_event_api,node_venue_show,node_seat_catalog,node_media toneAmber
class node_booking_api,node_booking_flow,node_seat_locks,node_booking_store,node_tickets toneMint
class node_payment_api,node_payment_flow,node_payment_store toneRose
class node_notification_consumer,node_delivery,node_notification_store,node_email,node_customer,node_razorpay,node_event_broker toneIndigo
```

## Components

### Access and identity

- [API gateway](https://github.com/mahordev/ticket-booking-hub/tree/main/api-gateway/src/main/java/com/tickethub/gateway): `api-gateway/src/main/java/com/tickethub/gateway`
- [User accounts](https://github.com/mahordev/ticket-booking-hub/blob/main/UserService/src/main/java/com/tickethub/user/service/UserService.java): `UserService/src/main/java/com/tickethub/user/service/UserService.java`
- [User records](https://github.com/mahordev/ticket-booking-hub/blob/main/UserService/src/main/java/com/tickethub/user/entity/User.java): `UserService/src/main/java/com/tickethub/user/entity/User.java`

### Event catalog

- [Event catalog API](https://github.com/mahordev/ticket-booking-hub/blob/main/EventService/src/main/java/com/tickethub/event/controller/EventController.java): `EventService/src/main/java/com/tickethub/event/controller/EventController.java`
- [Venue and shows](https://github.com/mahordev/ticket-booking-hub/blob/main/EventService/src/main/java/com/tickethub/event/entity/Show.java): `EventService/src/main/java/com/tickethub/event/entity/Show.java`
- [Seat inventory](https://github.com/mahordev/ticket-booking-hub/blob/main/EventService/src/main/java/com/tickethub/event/entity/ShowSeat.java): `EventService/src/main/java/com/tickethub/event/entity/ShowSeat.java`
- [Poster media](https://github.com/mahordev/ticket-booking-hub/blob/main/EventService/src/main/java/com/tickethub/event/service/impl/S3StorageService.java): `EventService/src/main/java/com/tickethub/event/service/impl/S3StorageService.java`

### Booking and tickets

- [Booking API](https://github.com/mahordev/ticket-booking-hub/blob/main/tickethub-booking-service/src/main/java/org/tickethub/bookingservice/controller/BookingController.java): `tickethub-booking-service/src/main/java/org/tickethub/bookingservice/controller/BookingController.java`
- [Booking lifecycle](https://github.com/mahordev/ticket-booking-hub/blob/main/tickethub-booking-service/src/main/java/org/tickethub/bookingservice/service/impl/BookingServiceImpl.java): `tickethub-booking-service/src/main/java/org/tickethub/bookingservice/service/impl/BookingServiceImpl.java`
- [Seat locking](https://github.com/mahordev/ticket-booking-hub/blob/main/tickethub-booking-service/src/main/java/org/tickethub/bookingservice/service/impl/SeatLockServiceImpl.java): `tickethub-booking-service/src/main/java/org/tickethub/bookingservice/service/impl/SeatLockServiceImpl.java`
- [Booking records](https://github.com/mahordev/ticket-booking-hub/blob/main/tickethub-booking-service/src/main/java/org/tickethub/bookingservice/entity/Booking.java): `tickethub-booking-service/src/main/java/org/tickethub/bookingservice/entity/Booking.java`
- [Ticket issuance](https://github.com/mahordev/ticket-booking-hub/blob/main/tickethub-booking-service/src/main/java/org/tickethub/bookingservice/service/impl/TicketServiceImpl.java): `tickethub-booking-service/src/main/java/org/tickethub/bookingservice/service/impl/TicketServiceImpl.java`

### Payments

- [Payment API](https://github.com/mahordev/ticket-booking-hub/blob/main/PaymentService/src/main/java/org/tickethub/paymentservice/controller/PaymentController.java): `PaymentService/src/main/java/org/tickethub/paymentservice/controller/PaymentController.java`
- [Payment lifecycle](https://github.com/mahordev/ticket-booking-hub/blob/main/PaymentService/src/main/java/org/tickethub/paymentservice/service/impl/PaymentServiceImpl.java): `PaymentService/src/main/java/org/tickethub/paymentservice/service/impl/PaymentServiceImpl.java`
- [Payment records](https://github.com/mahordev/ticket-booking-hub/blob/main/PaymentService/src/main/java/org/tickethub/paymentservice/entity/Payment.java): `PaymentService/src/main/java/org/tickethub/paymentservice/entity/Payment.java`

### Notifications

- [Notification consumers](https://github.com/mahordev/ticket-booking-hub/blob/main/NotificationService/src/main/java/org/tickethub/notificationservice/kafka/BookingConfirmedConsumer.java): `NotificationService/src/main/java/org/tickethub/notificationservice/kafka/BookingConfirmedConsumer.java`
- [Notification delivery](https://github.com/mahordev/ticket-booking-hub/blob/main/NotificationService/src/main/java/org/tickethub/notificationservice/service/impl/NotificationDeliveryService.java): `NotificationService/src/main/java/org/tickethub/notificationservice/service/impl/NotificationDeliveryService.java`
- [Delivery records](https://github.com/mahordev/ticket-booking-hub/blob/main/NotificationService/src/main/java/org/tickethub/notificationservice/entity/Notification.java): `NotificationService/src/main/java/org/tickethub/notificationservice/entity/Notification.java`
- [Email delivery](https://github.com/mahordev/ticket-booking-hub/blob/main/NotificationService/src/main/java/org/tickethub/notificationservice/service/impl/EmailNotificationServiceImpl.java): `NotificationService/src/main/java/org/tickethub/notificationservice/service/impl/EmailNotificationServiceImpl.java`

### Other components

- **Customer**
- **Razorpay**
- **Kafka events**

## Connections

- Customer → API gateway: sends requests (evidence: `README.md`)
- API gateway → User accounts: forwards auth (evidence: `README.md`)
- User accounts → User records: persists users (evidence: `UserService/src/main/java/com/tickethub/user/service/UserService.java`)
- API gateway → Event catalog API: routes requests (evidence: `README.md`)
- Customer → Event catalog API: browses events (evidence: `README.md`)
- Event catalog API → Venue and shows: serves catalog
- Event catalog API → Seat inventory: serves availability
- Customer → Poster media: uploads posters (evidence: `README.md`)
- API gateway → Booking API: routes requests (evidence: `README.md`)
- Customer → Booking API: books seats (evidence: `README.md`)
- Booking API → Booking lifecycle: delegates booking (evidence: `tickethub-booking-service/src/main/java/org/tickethub/bookingservice/controller/BookingController.java`)
- Booking lifecycle → Seat locking: locks seats
- Booking lifecycle → Booking records: records booking
- Booking lifecycle → Ticket issuance: issues ticket (evidence: `README.md`)
- API gateway → Payment API: routes requests (evidence: `README.md`)
- Customer → Payment API: initiates payment (evidence: `README.md`)
- Payment API → Payment lifecycle: delegates payment (evidence: `PaymentService/src/main/java/org/tickethub/paymentservice/controller/PaymentController.java`)
- Payment API → Booking lifecycle: checks booking (evidence: `PaymentService/src/main/java/org/tickethub/paymentservice/controller/PaymentController.java`)
- Payment lifecycle → Payment records: records payment
- Payment lifecycle → Razorpay: creates checkout (evidence: `README.md`)
- Razorpay → Payment API: posts webhook (evidence: `README.md`)
- Payment lifecycle → Kafka events: publishes outcomes (evidence: `README.md`)
- Booking lifecycle → Kafka events: publishes confirmation (evidence: `README.md`)
- Kafka events → Notification consumers: delivers events (evidence: `README.md`)
- Notification consumers → Notification delivery: requests delivery
- Notification delivery → Delivery records: records status (evidence: `NotificationService/src/main/java/org/tickethub/notificationservice/service/impl/NotificationDeliveryService.java`)
- Notification delivery → Email delivery: sends email (evidence: `NotificationService/src/main/java/org/tickethub/notificationservice/service/impl/NotificationDeliveryService.java`)
