# adithyasai3/cineverse architecture

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

- Interactive diagram: https://gitdiagram.com/adithyasai3/cineverse
- Repository: https://github.com/adithyasai3/cineverse

## Overview

CineVerse is a movie-ticket booking platform with a React client and a modular Express API. The main customer journey is catalogue and showtime discovery, live seat selection, temporary seat hold, payment, booking confirmation, and booking history; administration manages catalogue, theatres, screens, and shows. The README documents the backend’s layered modules, Redis/PostgreSQL concurrency safeguards, and transactional notification outbox. Sampled source confirms application assembly, booking/payment controller calls, and auth behavior; some feature wiring below follows explicit README documentation rather than sampled implementation.

Main entry points: [`src/app.ts`](https://github.com/adithyasai3/cineverse/blob/main/src/app.ts) (Express app), [`src/lib/prisma.ts`](https://github.com/adithyasai3/cineverse/blob/main/src/lib/prisma.ts) (PostgreSQL), [`src/modules/payments`](https://github.com/adithyasai3/cineverse/tree/main/src/modules/payments) (Payments), [`src/modules/bookings`](https://github.com/adithyasai3/cineverse/tree/main/src/modules/bookings) (Booking engine)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web client"]
  node_webapp["Booking UI<br/>[App.tsx]"]
  node_webpages["Customer and admin pages"]
  node_webservices["API services"]
end

subgraph group_api["API and identity"]
  node_apiapp["Express app<br/>[app.ts]"]
  node_auth["Authentication"]
  node_platform["Request and observability middleware"]
end

subgraph group_catalog["Discovery and venue"]
  node_movies["Movie catalogue"]
  node_theatres["Theatres and screens"]
  node_shows["Shows and seats"]
end

subgraph group_booking["Booking and payment"]
  node_bookings["Booking engine"]
  node_payments["Payments"]
end

subgraph group_operations["Delivery and state"]
  node_notifications["Notifications"]
  node_postgres[("PostgreSQL<br/>[prisma.ts]")]
  node_redis[("Redis<br/>[redis.ts]")]
end

node_customer(("Customer"))
node_admins(("Platform admins"))
node_gateway["Payment gateway"]
node_email["Email delivery"]

node_customer -->|"uses"| node_webapp
node_admins -->|"manages"| node_webapp
node_webapp -->|"renders"| node_webpages
node_webpages -->|"requests"| node_webservices
node_webservices -->|"calls API"| node_apiapp
node_apiapp -->|"passes requests"| node_platform
node_apiapp -->|"dispatches"| node_auth
node_apiapp -->|"dispatches"| node_movies
node_apiapp -->|"dispatches"| node_theatres
node_apiapp -->|"dispatches"| node_shows
node_apiapp -->|"dispatches"| node_bookings
node_apiapp -->|"dispatches"| node_payments
node_apiapp -->|"dispatches"| node_notifications
node_auth -->|"reads/writes"| node_postgres
node_movies -->|"reads/writes"| node_postgres
node_movies -->|"caches listings"| node_redis
node_theatres -->|"reads/writes"| node_postgres
node_shows -->|"reads/writes"| node_postgres
node_bookings -->|"holds and confirms"| node_postgres
node_bookings -->|"locks seats"| node_redis
node_payments -->|"records payment"| node_postgres
node_payments -->|"confirms atomically"| node_bookings
node_payments -.->|"initiates payment"| node_gateway
node_notifications -->|"polls outbox"| node_postgres
node_notifications -.->|"dispatches email"| node_email

click node_webapp "https://github.com/adithyasai3/cineverse/blob/main/frontend/src/App.tsx"
click node_webpages "https://github.com/adithyasai3/cineverse/tree/main/frontend/src/pages"
click node_webservices "https://github.com/adithyasai3/cineverse/tree/main/frontend/src/services"
click node_apiapp "https://github.com/adithyasai3/cineverse/blob/main/src/app.ts"
click node_auth "https://github.com/adithyasai3/cineverse/tree/main/src/modules/auth"
click node_movies "https://github.com/adithyasai3/cineverse/tree/main/src/modules/movies"
click node_theatres "https://github.com/adithyasai3/cineverse/tree/main/src/modules/theatres"
click node_shows "https://github.com/adithyasai3/cineverse/tree/main/src/modules/shows"
click node_bookings "https://github.com/adithyasai3/cineverse/tree/main/src/modules/bookings"
click node_payments "https://github.com/adithyasai3/cineverse/tree/main/src/modules/payments"
click node_notifications "https://github.com/adithyasai3/cineverse/tree/main/src/modules/notifications"
click node_postgres "https://github.com/adithyasai3/cineverse/blob/main/src/lib/prisma.ts"
click node_redis "https://github.com/adithyasai3/cineverse/blob/main/src/lib/redis.ts"
click node_platform "https://github.com/adithyasai3/cineverse/tree/main/src/middlewares"

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_webapp,node_webpages,node_webservices toneBlue
class node_apiapp,node_auth,node_platform toneAmber
class node_movies,node_theatres,node_shows toneMint
class node_bookings,node_payments toneRose
class node_notifications,node_postgres,node_redis,node_customer,node_admins,node_gateway,node_email toneIndigo
```

## Components

### Web client

- [Booking UI](https://github.com/adithyasai3/cineverse/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Customer and admin pages](https://github.com/adithyasai3/cineverse/tree/main/frontend/src/pages): `frontend/src/pages`
- [API services](https://github.com/adithyasai3/cineverse/tree/main/frontend/src/services): `frontend/src/services`

### API and identity

- [Express app](https://github.com/adithyasai3/cineverse/blob/main/src/app.ts): `src/app.ts`
- [Authentication](https://github.com/adithyasai3/cineverse/tree/main/src/modules/auth): `src/modules/auth`
- [Request and observability middleware](https://github.com/adithyasai3/cineverse/tree/main/src/middlewares): `src/middlewares`

### Discovery and venue

- [Movie catalogue](https://github.com/adithyasai3/cineverse/tree/main/src/modules/movies): `src/modules/movies`
- [Theatres and screens](https://github.com/adithyasai3/cineverse/tree/main/src/modules/theatres): `src/modules/theatres`
- [Shows and seats](https://github.com/adithyasai3/cineverse/tree/main/src/modules/shows): `src/modules/shows`

### Booking and payment

- [Booking engine](https://github.com/adithyasai3/cineverse/tree/main/src/modules/bookings): `src/modules/bookings`
- [Payments](https://github.com/adithyasai3/cineverse/tree/main/src/modules/payments): `src/modules/payments`

### Delivery and state

- [Notifications](https://github.com/adithyasai3/cineverse/tree/main/src/modules/notifications): `src/modules/notifications`
- [PostgreSQL](https://github.com/adithyasai3/cineverse/blob/main/src/lib/prisma.ts): `src/lib/prisma.ts`
- [Redis](https://github.com/adithyasai3/cineverse/blob/main/src/lib/redis.ts): `src/lib/redis.ts`

### Other components

- **Customer**
- **Platform admins**
- **Payment gateway**
- **Email delivery**

## Connections

- Customer → Booking UI: uses
- Platform admins → Booking UI: manages
- Booking UI → Customer and admin pages: renders
- Customer and admin pages → API services: requests
- API services → Express app: calls API
- Express app → Request and observability middleware: passes requests
- Express app → Authentication: dispatches
- Express app → Movie catalogue: dispatches
- Express app → Theatres and screens: dispatches
- Express app → Shows and seats: dispatches
- Express app → Booking engine: dispatches
- Express app → Payments: dispatches
- Express app → Notifications: dispatches
- Authentication → PostgreSQL: reads/writes
- Movie catalogue → PostgreSQL: reads/writes
- Movie catalogue → Redis: caches listings
- Theatres and screens → PostgreSQL: reads/writes
- Shows and seats → PostgreSQL: reads/writes
- Booking engine → PostgreSQL: holds and confirms
- Booking engine → Redis: locks seats
- Payments → PostgreSQL: records payment
- Payments → Booking engine: confirms atomically
- Payments → Payment gateway: initiates payment
- Notifications → PostgreSQL: polls outbox
- Notifications → Email delivery: dispatches email
