# aditya9-2/booktheshow-fe architecture

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

- Interactive diagram: https://gitdiagram.com/aditya9-2/booktheshow-fe
- Repository: https://github.com/aditya9-2/booktheshow-fe

## Overview

This is a ticketing/events frontend: visitors discover events, authenticate to book and pay, then review bookings or wallet balance; admins manage event listings, and signed-in users can ask an AI event concierge. The app routes these screens through a shared API client and authentication state. The README describes only the Vite template, so product capabilities are inferred from routes and the source index. Several page implementations are unsampled; their API relationships are included only where the API client or booking excerpt documents them.

Main entry points: [`src/App.tsx`](https://github.com/aditya9-2/booktheshow-fe/blob/main/src/App.tsx) (Route shell), [`src/lib/api.ts`](https://github.com/aditya9-2/booktheshow-fe/blob/main/src/lib/api.ts) (HTTP API client), [`src/pages/AskAI.tsx`](https://github.com/aditya9-2/booktheshow-fe/blob/main/src/pages/AskAI.tsx) (AI concierge), [`src/pages/BookTickets.tsx`](https://github.com/aditya9-2/booktheshow-fe/blob/main/src/pages/BookTickets.tsx) (Ticket booking)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App and discovery"]
  node_app["Route shell<br/>[App.tsx]"]
  node_discovery["Event discovery<br/>[Events.tsx]"]
  node_eventdetail["Event details<br/>[EventDetail.tsx]"]
  node_ai["AI concierge<br/>[AskAI.tsx]"]
end

subgraph group_identity["Identity"]
  node_authpages["Sign in and signup<br/>[SignIn.tsx]"]
  node_authstate["Authentication state<br/>[authStore.ts]"]
  node_session[("Session storage<br/>[auth.ts]")]
end

subgraph group_commerce["Booking and wallet"]
  node_booking["Ticket booking<br/>[BookTickets.tsx]"]
  node_bookings["My bookings<br/>[MyBookings.tsx]"]
  node_wallet["Wallet<br/>[Wallet.tsx]"]
  node_payment["Payment provider"]
end

subgraph group_admin["Event administration"]
  node_adminpanel["Admin panel<br/>[AdminPanel.tsx]"]
  node_eventform["Create event<br/>[CreateEvent.tsx]"]
  node_manageevents["Manage events<br/>[ManageEvents.tsx]"]
  node_eventformui["Event editor<br/>[EventForm.tsx]"]
end

subgraph group_services["Client services"]
  node_api["HTTP API client<br/>[api.ts]"]
  node_chatstream["Chat stream<br/>[chatStream.ts]"]
  node_chatstate["Chat state<br/>[chatStore.ts]"]
  node_ticket["Ticket generation<br/>[generateTicket.ts]"]
  node_types["Domain types<br/>[types.ts]"]
end

node_visitor(("Visitor"))

node_visitor -->|"opens"| node_app
node_app -->|"routes to"| node_discovery
node_app -->|"routes to"| node_eventdetail
node_app -->|"guards and routes"| node_booking
node_app -->|"guards and routes"| node_bookings
node_app -->|"routes to"| node_authpages
node_app -->|"guards and routes"| node_ai
node_app -->|"guards and routes"| node_wallet
node_app -->|"guards and routes"| node_adminpanel
node_app -->|"guards and routes"| node_eventform
node_app -->|"guards and routes"| node_manageevents
node_authpages -->|"authenticates via"| node_api
node_authpages -->|"updates"| node_authstate
node_authstate -->|"reads and writes"| node_session
node_booking -->|"loads and books"| node_api
node_booking -->|"opens checkout"| node_payment
node_booking -->|"navigates after payment"| node_bookings
node_discovery -->|"loads events"| node_api
node_eventdetail -->|"loads event"| node_api
node_bookings -->|"loads bookings"| node_api
node_bookings -->|"generates tickets"| node_ticket
node_wallet -->|"reads and funds"| node_api
node_eventform -->|"renders"| node_eventformui
node_eventform -->|"creates event"| node_api
node_manageevents -->|"renders"| node_eventformui
node_manageevents -->|"manages events"| node_api
node_ai -->|"streams prompts"| node_chatstream
node_ai -->|"loads history"| node_api
node_ai -->|"updates"| node_chatstate
node_api -->|"gets token"| node_session
node_authstate -->|"resets on auth change"| node_chatstate
node_chatstream -->|"gets token"| node_session
node_api -->|"uses contracts"| node_types
node_chatstream -->|"uses contracts"| node_types
node_ticket -->|"uses booking types"| node_types
node_eventformui -->|"uses event types"| node_types

click node_app "https://github.com/aditya9-2/booktheshow-fe/blob/main/src/App.tsx"
click node_discovery "https://github.com/aditya9-2/booktheshow-fe/blob/main/src/pages/Events.tsx"
click node_eventdetail "https://github.com/aditya9-2/booktheshow-fe/blob/main/src/pages/EventDetail.tsx"
click node_ai "https://github.com/aditya9-2/booktheshow-fe/blob/main/src/pages/AskAI.tsx"
click node_authpages "https://github.com/aditya9-2/booktheshow-fe/blob/main/src/pages/SignIn.tsx"
click node_authstate "https://github.com/aditya9-2/booktheshow-fe/blob/main/src/store/authStore.ts"
click node_session "https://github.com/aditya9-2/booktheshow-fe/blob/main/src/lib/auth.ts"
click node_booking "https://github.com/aditya9-2/booktheshow-fe/blob/main/src/pages/BookTickets.tsx"
click node_bookings "https://github.com/aditya9-2/booktheshow-fe/blob/main/src/pages/MyBookings.tsx"
click node_wallet "https://github.com/aditya9-2/booktheshow-fe/blob/main/src/pages/Wallet.tsx"
click node_adminpanel "https://github.com/aditya9-2/booktheshow-fe/blob/main/src/pages/admin/AdminPanel.tsx"
click node_eventform "https://github.com/aditya9-2/booktheshow-fe/blob/main/src/pages/admin/CreateEvent.tsx"
click node_manageevents "https://github.com/aditya9-2/booktheshow-fe/blob/main/src/pages/admin/ManageEvents.tsx"
click node_eventformui "https://github.com/aditya9-2/booktheshow-fe/blob/main/src/components/EventForm.tsx"
click node_api "https://github.com/aditya9-2/booktheshow-fe/blob/main/src/lib/api.ts"
click node_chatstream "https://github.com/aditya9-2/booktheshow-fe/blob/main/src/lib/chatStream.ts"
click node_chatstate "https://github.com/aditya9-2/booktheshow-fe/blob/main/src/store/chatStore.ts"
click node_ticket "https://github.com/aditya9-2/booktheshow-fe/blob/main/src/lib/generateTicket.ts"
click node_types "https://github.com/aditya9-2/booktheshow-fe/blob/main/src/lib/types.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_discovery,node_eventdetail,node_ai toneBlue
class node_authpages,node_authstate,node_session toneAmber
class node_booking,node_bookings,node_wallet,node_payment toneMint
class node_adminpanel,node_eventform,node_manageevents,node_eventformui toneRose
class node_api,node_chatstream,node_chatstate,node_ticket,node_types,node_visitor toneIndigo
```

## Components

### App and discovery

- [Route shell](https://github.com/aditya9-2/booktheshow-fe/blob/main/src/App.tsx): `src/App.tsx`
- [Event discovery](https://github.com/aditya9-2/booktheshow-fe/blob/main/src/pages/Events.tsx): `src/pages/Events.tsx`
- [Event details](https://github.com/aditya9-2/booktheshow-fe/blob/main/src/pages/EventDetail.tsx): `src/pages/EventDetail.tsx`
- [AI concierge](https://github.com/aditya9-2/booktheshow-fe/blob/main/src/pages/AskAI.tsx): `src/pages/AskAI.tsx`

### Identity

- [Sign in and signup](https://github.com/aditya9-2/booktheshow-fe/blob/main/src/pages/SignIn.tsx): `src/pages/SignIn.tsx`
- [Authentication state](https://github.com/aditya9-2/booktheshow-fe/blob/main/src/store/authStore.ts): `src/store/authStore.ts`
- [Session storage](https://github.com/aditya9-2/booktheshow-fe/blob/main/src/lib/auth.ts): `src/lib/auth.ts`

### Booking and wallet

- [Ticket booking](https://github.com/aditya9-2/booktheshow-fe/blob/main/src/pages/BookTickets.tsx): `src/pages/BookTickets.tsx`
- [My bookings](https://github.com/aditya9-2/booktheshow-fe/blob/main/src/pages/MyBookings.tsx): `src/pages/MyBookings.tsx`
- [Wallet](https://github.com/aditya9-2/booktheshow-fe/blob/main/src/pages/Wallet.tsx): `src/pages/Wallet.tsx`
- **Payment provider**

### Event administration

- [Admin panel](https://github.com/aditya9-2/booktheshow-fe/blob/main/src/pages/admin/AdminPanel.tsx): `src/pages/admin/AdminPanel.tsx`
- [Create event](https://github.com/aditya9-2/booktheshow-fe/blob/main/src/pages/admin/CreateEvent.tsx): `src/pages/admin/CreateEvent.tsx`
- [Manage events](https://github.com/aditya9-2/booktheshow-fe/blob/main/src/pages/admin/ManageEvents.tsx): `src/pages/admin/ManageEvents.tsx`
- [Event editor](https://github.com/aditya9-2/booktheshow-fe/blob/main/src/components/EventForm.tsx): `src/components/EventForm.tsx`

### Client services

- [HTTP API client](https://github.com/aditya9-2/booktheshow-fe/blob/main/src/lib/api.ts): `src/lib/api.ts`
- [Chat stream](https://github.com/aditya9-2/booktheshow-fe/blob/main/src/lib/chatStream.ts): `src/lib/chatStream.ts`
- [Chat state](https://github.com/aditya9-2/booktheshow-fe/blob/main/src/store/chatStore.ts): `src/store/chatStore.ts`
- [Ticket generation](https://github.com/aditya9-2/booktheshow-fe/blob/main/src/lib/generateTicket.ts): `src/lib/generateTicket.ts`
- [Domain types](https://github.com/aditya9-2/booktheshow-fe/blob/main/src/lib/types.ts): `src/lib/types.ts`

### Other components

- **Visitor**

## Connections

- Visitor → Route shell: opens (evidence: `src/App.tsx`)
- Route shell → Event discovery: routes to (evidence: `src/App.tsx`)
- Route shell → Event details: routes to (evidence: `src/App.tsx`)
- Route shell → Ticket booking: guards and routes (evidence: `src/App.tsx`)
- Route shell → My bookings: guards and routes (evidence: `src/App.tsx`)
- Route shell → Sign in and signup: routes to (evidence: `src/App.tsx`)
- Route shell → AI concierge: guards and routes (evidence: `src/App.tsx`)
- Route shell → Wallet: guards and routes (evidence: `src/App.tsx`)
- Route shell → Admin panel: guards and routes (evidence: `src/App.tsx`)
- Route shell → Create event: guards and routes (evidence: `src/App.tsx`)
- Route shell → Manage events: guards and routes (evidence: `src/App.tsx`)
- Sign in and signup → HTTP API client: authenticates via (evidence: `src/pages/SignIn.tsx`)
- Sign in and signup → Authentication state: updates (evidence: `src/store/authStore.ts`)
- Authentication state → Session storage: reads and writes (evidence: `src/store/authStore.ts`)
- Ticket booking → HTTP API client: loads and books (evidence: `src/pages/BookTickets.tsx`)
- Ticket booking → Payment provider: opens checkout (evidence: `src/pages/BookTickets.tsx`)
- Ticket booking → My bookings: navigates after payment (evidence: `src/pages/BookTickets.tsx`)
- Event discovery → HTTP API client: loads events (evidence: `src/lib/api.ts`)
- Event details → HTTP API client: loads event (evidence: `src/pages/EventDetail.tsx`)
- My bookings → HTTP API client: loads bookings (evidence: `src/lib/api.ts`)
- My bookings → Ticket generation: generates tickets (evidence: `src/pages/MyBookings.tsx`)
- Wallet → HTTP API client: reads and funds (evidence: `src/lib/api.ts`)
- Create event → Event editor: renders (evidence: `src/pages/admin/CreateEvent.tsx`)
- Create event → HTTP API client: creates event (evidence: `src/pages/admin/CreateEvent.tsx`)
- Manage events → Event editor: renders (evidence: `src/pages/admin/ManageEvents.tsx`)
- Manage events → HTTP API client: manages events (evidence: `src/pages/admin/ManageEvents.tsx`)
- AI concierge → Chat stream: streams prompts (evidence: `src/pages/AskAI.tsx`)
- AI concierge → HTTP API client: loads history (evidence: `src/pages/AskAI.tsx`)
- AI concierge → Chat state: updates (evidence: `src/pages/AskAI.tsx`)
- HTTP API client → Session storage: gets token (evidence: `src/lib/api.ts`)
- Authentication state → Chat state: resets on auth change (evidence: `src/store/authStore.ts`)
- Chat stream → Session storage: gets token (evidence: `src/lib/chatStream.ts`)
- HTTP API client → Domain types: uses contracts (evidence: `src/lib/api.ts`)
- Chat stream → Domain types: uses contracts (evidence: `src/lib/chatStream.ts`)
- Ticket generation → Domain types: uses booking types (evidence: `src/lib/generateTicket.ts`)
- Event editor → Domain types: uses event types (evidence: `src/components/EventForm.tsx`)
