# kashishbhutia/booking-platform architecture

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

- Interactive diagram: https://gitdiagram.com/kashishbhutia/booking-platform
- Repository: https://github.com/kashishbhutia/booking-platform

## Overview

BookingPlatform is a full-stack event-ticket booking application. Users browse and filter events, inspect details, select seats, create a pending booking, and proceed to payment; they can also manage bookings and profiles. Organizers create, edit, publish, and cancel events. The backend separates API routes from authentication, event, booking, and seat-hold services, with PostgreSQL accessed through Prisma and scheduled cleanup jobs. The README documents reviews, coupons, notifications, and payment-gateway readiness, but their implementation is not established by the sampled source.

Main entry points: [`BookingPlatform/frontend/src/routes.tsx`](https://github.com/kashishbhutia/booking-platform/blob/main/BookingPlatform/frontend/src/routes.tsx) (Page routing), [`BookingPlatform/backend/src/config/database.ts`](https://github.com/kashishbhutia/booking-platform/blob/main/BookingPlatform/backend/src/config/database.ts) (PostgreSQL via Prisma), [`BookingPlatform/frontend/src/pages/BookingPage.tsx`](https://github.com/kashishbhutia/booking-platform/blob/main/BookingPlatform/frontend/src/pages/BookingPage.tsx) (Seat selection), [`BookingPlatform/frontend/src/api/event.api.ts`](https://github.com/kashishbhutia/booking-platform/blob/main/BookingPlatform/frontend/src/api/event.api.ts) (Event API client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_discovery["Event discovery"]
  node_app["Web application<br/>[App.tsx]"]
  node_routes["Page routing<br/>[routes.tsx]"]
  node_event_pages["Event browsing<br/>[Events.tsx]"]
  node_event_details["Event details<br/>[EventDetails.tsx]"]
  node_organizer["Organizer tools"]
  node_event_api["Event API client<br/>[event.api.ts]"]
end

subgraph group_booking["Ticket booking"]
  node_booking_page["Seat selection<br/>[BookingPage.tsx]"]
  node_seat_grid["Interactive seat map<br/>[SeatGrid.tsx]"]
  node_payment_page["Payment page<br/>[PaymentPage.tsx]"]
  node_booking_history["Booking history<br/>[MyBookings.tsx]"]
  node_booking_api["Booking API client<br/>[booking.api.ts]"]
end

subgraph group_accounts["Accounts and operations"]
  node_auth_ui["Authentication state<br/>[AuthContext.tsx]"]
  node_auth_api["Authentication client<br/>[auth.api.ts]"]
  node_user_api["User API client<br/>[user.api.ts]"]
end

subgraph group_api["Backend API"]
  node_backend["Express API<br/>[index.ts]"]
  node_api_routes["API route aggregation<br/>[index.ts]"]
  node_event_routes["Event endpoints<br/>[event.routes.ts]"]
  node_booking_routes["Booking endpoints<br/>[booking.routes.ts]"]
  node_auth_routes["Authentication endpoints<br/>[auth.routes.ts]"]
  node_user_routes["User endpoints<br/>[user.routes.ts]"]
  node_venue_routes["Venue endpoints<br/>[venue.routes.ts]"]
end

subgraph group_domain["Backend services"]
  node_auth_service["Authentication service<br/>[auth.service.ts]"]
  node_event_service["Event service<br/>[event.service.ts]"]
  node_booking_service["Booking service<br/>[booking.service.ts]"]
  node_seat_lock["Seat hold service"]
  node_database[("PostgreSQL via Prisma<br/>[database.ts]")]
  node_cron["Scheduled cleanup<br/>[cron.ts]"]
end

node_visitor(("Visitor / user"))
node_payment_provider(("Payment provider"))

node_visitor -->|"uses"| node_app
node_app -->|"renders"| node_routes
node_routes -->|"routes to"| node_event_pages
node_routes -->|"routes to"| node_event_details
node_routes -->|"protects route"| node_booking_page
node_routes -->|"protects route"| node_payment_page
node_routes -->|"protects route"| node_booking_history
node_routes -->|"role-gates"| node_organizer
node_event_pages -->|"requests events"| node_event_api
node_event_details -->|"requests event"| node_event_api
node_organizer -->|"manages events"| node_event_api
node_booking_page -->|"renders seats"| node_seat_grid
node_booking_page -->|"loads availability"| node_event_api
node_booking_page -->|"submits booking"| node_booking_api
node_payment_page -->|"updates booking"| node_booking_api
node_booking_history -->|"loads bookings"| node_booking_api
node_auth_ui -->|"authenticates"| node_auth_api
node_auth_routes -->|"dispatches to"| node_auth_service
node_event_routes -->|"dispatches to"| node_event_service
node_booking_routes -->|"dispatches to"| node_booking_service
node_user_routes -.->|"dispatches to"| node_auth_service
node_venue_routes -->|"queries"| node_database
node_auth_service -->|"reads and writes"| node_database
node_booking_service -->|"reads and writes"| node_database
node_seat_lock -->|"locks seat records"| node_database
node_event_service -->|"reads and writes"| node_database
node_booking_service -.->|"uses holds"| node_seat_lock
node_backend -->|"mounts routes"| node_api_routes
node_backend -->|"starts jobs"| node_cron
node_cron -->|"cleans records"| node_database
node_payment_page -.->|"payment integration"| node_payment_provider

click node_app "https://github.com/kashishbhutia/booking-platform/blob/main/BookingPlatform/frontend/src/App.tsx"
click node_routes "https://github.com/kashishbhutia/booking-platform/blob/main/BookingPlatform/frontend/src/routes.tsx"
click node_event_pages "https://github.com/kashishbhutia/booking-platform/blob/main/BookingPlatform/frontend/src/pages/Events.tsx"
click node_event_details "https://github.com/kashishbhutia/booking-platform/blob/main/BookingPlatform/frontend/src/pages/EventDetails.tsx"
click node_organizer "https://github.com/kashishbhutia/booking-platform/blob/main/BookingPlatform/frontend/src/pages/organizer/OrganizerDashboard.tsx"
click node_event_api "https://github.com/kashishbhutia/booking-platform/blob/main/BookingPlatform/frontend/src/api/event.api.ts"
click node_booking_page "https://github.com/kashishbhutia/booking-platform/blob/main/BookingPlatform/frontend/src/pages/BookingPage.tsx"
click node_seat_grid "https://github.com/kashishbhutia/booking-platform/blob/main/BookingPlatform/frontend/src/components/booking/SeatGrid.tsx"
click node_payment_page "https://github.com/kashishbhutia/booking-platform/blob/main/BookingPlatform/frontend/src/pages/PaymentPage.tsx"
click node_booking_history "https://github.com/kashishbhutia/booking-platform/blob/main/BookingPlatform/frontend/src/pages/MyBookings.tsx"
click node_booking_api "https://github.com/kashishbhutia/booking-platform/blob/main/BookingPlatform/frontend/src/api/booking.api.ts"
click node_auth_ui "https://github.com/kashishbhutia/booking-platform/blob/main/BookingPlatform/frontend/src/context/AuthContext.tsx"
click node_auth_api "https://github.com/kashishbhutia/booking-platform/blob/main/BookingPlatform/frontend/src/api/auth.api.ts"
click node_user_api "https://github.com/kashishbhutia/booking-platform/blob/main/BookingPlatform/frontend/src/api/user.api.ts"
click node_backend "https://github.com/kashishbhutia/booking-platform/blob/main/BookingPlatform/backend/src/index.ts"
click node_api_routes "https://github.com/kashishbhutia/booking-platform/blob/main/BookingPlatform/backend/src/routes/index.ts"
click node_event_routes "https://github.com/kashishbhutia/booking-platform/blob/main/BookingPlatform/backend/src/routes/event.routes.ts"
click node_booking_routes "https://github.com/kashishbhutia/booking-platform/blob/main/BookingPlatform/backend/src/routes/booking.routes.ts"
click node_auth_routes "https://github.com/kashishbhutia/booking-platform/blob/main/BookingPlatform/backend/src/routes/auth.routes.ts"
click node_user_routes "https://github.com/kashishbhutia/booking-platform/blob/main/BookingPlatform/backend/src/routes/user.routes.ts"
click node_venue_routes "https://github.com/kashishbhutia/booking-platform/blob/main/BookingPlatform/backend/src/routes/venue.routes.ts"
click node_auth_service "https://github.com/kashishbhutia/booking-platform/blob/main/BookingPlatform/backend/src/services/auth.service.ts"
click node_event_service "https://github.com/kashishbhutia/booking-platform/blob/main/BookingPlatform/backend/src/services/event.service.ts"
click node_booking_service "https://github.com/kashishbhutia/booking-platform/blob/main/BookingPlatform/backend/src/services/booking.service.ts"
click node_seat_lock "https://github.com/kashishbhutia/booking-platform/blob/main/BookingPlatform/backend/src/services/seatLock.service.ts"
click node_database "https://github.com/kashishbhutia/booking-platform/blob/main/BookingPlatform/backend/src/config/database.ts"
click node_cron "https://github.com/kashishbhutia/booking-platform/blob/main/BookingPlatform/backend/src/jobs/cron.ts"

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_app,node_routes,node_event_pages,node_event_details,node_organizer,node_event_api,node_visitor toneBlue
class node_booking_page,node_seat_grid,node_payment_page,node_booking_history,node_booking_api toneAmber
class node_auth_ui,node_auth_api,node_user_api toneMint
class node_backend,node_api_routes,node_event_routes,node_booking_routes,node_auth_routes,node_user_routes,node_venue_routes toneRose
class node_auth_service,node_event_service,node_booking_service,node_seat_lock,node_database,node_cron,node_payment_provider toneIndigo
```

## Components

### Event discovery

- [Web application](https://github.com/kashishbhutia/booking-platform/blob/main/BookingPlatform/frontend/src/App.tsx): `BookingPlatform/frontend/src/App.tsx`
- [Page routing](https://github.com/kashishbhutia/booking-platform/blob/main/BookingPlatform/frontend/src/routes.tsx): `BookingPlatform/frontend/src/routes.tsx`
- [Event browsing](https://github.com/kashishbhutia/booking-platform/blob/main/BookingPlatform/frontend/src/pages/Events.tsx): `BookingPlatform/frontend/src/pages/Events.tsx`
- [Event details](https://github.com/kashishbhutia/booking-platform/blob/main/BookingPlatform/frontend/src/pages/EventDetails.tsx): `BookingPlatform/frontend/src/pages/EventDetails.tsx`
- [Organizer tools](https://github.com/kashishbhutia/booking-platform/blob/main/BookingPlatform/frontend/src/pages/organizer/OrganizerDashboard.tsx): `BookingPlatform/frontend/src/pages/organizer/OrganizerDashboard.tsx`
- [Event API client](https://github.com/kashishbhutia/booking-platform/blob/main/BookingPlatform/frontend/src/api/event.api.ts): `BookingPlatform/frontend/src/api/event.api.ts`

### Ticket booking

- [Seat selection](https://github.com/kashishbhutia/booking-platform/blob/main/BookingPlatform/frontend/src/pages/BookingPage.tsx): `BookingPlatform/frontend/src/pages/BookingPage.tsx`
- [Interactive seat map](https://github.com/kashishbhutia/booking-platform/blob/main/BookingPlatform/frontend/src/components/booking/SeatGrid.tsx): `BookingPlatform/frontend/src/components/booking/SeatGrid.tsx`
- [Payment page](https://github.com/kashishbhutia/booking-platform/blob/main/BookingPlatform/frontend/src/pages/PaymentPage.tsx): `BookingPlatform/frontend/src/pages/PaymentPage.tsx`
- [Booking history](https://github.com/kashishbhutia/booking-platform/blob/main/BookingPlatform/frontend/src/pages/MyBookings.tsx): `BookingPlatform/frontend/src/pages/MyBookings.tsx`
- [Booking API client](https://github.com/kashishbhutia/booking-platform/blob/main/BookingPlatform/frontend/src/api/booking.api.ts): `BookingPlatform/frontend/src/api/booking.api.ts`

### Accounts and operations

- [Authentication state](https://github.com/kashishbhutia/booking-platform/blob/main/BookingPlatform/frontend/src/context/AuthContext.tsx): `BookingPlatform/frontend/src/context/AuthContext.tsx`
- [Authentication client](https://github.com/kashishbhutia/booking-platform/blob/main/BookingPlatform/frontend/src/api/auth.api.ts): `BookingPlatform/frontend/src/api/auth.api.ts`
- [User API client](https://github.com/kashishbhutia/booking-platform/blob/main/BookingPlatform/frontend/src/api/user.api.ts): `BookingPlatform/frontend/src/api/user.api.ts`

### Backend API

- [Express API](https://github.com/kashishbhutia/booking-platform/blob/main/BookingPlatform/backend/src/index.ts): `BookingPlatform/backend/src/index.ts`
- [API route aggregation](https://github.com/kashishbhutia/booking-platform/blob/main/BookingPlatform/backend/src/routes/index.ts): `BookingPlatform/backend/src/routes/index.ts`
- [Event endpoints](https://github.com/kashishbhutia/booking-platform/blob/main/BookingPlatform/backend/src/routes/event.routes.ts): `BookingPlatform/backend/src/routes/event.routes.ts`
- [Booking endpoints](https://github.com/kashishbhutia/booking-platform/blob/main/BookingPlatform/backend/src/routes/booking.routes.ts): `BookingPlatform/backend/src/routes/booking.routes.ts`
- [Authentication endpoints](https://github.com/kashishbhutia/booking-platform/blob/main/BookingPlatform/backend/src/routes/auth.routes.ts): `BookingPlatform/backend/src/routes/auth.routes.ts`
- [User endpoints](https://github.com/kashishbhutia/booking-platform/blob/main/BookingPlatform/backend/src/routes/user.routes.ts): `BookingPlatform/backend/src/routes/user.routes.ts`
- [Venue endpoints](https://github.com/kashishbhutia/booking-platform/blob/main/BookingPlatform/backend/src/routes/venue.routes.ts): `BookingPlatform/backend/src/routes/venue.routes.ts`

### Backend services

- [Authentication service](https://github.com/kashishbhutia/booking-platform/blob/main/BookingPlatform/backend/src/services/auth.service.ts): `BookingPlatform/backend/src/services/auth.service.ts`
- [Event service](https://github.com/kashishbhutia/booking-platform/blob/main/BookingPlatform/backend/src/services/event.service.ts): `BookingPlatform/backend/src/services/event.service.ts`
- [Booking service](https://github.com/kashishbhutia/booking-platform/blob/main/BookingPlatform/backend/src/services/booking.service.ts): `BookingPlatform/backend/src/services/booking.service.ts`
- [Seat hold service](https://github.com/kashishbhutia/booking-platform/blob/main/BookingPlatform/backend/src/services/seatLock.service.ts): `BookingPlatform/backend/src/services/seatLock.service.ts`
- [PostgreSQL via Prisma](https://github.com/kashishbhutia/booking-platform/blob/main/BookingPlatform/backend/src/config/database.ts): `BookingPlatform/backend/src/config/database.ts`
- [Scheduled cleanup](https://github.com/kashishbhutia/booking-platform/blob/main/BookingPlatform/backend/src/jobs/cron.ts): `BookingPlatform/backend/src/jobs/cron.ts`

### Other components

- **Visitor / user**
- **Payment provider**

## Connections

- Visitor / user → Web application: uses (evidence: `BookingPlatform/frontend/src/App.tsx`)
- Web application → Page routing: renders (evidence: `BookingPlatform/frontend/src/App.tsx`)
- Page routing → Event browsing: routes to (evidence: `BookingPlatform/frontend/src/routes.tsx`)
- Page routing → Event details: routes to (evidence: `BookingPlatform/frontend/src/routes.tsx`)
- Page routing → Seat selection: protects route (evidence: `BookingPlatform/frontend/src/routes.tsx`)
- Page routing → Payment page: protects route (evidence: `BookingPlatform/frontend/src/routes.tsx`)
- Page routing → Booking history: protects route (evidence: `BookingPlatform/frontend/src/routes.tsx`)
- Page routing → Organizer tools: role-gates (evidence: `BookingPlatform/frontend/src/routes.tsx`)
- Event browsing → Event API client: requests events (evidence: `BookingPlatform/frontend/src/pages/Events.tsx`)
- Event details → Event API client: requests event (evidence: `BookingPlatform/frontend/src/pages/EventDetails.tsx`)
- Organizer tools → Event API client: manages events (evidence: `BookingPlatform/frontend/src/pages/organizer/OrganizerDashboard.tsx`)
- Seat selection → Interactive seat map: renders seats (evidence: `BookingPlatform/frontend/src/pages/BookingPage.tsx`)
- Seat selection → Event API client: loads availability (evidence: `BookingPlatform/frontend/src/pages/BookingPage.tsx`)
- Seat selection → Booking API client: submits booking (evidence: `BookingPlatform/frontend/src/pages/BookingPage.tsx`)
- Payment page → Booking API client: updates booking (evidence: `BookingPlatform/frontend/src/pages/PaymentPage.tsx`)
- Booking history → Booking API client: loads bookings (evidence: `BookingPlatform/frontend/src/pages/MyBookings.tsx`)
- Authentication state → Authentication client: authenticates (evidence: `BookingPlatform/frontend/src/context/AuthContext.tsx`)
- Authentication endpoints → Authentication service: dispatches to (evidence: `BookingPlatform/backend/src/routes/auth.routes.ts`)
- Event endpoints → Event service: dispatches to (evidence: `BookingPlatform/backend/src/routes/event.routes.ts`)
- Booking endpoints → Booking service: dispatches to (evidence: `BookingPlatform/backend/src/routes/booking.routes.ts`)
- User endpoints → Authentication service: dispatches to
- Venue endpoints → PostgreSQL via Prisma: queries (evidence: `BookingPlatform/backend/src/routes/venue.routes.ts`)
- Authentication service → PostgreSQL via Prisma: reads and writes (evidence: `BookingPlatform/backend/src/services/auth.service.ts`)
- Booking service → PostgreSQL via Prisma: reads and writes (evidence: `BookingPlatform/backend/src/services/booking.service.ts`)
- Seat hold service → PostgreSQL via Prisma: locks seat records (evidence: `BookingPlatform/backend/src/services/seatLock.service.ts`)
- Event service → PostgreSQL via Prisma: reads and writes (evidence: `BookingPlatform/backend/src/services/event.service.ts`)
- Booking service → Seat hold service: uses holds (evidence: `BookingPlatform/backend/src/services/booking.service.ts`)
- Express API → API route aggregation: mounts routes
- Express API → Scheduled cleanup: starts jobs
- Scheduled cleanup → PostgreSQL via Prisma: cleans records (evidence: `BookingPlatform/backend/src/jobs/cron.ts`)
- Payment page → Payment provider: payment integration
