# sagamdeep826-pixel/project-imovies architecture

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

- Interactive diagram: https://gitdiagram.com/sagamdeep826-pixel/project-imovies
- Repository: https://github.com/sagamdeep826-pixel/project-imovies

## Overview

IMovies is a cinema discovery and ticket-booking platform with real-time seat holds, QR ticket vouchers, cancellations/refunds, and an administrator portal. Moviegoers discover titles and local showtimes, select seats, check out, and receive a booking confirmation; administrators manage catalog, theatres, shows, and analytics. The graph follows the client entry point and API calls into the server, with booking persistence and seat updates shown where excerpts support them. Several feature pages and backend routes are unsampled, so README-described capabilities are retained without asserting unverified internal call chains.

Main entry points: [`client/src/App.jsx`](https://github.com/sagamdeep826-pixel/project-imovies/blob/master/client/src/App.jsx) (Web app), [`server/src/server.js`](https://github.com/sagamdeep826-pixel/project-imovies/blob/master/server/src/server.js) (HTTP and socket server), [`client/src/services/api.js`](https://github.com/sagamdeep826-pixel/project-imovies/blob/master/client/src/services/api.js) (API client), [`client/src/pages/SeatSelectionPage.jsx`](https://github.com/sagamdeep826-pixel/project-imovies/blob/master/client/src/pages/SeatSelectionPage.jsx) (Seat selection)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Moviegoer experience"]
  node_app["Web app<br/>[App.jsx]"]
  node_authctx["Authentication state<br/>[AuthContext.jsx]"]
  node_cityctx["City selection<br/>[CityContext.jsx]"]
  node_discovery["Movie discovery<br/>[HomePage.jsx]"]
  node_details["Movie details"]
  node_theatres["Theatre discovery<br/>[TheatresPage.jsx]"]
  node_api["API client<br/>[api.js]"]
end

subgraph group_booking["Booking and live seats"]
  node_seats["Seat selection"]
  node_socketctx["Live seat socket<br/>[SocketContext.jsx]"]
  node_checkout["Checkout<br/>[CheckoutPage.jsx]"]
  node_confirmation["Ticket confirmation"]
  node_userdash["User bookings"]
end

subgraph group_admin["Cinema administration"]
  node_adminui["Admin portal"]
end

subgraph group_backend["API and domain services"]
  node_server["HTTP and socket server<br/>[server.js]"]
  node_catalog["Catalog and show services<br/>[movieController.js]"]
  node_showservice["Show and seat setup<br/>[showController.js]"]
  node_bookingservice["Booking and cancellation"]
  node_authservice["Authentication service<br/>[authController.js]"]
  node_analytics["Revenue analytics"]
end

subgraph group_data["Persistence and identity"]
  node_models[("Domain records")]
  node_database[("MongoDB<br/>[db.js]")]
end

node_moviegoer(("Moviegoer"))
node_admin(("Cinema administrator"))

node_moviegoer -->|"uses"| node_app
node_app -->|"routes to"| node_discovery
node_app -->|"routes to"| node_details
node_app -->|"routes to"| node_seats
node_app -->|"routes to"| node_checkout
node_app -->|"routes to"| node_confirmation
node_app -->|"routes to"| node_theatres
node_app -->|"routes to"| node_userdash
node_app -->|"routes to"| node_adminui
node_app -->|"provides"| node_authctx
node_app -->|"provides"| node_cityctx
node_discovery -.->|"requests data"| node_api
node_details -.->|"requests data"| node_api
node_theatres -.->|"requests data"| node_api
node_seats -->|"requests data"| node_api
node_seats -->|"uses live updates"| node_socketctx
node_checkout -->|"submits booking"| node_api
node_userdash -->|"loads bookings"| node_api
node_adminui -->|"manages cinema"| node_api
node_authctx -->|"authenticates"| node_api
node_cityctx -->|"loads cities"| node_api
node_api -->|"calls API"| node_server
node_server -->|"mounts routes"| node_catalog
node_server -->|"mounts routes"| node_showservice
node_server -->|"mounts routes"| node_bookingservice
node_server -->|"mounts routes"| node_authservice
node_server -->|"mounts routes"| node_analytics
node_server -->|"connects"| node_database
node_server -.->|"serves live seat events"| node_socketctx
node_catalog -->|"reads and writes"| node_models
node_showservice -->|"creates shows and seats"| node_models
node_bookingservice -->|"records bookings and payments"| node_models
node_bookingservice -->|"broadcasts seat changes"| node_server
node_authservice -->|"uses users"| node_models
node_admin -->|"manages"| node_adminui
node_adminui -.->|"views metrics"| node_analytics
node_database -.->|"persists"| node_models
node_moviegoer -->|"selects seats"| node_seats
node_seats -->|"continues booking"| node_checkout
node_checkout -->|"confirms purchase"| node_confirmation

click node_app "https://github.com/sagamdeep826-pixel/project-imovies/blob/master/client/src/App.jsx"
click node_authctx "https://github.com/sagamdeep826-pixel/project-imovies/blob/master/client/src/context/AuthContext.jsx"
click node_cityctx "https://github.com/sagamdeep826-pixel/project-imovies/blob/master/client/src/context/CityContext.jsx"
click node_discovery "https://github.com/sagamdeep826-pixel/project-imovies/blob/master/client/src/pages/HomePage.jsx"
click node_details "https://github.com/sagamdeep826-pixel/project-imovies/blob/master/client/src/pages/MovieDetailsPage.jsx"
click node_theatres "https://github.com/sagamdeep826-pixel/project-imovies/blob/master/client/src/pages/TheatresPage.jsx"
click node_api "https://github.com/sagamdeep826-pixel/project-imovies/blob/master/client/src/services/api.js"
click node_seats "https://github.com/sagamdeep826-pixel/project-imovies/blob/master/client/src/pages/SeatSelectionPage.jsx"
click node_socketctx "https://github.com/sagamdeep826-pixel/project-imovies/blob/master/client/src/context/SocketContext.jsx"
click node_checkout "https://github.com/sagamdeep826-pixel/project-imovies/blob/master/client/src/pages/CheckoutPage.jsx"
click node_confirmation "https://github.com/sagamdeep826-pixel/project-imovies/blob/master/client/src/pages/BookingConfirmationPage.jsx"
click node_userdash "https://github.com/sagamdeep826-pixel/project-imovies/blob/master/client/src/pages/UserDashboardPage.jsx"
click node_adminui "https://github.com/sagamdeep826-pixel/project-imovies/blob/master/client/src/pages/AdminDashboardPage.jsx"
click node_server "https://github.com/sagamdeep826-pixel/project-imovies/blob/master/server/src/server.js"
click node_catalog "https://github.com/sagamdeep826-pixel/project-imovies/blob/master/server/src/controllers/movieController.js"
click node_showservice "https://github.com/sagamdeep826-pixel/project-imovies/blob/master/server/src/controllers/showController.js"
click node_bookingservice "https://github.com/sagamdeep826-pixel/project-imovies/blob/master/server/src/controllers/bookingController.js"
click node_authservice "https://github.com/sagamdeep826-pixel/project-imovies/blob/master/server/src/controllers/authController.js"
click node_analytics "https://github.com/sagamdeep826-pixel/project-imovies/blob/master/server/src/controllers/analyticsController.js"
click node_models "https://github.com/sagamdeep826-pixel/project-imovies/tree/master/server/src/models"
click node_database "https://github.com/sagamdeep826-pixel/project-imovies/blob/master/server/src/config/db.js"

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_authctx,node_cityctx,node_discovery,node_details,node_theatres,node_api toneBlue
class node_seats,node_socketctx,node_checkout,node_confirmation,node_userdash toneAmber
class node_adminui toneMint
class node_server,node_catalog,node_showservice,node_bookingservice,node_authservice,node_analytics toneRose
class node_models,node_database,node_moviegoer,node_admin toneIndigo
```

## Components

### Moviegoer experience

- [Web app](https://github.com/sagamdeep826-pixel/project-imovies/blob/master/client/src/App.jsx): `client/src/App.jsx`
- [Authentication state](https://github.com/sagamdeep826-pixel/project-imovies/blob/master/client/src/context/AuthContext.jsx): `client/src/context/AuthContext.jsx`
- [City selection](https://github.com/sagamdeep826-pixel/project-imovies/blob/master/client/src/context/CityContext.jsx): `client/src/context/CityContext.jsx`
- [Movie discovery](https://github.com/sagamdeep826-pixel/project-imovies/blob/master/client/src/pages/HomePage.jsx): `client/src/pages/HomePage.jsx`
- [Movie details](https://github.com/sagamdeep826-pixel/project-imovies/blob/master/client/src/pages/MovieDetailsPage.jsx): `client/src/pages/MovieDetailsPage.jsx`
- [Theatre discovery](https://github.com/sagamdeep826-pixel/project-imovies/blob/master/client/src/pages/TheatresPage.jsx): `client/src/pages/TheatresPage.jsx`
- [API client](https://github.com/sagamdeep826-pixel/project-imovies/blob/master/client/src/services/api.js): `client/src/services/api.js`

### Booking and live seats

- [Seat selection](https://github.com/sagamdeep826-pixel/project-imovies/blob/master/client/src/pages/SeatSelectionPage.jsx): `client/src/pages/SeatSelectionPage.jsx`
- [Live seat socket](https://github.com/sagamdeep826-pixel/project-imovies/blob/master/client/src/context/SocketContext.jsx): `client/src/context/SocketContext.jsx`
- [Checkout](https://github.com/sagamdeep826-pixel/project-imovies/blob/master/client/src/pages/CheckoutPage.jsx): `client/src/pages/CheckoutPage.jsx`
- [Ticket confirmation](https://github.com/sagamdeep826-pixel/project-imovies/blob/master/client/src/pages/BookingConfirmationPage.jsx): `client/src/pages/BookingConfirmationPage.jsx`
- [User bookings](https://github.com/sagamdeep826-pixel/project-imovies/blob/master/client/src/pages/UserDashboardPage.jsx): `client/src/pages/UserDashboardPage.jsx`

### Cinema administration

- [Admin portal](https://github.com/sagamdeep826-pixel/project-imovies/blob/master/client/src/pages/AdminDashboardPage.jsx): `client/src/pages/AdminDashboardPage.jsx`

### API and domain services

- [HTTP and socket server](https://github.com/sagamdeep826-pixel/project-imovies/blob/master/server/src/server.js): `server/src/server.js`
- [Catalog and show services](https://github.com/sagamdeep826-pixel/project-imovies/blob/master/server/src/controllers/movieController.js): `server/src/controllers/movieController.js`
- [Show and seat setup](https://github.com/sagamdeep826-pixel/project-imovies/blob/master/server/src/controllers/showController.js): `server/src/controllers/showController.js`
- [Booking and cancellation](https://github.com/sagamdeep826-pixel/project-imovies/blob/master/server/src/controllers/bookingController.js): `server/src/controllers/bookingController.js`
- [Authentication service](https://github.com/sagamdeep826-pixel/project-imovies/blob/master/server/src/controllers/authController.js): `server/src/controllers/authController.js`
- [Revenue analytics](https://github.com/sagamdeep826-pixel/project-imovies/blob/master/server/src/controllers/analyticsController.js): `server/src/controllers/analyticsController.js`

### Persistence and identity

- [Domain records](https://github.com/sagamdeep826-pixel/project-imovies/tree/master/server/src/models): `server/src/models`
- [MongoDB](https://github.com/sagamdeep826-pixel/project-imovies/blob/master/server/src/config/db.js): `server/src/config/db.js`

### Other components

- **Moviegoer**
- **Cinema administrator**

## Connections

- Moviegoer → Web app: uses
- Web app → Movie discovery: routes to (evidence: `client/src/App.jsx`)
- Web app → Movie details: routes to (evidence: `client/src/App.jsx`)
- Web app → Seat selection: routes to (evidence: `client/src/App.jsx`)
- Web app → Checkout: routes to (evidence: `client/src/App.jsx`)
- Web app → Ticket confirmation: routes to (evidence: `client/src/App.jsx`)
- Web app → Theatre discovery: routes to (evidence: `client/src/App.jsx`)
- Web app → User bookings: routes to (evidence: `client/src/App.jsx`)
- Web app → Admin portal: routes to (evidence: `client/src/App.jsx`)
- Web app → Authentication state: provides (evidence: `client/src/App.jsx`)
- Web app → City selection: provides (evidence: `client/src/App.jsx`)
- Movie discovery → API client: requests data
- Movie details → API client: requests data
- Theatre discovery → API client: requests data
- Seat selection → API client: requests data (evidence: `client/src/pages/SeatSelectionPage.jsx`)
- Seat selection → Live seat socket: uses live updates (evidence: `client/src/pages/SeatSelectionPage.jsx`)
- Checkout → API client: submits booking (evidence: `client/src/pages/CheckoutPage.jsx`)
- User bookings → API client: loads bookings (evidence: `client/src/pages/UserDashboardPage.jsx`)
- Admin portal → API client: manages cinema (evidence: `client/src/pages/AdminDashboardPage.jsx`)
- Authentication state → API client: authenticates (evidence: `client/src/context/AuthContext.jsx`)
- City selection → API client: loads cities (evidence: `client/src/context/CityContext.jsx`)
- API client → HTTP and socket server: calls API (evidence: `client/src/services/api.js`)
- HTTP and socket server → Catalog and show services: mounts routes (evidence: `server/src/server.js`)
- HTTP and socket server → Show and seat setup: mounts routes (evidence: `server/src/server.js`)
- HTTP and socket server → Booking and cancellation: mounts routes (evidence: `server/src/server.js`)
- HTTP and socket server → Authentication service: mounts routes (evidence: `server/src/server.js`)
- HTTP and socket server → Revenue analytics: mounts routes (evidence: `server/src/server.js`)
- HTTP and socket server → MongoDB: connects (evidence: `server/src/server.js`)
- HTTP and socket server → Live seat socket: serves live seat events
- Catalog and show services → Domain records: reads and writes (evidence: `server/src/controllers/movieController.js`)
- Show and seat setup → Domain records: creates shows and seats (evidence: `server/src/controllers/showController.js`)
- Booking and cancellation → Domain records: records bookings and payments (evidence: `server/src/controllers/bookingController.js`)
- Booking and cancellation → HTTP and socket server: broadcasts seat changes (evidence: `server/src/controllers/bookingController.js`)
- Authentication service → Domain records: uses users (evidence: `server/src/controllers/authController.js`)
- Cinema administrator → Admin portal: manages
- Admin portal → Revenue analytics: views metrics
- MongoDB → Domain records: persists
- Moviegoer → Seat selection: selects seats
- Seat selection → Checkout: continues booking
- Checkout → Ticket confirmation: confirms purchase
