# cheakhokkeat/nironcinema architecture

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

- Interactive diagram: https://gitdiagram.com/cheakhokkeat/nironcinema
- Repository: https://github.com/cheakhokkeat/nironcinema

## Overview

NironCinema is a browser-based cinema booking demo with customer, staff, and admin workspaces. Customers browse the catalogue, book seats and food, then save or share tickets; staff handle customer bookings, check-in, food pickup, and reporting, while admins manage catalogue and screening data. Browser localStorage is the shared persistence layer; authentication and payments are simulated. The README documents the major capabilities, while some page and subsystem wiring is unsampled, so uncertain links are omitted.

Main entry points: [`src/js/data/storage.js`](https://github.com/cheakhokkeat/nironcinema/blob/main/src/js/data/storage.js) (Browser data), [`staff/staff.js`](https://github.com/cheakhokkeat/nironcinema/blob/main/staff/staff.js) (Staff workspace), [`src/js/booking/seatBooking.js`](https://github.com/cheakhokkeat/nironcinema/blob/main/src/js/booking/seatBooking.js) (Seat booking), [`src/js/pages/main.js`](https://github.com/cheakhokkeat/nironcinema/blob/main/src/js/pages/main.js) (Movie catalogue)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_customer["Customer booking"]
  node_movie_browse["Movie catalogue<br/>[main.js]"]
  node_movie_details["Movie details<br/>[moviePage.js]"]
  node_food_page["Food ordering<br/>[foodPage.js]"]
  node_auth["Authentication<br/>[authModal.js]"]
  node_tickets_page["My tickets<br/>[ticketsPage.js]"]
end

subgraph group_booking["Booking and tickets"]
  node_storage[("Browser data<br/>[storage.js]")]
  node_seat_booking["Seat booking<br/>[seatBooking.js]"]
  node_food_orders["Food orders<br/>[foodOrders.js]"]
  node_booking_activity["Booking activity<br/>[activity.js]"]
  node_ticket_actions["Ticket actions<br/>[ticketActions.js]"]
  node_digital_ticket["Digital ticket<br/>[digitalTicket.js]"]
  node_ticket_image["Ticket image export<br/>[ticketImage.js]"]
end

subgraph group_staff["Staff workspace"]
  node_staff_workspace["Staff workspace<br/>[staff.js]"]
  node_staff_operations["Check-in and reports<br/>[operations.js]"]
  node_food_panel["Food pickup<br/>[foodOrdersPanel.js]"]
  node_report_charts["Sales charts<br/>[reportCharts.js]"]
  node_report_pdf["Report export<br/>[reportPdf.js]"]
end

subgraph group_admin["Admin workspace"]
  node_admin_workspace["Admin workspace<br/>[admin.js]"]
  node_admin_operations["Catalogue operations<br/>[operations.js]"]
  node_format_profiles["Screening formats"]
end

node_customer_actor(("Customer"))
node_staff_actor(("Staff"))
node_admin_actor(("Admin"))

node_customer_actor -->|"browses"| node_movie_browse
node_movie_browse -->|"reads catalogue"| node_storage
node_movie_browse -->|"opens details"| node_movie_details
node_customer_actor -->|"books seats"| node_seat_booking
node_seat_booking -->|"reads and saves"| node_storage
node_seat_booking -->|"records activity"| node_booking_activity
node_customer_actor -->|"orders food"| node_food_page
node_food_page -->|"uses orders"| node_food_orders
node_food_page -->|"reads data"| node_storage
node_customer_actor -->|"signs in"| node_auth
node_auth -->|"initializes and updates"| node_storage
node_auth -->|"resumes access"| node_seat_booking
node_customer_actor -->|"views tickets"| node_tickets_page
node_tickets_page -.->|"offers ticket actions"| node_ticket_actions
node_ticket_actions -->|"renders export"| node_ticket_image
node_ticket_actions -.->|"previews ticket"| node_digital_ticket
node_staff_actor -->|"handles operations"| node_staff_workspace
node_staff_workspace -->|"uses operations"| node_staff_operations
node_staff_workspace -->|"opens pickup panel"| node_food_panel
node_food_panel -->|"updates orders"| node_food_orders
node_food_panel -->|"reads and saves"| node_storage
node_staff_workspace -->|"shows reports"| node_report_charts
node_staff_workspace -->|"exports reports"| node_report_pdf
node_report_charts -.->|"renders report data"| node_staff_operations
node_admin_actor -->|"manages cinema"| node_admin_workspace
node_admin_workspace -->|"uses operations"| node_admin_operations
node_admin_workspace -->|"edits formats"| node_format_profiles
node_admin_operations -.->|"updates data"| node_storage

click node_movie_browse "https://github.com/cheakhokkeat/nironcinema/blob/main/src/js/pages/main.js"
click node_movie_details "https://github.com/cheakhokkeat/nironcinema/blob/main/src/js/pages/moviePage.js"
click node_food_page "https://github.com/cheakhokkeat/nironcinema/blob/main/src/js/pages/foodPage.js"
click node_auth "https://github.com/cheakhokkeat/nironcinema/blob/main/src/js/auth/authModal.js"
click node_storage "https://github.com/cheakhokkeat/nironcinema/blob/main/src/js/data/storage.js"
click node_seat_booking "https://github.com/cheakhokkeat/nironcinema/blob/main/src/js/booking/seatBooking.js"
click node_food_orders "https://github.com/cheakhokkeat/nironcinema/blob/main/src/js/booking/foodOrders.js"
click node_booking_activity "https://github.com/cheakhokkeat/nironcinema/blob/main/src/js/booking/activity.js"
click node_ticket_actions "https://github.com/cheakhokkeat/nironcinema/blob/main/src/js/tickets/ticketActions.js"
click node_digital_ticket "https://github.com/cheakhokkeat/nironcinema/blob/main/src/js/tickets/digitalTicket.js"
click node_ticket_image "https://github.com/cheakhokkeat/nironcinema/blob/main/src/js/tickets/ticketImage.js"
click node_tickets_page "https://github.com/cheakhokkeat/nironcinema/blob/main/src/js/pages/ticketsPage.js"
click node_staff_workspace "https://github.com/cheakhokkeat/nironcinema/blob/main/staff/staff.js"
click node_staff_operations "https://github.com/cheakhokkeat/nironcinema/blob/main/staff/operations.js"
click node_food_panel "https://github.com/cheakhokkeat/nironcinema/blob/main/staff/foodOrdersPanel.js"
click node_report_charts "https://github.com/cheakhokkeat/nironcinema/blob/main/staff/reportCharts.js"
click node_report_pdf "https://github.com/cheakhokkeat/nironcinema/blob/main/staff/reportPdf.js"
click node_admin_workspace "https://github.com/cheakhokkeat/nironcinema/blob/main/admin/admin.js"
click node_admin_operations "https://github.com/cheakhokkeat/nironcinema/blob/main/admin/operations.js"
click node_format_profiles "https://github.com/cheakhokkeat/nironcinema/blob/main/admin/movieFormatEditor.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_movie_browse,node_movie_details,node_food_page,node_auth,node_tickets_page toneBlue
class node_storage,node_seat_booking,node_food_orders,node_booking_activity,node_ticket_actions,node_digital_ticket,node_ticket_image toneAmber
class node_staff_workspace,node_staff_operations,node_food_panel,node_report_charts,node_report_pdf toneMint
class node_admin_workspace,node_admin_operations,node_format_profiles toneRose
class node_customer_actor,node_staff_actor,node_admin_actor toneIndigo
```

## Components

### Customer booking

- [Movie catalogue](https://github.com/cheakhokkeat/nironcinema/blob/main/src/js/pages/main.js): `src/js/pages/main.js`
- [Movie details](https://github.com/cheakhokkeat/nironcinema/blob/main/src/js/pages/moviePage.js): `src/js/pages/moviePage.js`
- [Food ordering](https://github.com/cheakhokkeat/nironcinema/blob/main/src/js/pages/foodPage.js): `src/js/pages/foodPage.js`
- [Authentication](https://github.com/cheakhokkeat/nironcinema/blob/main/src/js/auth/authModal.js): `src/js/auth/authModal.js`
- [My tickets](https://github.com/cheakhokkeat/nironcinema/blob/main/src/js/pages/ticketsPage.js): `src/js/pages/ticketsPage.js`

### Booking and tickets

- [Browser data](https://github.com/cheakhokkeat/nironcinema/blob/main/src/js/data/storage.js): `src/js/data/storage.js`
- [Seat booking](https://github.com/cheakhokkeat/nironcinema/blob/main/src/js/booking/seatBooking.js): `src/js/booking/seatBooking.js`
- [Food orders](https://github.com/cheakhokkeat/nironcinema/blob/main/src/js/booking/foodOrders.js): `src/js/booking/foodOrders.js`
- [Booking activity](https://github.com/cheakhokkeat/nironcinema/blob/main/src/js/booking/activity.js): `src/js/booking/activity.js`
- [Ticket actions](https://github.com/cheakhokkeat/nironcinema/blob/main/src/js/tickets/ticketActions.js): `src/js/tickets/ticketActions.js`
- [Digital ticket](https://github.com/cheakhokkeat/nironcinema/blob/main/src/js/tickets/digitalTicket.js): `src/js/tickets/digitalTicket.js`
- [Ticket image export](https://github.com/cheakhokkeat/nironcinema/blob/main/src/js/tickets/ticketImage.js): `src/js/tickets/ticketImage.js`

### Staff workspace

- [Staff workspace](https://github.com/cheakhokkeat/nironcinema/blob/main/staff/staff.js): `staff/staff.js`
- [Check-in and reports](https://github.com/cheakhokkeat/nironcinema/blob/main/staff/operations.js): `staff/operations.js`
- [Food pickup](https://github.com/cheakhokkeat/nironcinema/blob/main/staff/foodOrdersPanel.js): `staff/foodOrdersPanel.js`
- [Sales charts](https://github.com/cheakhokkeat/nironcinema/blob/main/staff/reportCharts.js): `staff/reportCharts.js`
- [Report export](https://github.com/cheakhokkeat/nironcinema/blob/main/staff/reportPdf.js): `staff/reportPdf.js`

### Admin workspace

- [Admin workspace](https://github.com/cheakhokkeat/nironcinema/blob/main/admin/admin.js): `admin/admin.js`
- [Catalogue operations](https://github.com/cheakhokkeat/nironcinema/blob/main/admin/operations.js): `admin/operations.js`
- [Screening formats](https://github.com/cheakhokkeat/nironcinema/blob/main/admin/movieFormatEditor.js): `admin/movieFormatEditor.js`

### Other components

- **Customer**
- **Staff**
- **Admin**

## Connections

- Customer → Movie catalogue: browses
- Movie catalogue → Browser data: reads catalogue (evidence: `src/js/pages/main.js`)
- Movie catalogue → Movie details: opens details
- Customer → Seat booking: books seats
- Seat booking → Browser data: reads and saves (evidence: `src/js/booking/seatBooking.js`)
- Seat booking → Booking activity: records activity (evidence: `src/js/booking/seatBooking.js`)
- Customer → Food ordering: orders food
- Food ordering → Food orders: uses orders (evidence: `src/js/pages/foodPage.js`)
- Food ordering → Browser data: reads data (evidence: `src/js/pages/foodPage.js`)
- Customer → Authentication: signs in
- Authentication → Browser data: initializes and updates (evidence: `src/js/auth/authModal.js`)
- Authentication → Seat booking: resumes access (evidence: `src/js/auth/authModal.js`)
- Customer → My tickets: views tickets
- My tickets → Ticket actions: offers ticket actions
- Ticket actions → Ticket image export: renders export (evidence: `src/js/tickets/ticketActions.js`)
- Ticket actions → Digital ticket: previews ticket
- Staff → Staff workspace: handles operations
- Staff workspace → Check-in and reports: uses operations (evidence: `staff/staff.js`)
- Staff workspace → Food pickup: opens pickup panel (evidence: `staff/staff.js`)
- Food pickup → Food orders: updates orders (evidence: `staff/foodOrdersPanel.js`)
- Food pickup → Browser data: reads and saves (evidence: `staff/foodOrdersPanel.js`)
- Staff workspace → Sales charts: shows reports (evidence: `staff/staff.js`)
- Staff workspace → Report export: exports reports (evidence: `staff/staff.js`)
- Sales charts → Check-in and reports: renders report data
- Admin → Admin workspace: manages cinema
- Admin workspace → Catalogue operations: uses operations (evidence: `admin/admin.js`)
- Admin workspace → Screening formats: edits formats (evidence: `admin/admin.js`)
- Catalogue operations → Browser data: updates data
