# induwara1006/enterprise-cinema-booking-platform architecture

> Architecture diagram of the GitHub repository induwara1006/enterprise-cinema-booking-platform, 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/induwara1006/enterprise-cinema-booking-platform
- Repository: https://github.com/induwara1006/enterprise-cinema-booking-platform

## Overview

CineBook is a multi-tenant cinema booking platform. Customers browse cinemas and showtimes, select seats held with live availability updates, pay through PayPal, and receive confirmed tickets; users can also manage bookings and reviews. Cinema and platform administrators manage listings, showtimes, applications, and reporting. The graph preserves these documented capabilities while distinguishing frontend routing/API access from backend controllers, services, and MongoDB models. Some feature modules are represented by their exact tree paths but were not sampled, so their internal call relationships are not asserted.

Main entry points: [`backend/src/server.ts`](https://github.com/induwara1006/enterprise-cinema-booking-platform/blob/main/backend/src/server.ts) (Express server), [`backend/src/controllers/paymentController.ts`](https://github.com/induwara1006/enterprise-cinema-booking-platform/blob/main/backend/src/controllers/paymentController.ts) (Payment workflow), [`frontend/src/services/api.ts`](https://github.com/induwara1006/enterprise-cinema-booking-platform/blob/main/frontend/src/services/api.ts) (HTTP API client), [`frontend/src/App.tsx`](https://github.com/induwara1006/enterprise-cinema-booking-platform/blob/main/frontend/src/App.tsx) (Web app routing)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Customer application"]
  node_app["Web app routing<br/>[App.tsx]"]
  node_authui["Auth and profile<br/>[AuthContext.tsx]"]
  node_api["HTTP API client<br/>[api.ts]"]
  node_bookingui["Seat booking UI<br/>[BookingContext.tsx]"]
  node_paymentui["Payment screens<br/>[Payment.tsx]"]
end

subgraph group_catalog["Cinema catalog"]
  node_catalogui["Movie and cinema views<br/>[MovieDetail.tsx]"]
  node_movies["Movie catalog<br/>[movieController.ts]"]
  node_cinemas["Cinema management"]
  node_showtimes["Showtime management"]
end

subgraph group_booking["Reservations and payment"]
  node_seats["Seat availability<br/>[seatController.ts]"]
  node_bookings["Booking workflow"]
  node_payments["Payment workflow"]
  node_realtime["Seat event service<br/>[websocket.ts]"]
  node_expiry["Hold cleanup<br/>[seatCleanup.ts]"]
end

subgraph group_identity["Identity and feedback"]
  node_reviewui["Reviews and ratings<br/>[ReviewForm.tsx]"]
  node_auth["JWT and role checks<br/>[auth.ts]"]
  node_users["User accounts<br/>[userController.ts]"]
  node_revs["Review moderation"]
end

subgraph group_operations["Administration and platform"]
  node_server["Express server<br/>[server.ts]"]
  node_applications["Cinema applications"]
  node_analytics["Admin analytics"]
  node_email["Email delivery<br/>[email.ts]"]
end

node_customer(("Customer"))
node_paypal["PayPal checkout"]
node_mongo[("MongoDB")]

node_customer -->|"uses"| node_app
node_app -->|"provides auth"| node_authui
node_app -->|"routes booking"| node_bookingui
node_app -->|"routes catalog"| node_catalogui
node_bookingui -->|"requests data"| node_api
node_paymentui -->|"requests payment"| node_api
node_reviewui -->|"submits reviews"| node_api
node_authui -->|"auth requests"| node_api
node_api -->|"HTTP requests"| node_server
node_server -->|"mounts routes"| node_movies
node_server -->|"mounts routes"| node_cinemas
node_server -->|"mounts routes"| node_showtimes
node_server -->|"mounts routes"| node_seats
node_server -->|"mounts routes"| node_bookings
node_server -->|"mounts routes"| node_payments
node_server -->|"mounts routes"| node_revs
node_server -->|"mounts routes"| node_users
node_server -->|"routes requests"| node_applications
node_server -->|"initializes"| node_realtime
node_bookings -->|"broadcasts updates"| node_realtime
node_seats -->|"broadcasts availability"| node_realtime
node_server -->|"starts cleanup"| node_expiry
node_bookings -->|"checks holds"| node_expiry
node_payments -->|"checks holds"| node_expiry
node_payments -->|"creates and captures"| node_paypal
node_payments -->|"sends receipts"| node_email
node_auth -->|"loads identity"| node_users
node_bookings -->|"reads and writes"| node_mongo
node_payments -->|"reads and writes"| node_mongo
node_revs -->|"reads and writes"| node_mongo
node_movies -->|"reads and writes"| node_mongo
node_customer -->|"rates titles"| node_reviewui
node_customer -->|"pays for booking"| node_paymentui
node_applications -.->|"stores applications"| node_mongo
node_analytics -.->|"aggregates reports"| node_mongo

click node_app "https://github.com/induwara1006/enterprise-cinema-booking-platform/blob/main/frontend/src/App.tsx"
click node_authui "https://github.com/induwara1006/enterprise-cinema-booking-platform/blob/main/frontend/src/contexts/AuthContext.tsx"
click node_api "https://github.com/induwara1006/enterprise-cinema-booking-platform/blob/main/frontend/src/services/api.ts"
click node_bookingui "https://github.com/induwara1006/enterprise-cinema-booking-platform/blob/main/frontend/src/contexts/BookingContext.tsx"
click node_paymentui "https://github.com/induwara1006/enterprise-cinema-booking-platform/blob/main/frontend/src/pages/Payment.tsx"
click node_catalogui "https://github.com/induwara1006/enterprise-cinema-booking-platform/blob/main/frontend/src/components/movies/MovieDetail.tsx"
click node_reviewui "https://github.com/induwara1006/enterprise-cinema-booking-platform/blob/main/frontend/src/components/reviews/ReviewForm.tsx"
click node_server "https://github.com/induwara1006/enterprise-cinema-booking-platform/blob/main/backend/src/server.ts"
click node_auth "https://github.com/induwara1006/enterprise-cinema-booking-platform/blob/main/backend/src/middlewares/auth.ts"
click node_users "https://github.com/induwara1006/enterprise-cinema-booking-platform/blob/main/backend/src/controllers/userController.ts"
click node_movies "https://github.com/induwara1006/enterprise-cinema-booking-platform/blob/main/backend/src/controllers/movieController.ts"
click node_cinemas "https://github.com/induwara1006/enterprise-cinema-booking-platform/blob/main/backend/src/controllers/cinemaController.ts"
click node_showtimes "https://github.com/induwara1006/enterprise-cinema-booking-platform/blob/main/backend/src/controllers/showtimeController.ts"
click node_seats "https://github.com/induwara1006/enterprise-cinema-booking-platform/blob/main/backend/src/controllers/seatController.ts"
click node_bookings "https://github.com/induwara1006/enterprise-cinema-booking-platform/blob/main/backend/src/controllers/bookingController.ts"
click node_payments "https://github.com/induwara1006/enterprise-cinema-booking-platform/blob/main/backend/src/controllers/paymentController.ts"
click node_revs "https://github.com/induwara1006/enterprise-cinema-booking-platform/blob/main/backend/src/controllers/reviewController.ts"
click node_applications "https://github.com/induwara1006/enterprise-cinema-booking-platform/blob/main/backend/src/controllers/applicationController.ts"
click node_analytics "https://github.com/induwara1006/enterprise-cinema-booking-platform/blob/main/backend/src/controllers/analyticsController.ts"
click node_realtime "https://github.com/induwara1006/enterprise-cinema-booking-platform/blob/main/backend/src/services/websocket.ts"
click node_expiry "https://github.com/induwara1006/enterprise-cinema-booking-platform/blob/main/backend/src/services/seatCleanup.ts"
click node_email "https://github.com/induwara1006/enterprise-cinema-booking-platform/blob/main/backend/src/services/email.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_authui,node_api,node_bookingui,node_paymentui toneBlue
class node_catalogui,node_movies,node_cinemas,node_showtimes,node_mongo toneAmber
class node_seats,node_bookings,node_payments,node_realtime,node_expiry toneMint
class node_reviewui,node_auth,node_users,node_revs toneRose
class node_server,node_applications,node_analytics,node_email,node_customer,node_paypal toneIndigo
```

## Components

### Customer application

- [Web app routing](https://github.com/induwara1006/enterprise-cinema-booking-platform/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Auth and profile](https://github.com/induwara1006/enterprise-cinema-booking-platform/blob/main/frontend/src/contexts/AuthContext.tsx): `frontend/src/contexts/AuthContext.tsx`
- [HTTP API client](https://github.com/induwara1006/enterprise-cinema-booking-platform/blob/main/frontend/src/services/api.ts): `frontend/src/services/api.ts`
- [Seat booking UI](https://github.com/induwara1006/enterprise-cinema-booking-platform/blob/main/frontend/src/contexts/BookingContext.tsx): `frontend/src/contexts/BookingContext.tsx`
- [Payment screens](https://github.com/induwara1006/enterprise-cinema-booking-platform/blob/main/frontend/src/pages/Payment.tsx): `frontend/src/pages/Payment.tsx`

### Cinema catalog

- [Movie and cinema views](https://github.com/induwara1006/enterprise-cinema-booking-platform/blob/main/frontend/src/components/movies/MovieDetail.tsx): `frontend/src/components/movies/MovieDetail.tsx`
- [Movie catalog](https://github.com/induwara1006/enterprise-cinema-booking-platform/blob/main/backend/src/controllers/movieController.ts): `backend/src/controllers/movieController.ts`
- [Cinema management](https://github.com/induwara1006/enterprise-cinema-booking-platform/blob/main/backend/src/controllers/cinemaController.ts): `backend/src/controllers/cinemaController.ts`
- [Showtime management](https://github.com/induwara1006/enterprise-cinema-booking-platform/blob/main/backend/src/controllers/showtimeController.ts): `backend/src/controllers/showtimeController.ts`

### Reservations and payment

- [Seat availability](https://github.com/induwara1006/enterprise-cinema-booking-platform/blob/main/backend/src/controllers/seatController.ts): `backend/src/controllers/seatController.ts`
- [Booking workflow](https://github.com/induwara1006/enterprise-cinema-booking-platform/blob/main/backend/src/controllers/bookingController.ts): `backend/src/controllers/bookingController.ts`
- [Payment workflow](https://github.com/induwara1006/enterprise-cinema-booking-platform/blob/main/backend/src/controllers/paymentController.ts): `backend/src/controllers/paymentController.ts`
- [Seat event service](https://github.com/induwara1006/enterprise-cinema-booking-platform/blob/main/backend/src/services/websocket.ts): `backend/src/services/websocket.ts`
- [Hold cleanup](https://github.com/induwara1006/enterprise-cinema-booking-platform/blob/main/backend/src/services/seatCleanup.ts): `backend/src/services/seatCleanup.ts`

### Identity and feedback

- [Reviews and ratings](https://github.com/induwara1006/enterprise-cinema-booking-platform/blob/main/frontend/src/components/reviews/ReviewForm.tsx): `frontend/src/components/reviews/ReviewForm.tsx`
- [JWT and role checks](https://github.com/induwara1006/enterprise-cinema-booking-platform/blob/main/backend/src/middlewares/auth.ts): `backend/src/middlewares/auth.ts`
- [User accounts](https://github.com/induwara1006/enterprise-cinema-booking-platform/blob/main/backend/src/controllers/userController.ts): `backend/src/controllers/userController.ts`
- [Review moderation](https://github.com/induwara1006/enterprise-cinema-booking-platform/blob/main/backend/src/controllers/reviewController.ts): `backend/src/controllers/reviewController.ts`

### Administration and platform

- [Express server](https://github.com/induwara1006/enterprise-cinema-booking-platform/blob/main/backend/src/server.ts): `backend/src/server.ts`
- [Cinema applications](https://github.com/induwara1006/enterprise-cinema-booking-platform/blob/main/backend/src/controllers/applicationController.ts): `backend/src/controllers/applicationController.ts`
- [Admin analytics](https://github.com/induwara1006/enterprise-cinema-booking-platform/blob/main/backend/src/controllers/analyticsController.ts): `backend/src/controllers/analyticsController.ts`
- [Email delivery](https://github.com/induwara1006/enterprise-cinema-booking-platform/blob/main/backend/src/services/email.ts): `backend/src/services/email.ts`

### Other components

- **Customer**
- **PayPal checkout**
- **MongoDB**

## Connections

- Customer → Web app routing: uses
- Web app routing → Auth and profile: provides auth (evidence: `frontend/src/App.tsx`)
- Web app routing → Seat booking UI: routes booking (evidence: `frontend/src/App.tsx`)
- Web app routing → Movie and cinema views: routes catalog (evidence: `frontend/src/App.tsx`)
- Seat booking UI → HTTP API client: requests data (evidence: `frontend/src/contexts/BookingContext.tsx`)
- Payment screens → HTTP API client: requests payment (evidence: `frontend/src/pages/Payment.tsx`)
- Reviews and ratings → HTTP API client: submits reviews (evidence: `frontend/src/components/reviews/ReviewForm.tsx`)
- Auth and profile → HTTP API client: auth requests (evidence: `frontend/src/contexts/AuthContext.tsx`)
- HTTP API client → Express server: HTTP requests
- Express server → Movie catalog: mounts routes (evidence: `backend/src/server.ts`)
- Express server → Cinema management: mounts routes (evidence: `backend/src/server.ts`)
- Express server → Showtime management: mounts routes (evidence: `backend/src/server.ts`)
- Express server → Seat availability: mounts routes (evidence: `backend/src/server.ts`)
- Express server → Booking workflow: mounts routes (evidence: `backend/src/server.ts`)
- Express server → Payment workflow: mounts routes (evidence: `backend/src/server.ts`)
- Express server → Review moderation: mounts routes (evidence: `backend/src/server.ts`)
- Express server → User accounts: mounts routes (evidence: `backend/src/server.ts`)
- Express server → Cinema applications: routes requests
- Express server → Seat event service: initializes (evidence: `backend/src/server.ts`)
- Booking workflow → Seat event service: broadcasts updates (evidence: `backend/src/controllers/bookingController.ts`)
- Seat availability → Seat event service: broadcasts availability (evidence: `backend/src/controllers/seatController.ts`)
- Express server → Hold cleanup: starts cleanup (evidence: `backend/src/server.ts`)
- Booking workflow → Hold cleanup: checks holds (evidence: `backend/src/controllers/bookingController.ts`)
- Payment workflow → Hold cleanup: checks holds (evidence: `backend/src/controllers/paymentController.ts`)
- Payment workflow → PayPal checkout: creates and captures
- Payment workflow → Email delivery: sends receipts (evidence: `backend/src/controllers/paymentController.ts`)
- JWT and role checks → User accounts: loads identity (evidence: `backend/src/middlewares/auth.ts`)
- Booking workflow → MongoDB: reads and writes (evidence: `backend/src/controllers/bookingController.ts`)
- Payment workflow → MongoDB: reads and writes (evidence: `backend/src/controllers/paymentController.ts`)
- Review moderation → MongoDB: reads and writes (evidence: `backend/src/controllers/reviewController.ts`)
- Movie catalog → MongoDB: reads and writes (evidence: `backend/src/controllers/movieController.ts`)
- Customer → Reviews and ratings: rates titles
- Customer → Payment screens: pays for booking
- Cinema applications → MongoDB: stores applications
- Admin analytics → MongoDB: aggregates reports
