# thaihoc1310/ticket-rush architecture

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

- Interactive diagram: https://gitdiagram.com/thaihoc1310/ticket-rush
- Repository: https://github.com/thaihoc1310/ticket-rush

## Overview

TicketRush is an event-ticketing platform. Customers browse events, select seats, join a virtual queue when sales are constrained, book and pay, then access tickets; administrators manage events, venues, seating, users, payments, and queue activity. The backend separates HTTP routing from domain services and also runs scheduled jobs and WebSocket/pub-sub features. The README confirms the product capabilities and PostgreSQL/Redis stack; sampled backend files support several route-to-service links. Frontend page-to-API wiring and some backend internals were not sampled, so those relationships are omitted or marked unverified.

Main entry points: [`backend/app/main.py`](https://github.com/thaihoc1310/ticket-rush/blob/main/backend/app/main.py) (HTTP API), [`frontend/src/App.tsx`](https://github.com/thaihoc1310/ticket-rush/blob/main/frontend/src/App.tsx) (Web app), [`frontend/src/pages/admin/DashboardPage.tsx`](https://github.com/thaihoc1310/ticket-rush/blob/main/frontend/src/pages/admin/DashboardPage.tsx) (Admin portal), [`backend/app/routers/auth.py`](https://github.com/thaihoc1310/ticket-rush/blob/main/backend/app/routers/auth.py) (Authentication)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_customer_app["Customer app"]
  node_web_app["Web app<br/>[App.tsx]"]
  node_event_browsing["Event browsing<br/>[EventListPage.tsx]"]
  node_seat_selection["Seat selection"]
  node_waiting_room["Virtual queue"]
  node_checkout["Checkout<br/>[CheckoutPage.tsx]"]
  node_ticket_access["Ticket access<br/>[MyTicketsPage.tsx]"]
end

subgraph group_admin_app["Admin app"]
  node_admin_portal["Admin portal<br/>[DashboardPage.tsx]"]
end

subgraph group_catalog_backend["Catalog backend"]
  node_http_api["HTTP API<br/>[main.py]"]
  node_event_management["Event management<br/>[events.py]"]
  node_venue_management["Venue management<br/>[venues.py]"]
  node_auth["Authentication<br/>[auth.py]"]
  node_auth_service["Auth service<br/>[auth_service.py]"]
end

subgraph group_sales_backend["Booking backend"]
  node_booking_routes["Booking routes<br/>[bookings.py]"]
  node_booking_service["Booking service<br/>[booking_service.py]"]
  node_payment_routes["Payment routes<br/>[payments.py]"]
end

subgraph group_realtime_ops["Realtime operations"]
  node_queue_routes["Queue routes<br/>[queue.py]"]
  node_websocket_channels["WebSocket channels<br/>[queue_ws.py]"]
  node_scheduler["Scheduled jobs<br/>[setup.py]"]
end

subgraph group_platform_data["Platform data"]
  node_database_layer["Database access<br/>[database.py]"]
  node_postgres[("PostgreSQL")]
  node_redis["Redis client<br/>[redis.py]"]
end

node_visitor(("Customer"))
node_admin(("Administrator"))

node_visitor -.->|"uses"| node_web_app
node_admin -.->|"uses"| node_admin_portal
node_web_app -.->|"presents"| node_event_browsing
node_web_app -.->|"presents"| node_seat_selection
node_web_app -.->|"presents"| node_waiting_room
node_web_app -.->|"presents"| node_checkout
node_web_app -.->|"presents"| node_ticket_access
node_web_app -.->|"calls"| node_http_api
node_admin_portal -.->|"calls"| node_http_api
node_http_api -->|"routes"| node_auth
node_http_api -->|"routes"| node_event_management
node_http_api -->|"routes"| node_venue_management
node_http_api -->|"routes"| node_booking_routes
node_http_api -->|"routes"| node_payment_routes
node_http_api -->|"routes"| node_queue_routes
node_http_api -->|"registers"| node_websocket_channels
node_http_api -->|"starts"| node_scheduler
node_auth -->|"calls"| node_auth_service
node_booking_routes -->|"calls"| node_booking_service
node_database_layer -->|"connects"| node_postgres

click node_web_app "https://github.com/thaihoc1310/ticket-rush/blob/main/frontend/src/App.tsx"
click node_event_browsing "https://github.com/thaihoc1310/ticket-rush/blob/main/frontend/src/pages/public/EventListPage.tsx"
click node_seat_selection "https://github.com/thaihoc1310/ticket-rush/blob/main/frontend/src/pages/booking/SeatSelectionPage.tsx"
click node_waiting_room "https://github.com/thaihoc1310/ticket-rush/blob/main/frontend/src/pages/booking/WaitingRoomPage.tsx"
click node_checkout "https://github.com/thaihoc1310/ticket-rush/blob/main/frontend/src/pages/booking/CheckoutPage.tsx"
click node_ticket_access "https://github.com/thaihoc1310/ticket-rush/blob/main/frontend/src/pages/customer/MyTicketsPage.tsx"
click node_admin_portal "https://github.com/thaihoc1310/ticket-rush/blob/main/frontend/src/pages/admin/DashboardPage.tsx"
click node_http_api "https://github.com/thaihoc1310/ticket-rush/blob/main/backend/app/main.py"
click node_event_management "https://github.com/thaihoc1310/ticket-rush/blob/main/backend/app/routers/events.py"
click node_venue_management "https://github.com/thaihoc1310/ticket-rush/blob/main/backend/app/routers/venues.py"
click node_auth "https://github.com/thaihoc1310/ticket-rush/blob/main/backend/app/routers/auth.py"
click node_auth_service "https://github.com/thaihoc1310/ticket-rush/blob/main/backend/app/services/auth_service.py"
click node_booking_routes "https://github.com/thaihoc1310/ticket-rush/blob/main/backend/app/routers/bookings.py"
click node_booking_service "https://github.com/thaihoc1310/ticket-rush/blob/main/backend/app/services/booking_service.py"
click node_payment_routes "https://github.com/thaihoc1310/ticket-rush/blob/main/backend/app/routers/payments.py"
click node_queue_routes "https://github.com/thaihoc1310/ticket-rush/blob/main/backend/app/routers/queue.py"
click node_websocket_channels "https://github.com/thaihoc1310/ticket-rush/blob/main/backend/app/ws/queue_ws.py"
click node_scheduler "https://github.com/thaihoc1310/ticket-rush/blob/main/backend/app/scheduler/setup.py"
click node_database_layer "https://github.com/thaihoc1310/ticket-rush/blob/main/backend/app/database.py"
click node_redis "https://github.com/thaihoc1310/ticket-rush/blob/main/backend/app/redis.py"

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_web_app,node_event_browsing,node_seat_selection,node_waiting_room,node_checkout,node_ticket_access toneBlue
class node_admin_portal toneAmber
class node_http_api,node_event_management,node_venue_management,node_auth,node_auth_service toneMint
class node_booking_routes,node_booking_service,node_payment_routes toneRose
class node_queue_routes,node_websocket_channels,node_scheduler,node_visitor,node_admin toneIndigo
class node_database_layer,node_postgres,node_redis toneTeal
```

## Components

### Customer app

- [Web app](https://github.com/thaihoc1310/ticket-rush/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Event browsing](https://github.com/thaihoc1310/ticket-rush/blob/main/frontend/src/pages/public/EventListPage.tsx): `frontend/src/pages/public/EventListPage.tsx`
- [Seat selection](https://github.com/thaihoc1310/ticket-rush/blob/main/frontend/src/pages/booking/SeatSelectionPage.tsx): `frontend/src/pages/booking/SeatSelectionPage.tsx`
- [Virtual queue](https://github.com/thaihoc1310/ticket-rush/blob/main/frontend/src/pages/booking/WaitingRoomPage.tsx): `frontend/src/pages/booking/WaitingRoomPage.tsx`
- [Checkout](https://github.com/thaihoc1310/ticket-rush/blob/main/frontend/src/pages/booking/CheckoutPage.tsx): `frontend/src/pages/booking/CheckoutPage.tsx`
- [Ticket access](https://github.com/thaihoc1310/ticket-rush/blob/main/frontend/src/pages/customer/MyTicketsPage.tsx): `frontend/src/pages/customer/MyTicketsPage.tsx`

### Admin app

- [Admin portal](https://github.com/thaihoc1310/ticket-rush/blob/main/frontend/src/pages/admin/DashboardPage.tsx): `frontend/src/pages/admin/DashboardPage.tsx`

### Catalog backend

- [HTTP API](https://github.com/thaihoc1310/ticket-rush/blob/main/backend/app/main.py): `backend/app/main.py`
- [Event management](https://github.com/thaihoc1310/ticket-rush/blob/main/backend/app/routers/events.py): `backend/app/routers/events.py`
- [Venue management](https://github.com/thaihoc1310/ticket-rush/blob/main/backend/app/routers/venues.py): `backend/app/routers/venues.py`
- [Authentication](https://github.com/thaihoc1310/ticket-rush/blob/main/backend/app/routers/auth.py): `backend/app/routers/auth.py`
- [Auth service](https://github.com/thaihoc1310/ticket-rush/blob/main/backend/app/services/auth_service.py): `backend/app/services/auth_service.py`

### Booking backend

- [Booking routes](https://github.com/thaihoc1310/ticket-rush/blob/main/backend/app/routers/bookings.py): `backend/app/routers/bookings.py`
- [Booking service](https://github.com/thaihoc1310/ticket-rush/blob/main/backend/app/services/booking_service.py): `backend/app/services/booking_service.py`
- [Payment routes](https://github.com/thaihoc1310/ticket-rush/blob/main/backend/app/routers/payments.py): `backend/app/routers/payments.py`

### Realtime operations

- [Queue routes](https://github.com/thaihoc1310/ticket-rush/blob/main/backend/app/routers/queue.py): `backend/app/routers/queue.py`
- [WebSocket channels](https://github.com/thaihoc1310/ticket-rush/blob/main/backend/app/ws/queue_ws.py): `backend/app/ws/queue_ws.py`
- [Scheduled jobs](https://github.com/thaihoc1310/ticket-rush/blob/main/backend/app/scheduler/setup.py): `backend/app/scheduler/setup.py`

### Platform data

- [Database access](https://github.com/thaihoc1310/ticket-rush/blob/main/backend/app/database.py): `backend/app/database.py`
- **PostgreSQL**
- [Redis client](https://github.com/thaihoc1310/ticket-rush/blob/main/backend/app/redis.py): `backend/app/redis.py`

### Other components

- **Customer**
- **Administrator**

## Connections

- Customer → Web app: uses
- Administrator → Admin portal: uses
- Web app → Event browsing: presents
- Web app → Seat selection: presents
- Web app → Virtual queue: presents
- Web app → Checkout: presents
- Web app → Ticket access: presents
- Web app → HTTP API: calls
- Admin portal → HTTP API: calls
- HTTP API → Authentication: routes (evidence: `backend/app/main.py`)
- HTTP API → Event management: routes (evidence: `backend/app/main.py`)
- HTTP API → Venue management: routes (evidence: `backend/app/main.py`)
- HTTP API → Booking routes: routes (evidence: `backend/app/main.py`)
- HTTP API → Payment routes: routes (evidence: `backend/app/main.py`)
- HTTP API → Queue routes: routes (evidence: `backend/app/main.py`)
- HTTP API → WebSocket channels: registers (evidence: `backend/app/main.py`)
- HTTP API → Scheduled jobs: starts (evidence: `backend/app/main.py`)
- Authentication → Auth service: calls (evidence: `backend/app/routers/auth.py`)
- Booking routes → Booking service: calls (evidence: `backend/app/routers/bookings.py`)
- Database access → PostgreSQL: connects (evidence: `backend/app/database.py`)
