# duongnthe180971/movietheater architecture

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

- Interactive diagram: https://gitdiagram.com/duongnthe180971/movietheater
- Repository: https://github.com/duongnthe180971/movietheater

## Overview

This is a full-stack cinema booking and theater-management system: React pages route customer and admin actions through API clients to a Spring Boot REST backend. The customer journey spans movie discovery, showtime and seat selection, invoice creation, and VNPay payment; administrators manage movies, rooms, schedules, seats, promotions, accounts, and permissions. The backend persists domain data in MySQL and supports JWT authentication and email OTP. Some subsystem links are documented only in the README; those are shown without claiming uninspected call details.

Main entry points: [`Frontend/fe-movie-theater/src/api`](https://github.com/duongnthe180971/movietheater/tree/main/Frontend/fe-movie-theater/src/api) (API clients), [`Backend/be-movie-theater/src/main/java/com/group3/be/movie/theater/domain/invoice/InvoiceService.java`](https://github.com/duongnthe180971/movietheater/blob/main/Backend/be-movie-theater/src/main/java/com/group3/be/movie/theater/domain/invoice/InvoiceService.java) (Invoice processing), [`Frontend/fe-movie-theater/src/routes.jsx`](https://github.com/duongnthe180971/movietheater/blob/main/Frontend/fe-movie-theater/src/routes.jsx) (Route dispatch), [`Backend/be-movie-theater/src/main/java/com/group3/be/movie/theater/domain/show_dates/ShowDateService.java`](https://github.com/duongnthe180971/movietheater/blob/main/Backend/be-movie-theater/src/main/java/com/group3/be/movie/theater/domain/show_dates/ShowDateService.java) (Show dates)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web experience"]
  node_routes["Route dispatch<br/>[routes.jsx]"]
  node_customer_pages["Customer pages"]
  node_admin_pages["Admin pages"]
  node_api_clients["API clients"]
end

subgraph group_catalog["Catalog and scheduling"]
  node_movies["Movie catalog"]
  node_rooms_seats["Rooms and seats"]
  node_show_dates["Show dates"]
  node_schedules["Schedules"]
end

subgraph group_booking["Booking and payment"]
  node_booking_ui["Ticket and invoice UI<br/>[Payment.jsx]"]
  node_invoices["Invoice processing"]
  node_schedule_seats["Schedule seat state"]
  node_vnpay["VNPay integration"]
end

subgraph group_identity["Identity and administration"]
  node_accounts["Accounts and OTP"]
  node_roles["Roles and permissions<br/>[RoleService.java]"]
  node_promotions["Promotions"]
  node_files["Image files<br/>[FileService.java]"]
end

node_customer(("Customer"))
node_admin(("Administrator"))
node_mysql[("MySQL database")]
node_vnpay_service["VNPay gateway"]
node_email["Email service"]

node_customer -->|"browses"| node_routes
node_admin -->|"manages"| node_routes
node_routes -->|"routes to"| node_customer_pages
node_routes -->|"routes to"| node_admin_pages
node_customer_pages -.->|"requests data"| node_api_clients
node_admin_pages -.->|"requests data"| node_api_clients
node_api_clients -.->|"calls REST API"| node_movies
node_api_clients -.->|"calls REST API"| node_show_dates
node_api_clients -.->|"calls REST API"| node_schedules
node_api_clients -.->|"calls REST API"| node_rooms_seats
node_booking_ui -.->|"starts payment"| node_api_clients
node_api_clients -.->|"submits booking"| node_invoices
node_invoices -->|"loads account"| node_accounts
node_invoices -->|"updates seat state"| node_schedule_seats
node_invoices -.->|"processes payment"| node_vnpay
node_vnpay -.->|"redirects payment"| node_vnpay_service
node_schedules -->|"loads show dates"| node_show_dates
node_show_dates -->|"creates schedules"| node_schedules
node_accounts -.->|"sends OTP"| node_email
node_accounts -->|"assigns role"| node_roles
node_roles -.->|"persists roles"| node_mysql
node_movies -.->|"persists catalog"| node_mysql
node_rooms_seats -.->|"persists layout"| node_mysql
node_show_dates -.->|"persists dates"| node_mysql
node_schedules -.->|"persists schedules"| node_mysql
node_invoices -.->|"persists invoices"| node_mysql
node_schedule_seats -.->|"persists seat state"| node_mysql
node_promotions -.->|"persists promotions"| node_mysql
node_files -.->|"serves images"| node_customer_pages

click node_routes "https://github.com/duongnthe180971/movietheater/blob/main/Frontend/fe-movie-theater/src/routes.jsx"
click node_customer_pages "https://github.com/duongnthe180971/movietheater/tree/main/Frontend/fe-movie-theater/src/pages/client"
click node_admin_pages "https://github.com/duongnthe180971/movietheater/tree/main/Frontend/fe-movie-theater/src/pages/admin"
click node_api_clients "https://github.com/duongnthe180971/movietheater/tree/main/Frontend/fe-movie-theater/src/api"
click node_movies "https://github.com/duongnthe180971/movietheater/tree/main/Backend/be-movie-theater/src/main/java/com/group3/be/movie/theater/domain/movie"
click node_rooms_seats "https://github.com/duongnthe180971/movietheater/tree/main/Backend/be-movie-theater/src/main/java/com/group3/be/movie/theater/domain/seat"
click node_show_dates "https://github.com/duongnthe180971/movietheater/blob/main/Backend/be-movie-theater/src/main/java/com/group3/be/movie/theater/domain/show_dates/ShowDateService.java"
click node_schedules "https://github.com/duongnthe180971/movietheater/blob/main/Backend/be-movie-theater/src/main/java/com/group3/be/movie/theater/domain/schedule/ScheduleService.java"
click node_booking_ui "https://github.com/duongnthe180971/movietheater/blob/main/Frontend/fe-movie-theater/src/pages/client/ticket/Payment.jsx"
click node_invoices "https://github.com/duongnthe180971/movietheater/blob/main/Backend/be-movie-theater/src/main/java/com/group3/be/movie/theater/domain/invoice/InvoiceService.java"
click node_schedule_seats "https://github.com/duongnthe180971/movietheater/tree/main/Backend/be-movie-theater/src/main/java/com/group3/be/movie/theater/domain/schedule_seat"
click node_vnpay "https://github.com/duongnthe180971/movietheater/tree/main/Backend/be-movie-theater/src/main/java/com/group3/be/movie/theater/domain/vnpay"
click node_accounts "https://github.com/duongnthe180971/movietheater/blob/main/Backend/be-movie-theater/src/main/java/com/group3/be/movie/theater/domain/account/AccountService.java"
click node_roles "https://github.com/duongnthe180971/movietheater/blob/main/Backend/be-movie-theater/src/main/java/com/group3/be/movie/theater/domain/role/RoleService.java"
click node_promotions "https://github.com/duongnthe180971/movietheater/tree/main/Backend/be-movie-theater/src/main/java/com/group3/be/movie/theater/domain/promotion"
click node_files "https://github.com/duongnthe180971/movietheater/blob/main/Backend/be-movie-theater/src/main/java/com/group3/be/movie/theater/util/file/FileService.java"

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_routes,node_customer_pages,node_admin_pages,node_api_clients toneBlue
class node_movies,node_rooms_seats,node_show_dates,node_schedules,node_mysql toneAmber
class node_booking_ui,node_invoices,node_schedule_seats,node_vnpay toneMint
class node_accounts,node_roles,node_promotions,node_files toneRose
class node_customer,node_admin,node_vnpay_service,node_email toneIndigo
```

## Components

### Web experience

- [Route dispatch](https://github.com/duongnthe180971/movietheater/blob/main/Frontend/fe-movie-theater/src/routes.jsx): `Frontend/fe-movie-theater/src/routes.jsx`
- [Customer pages](https://github.com/duongnthe180971/movietheater/tree/main/Frontend/fe-movie-theater/src/pages/client): `Frontend/fe-movie-theater/src/pages/client`
- [Admin pages](https://github.com/duongnthe180971/movietheater/tree/main/Frontend/fe-movie-theater/src/pages/admin): `Frontend/fe-movie-theater/src/pages/admin`
- [API clients](https://github.com/duongnthe180971/movietheater/tree/main/Frontend/fe-movie-theater/src/api): `Frontend/fe-movie-theater/src/api`

### Catalog and scheduling

- [Movie catalog](https://github.com/duongnthe180971/movietheater/tree/main/Backend/be-movie-theater/src/main/java/com/group3/be/movie/theater/domain/movie): `Backend/be-movie-theater/src/main/java/com/group3/be/movie/theater/domain/movie`
- [Rooms and seats](https://github.com/duongnthe180971/movietheater/tree/main/Backend/be-movie-theater/src/main/java/com/group3/be/movie/theater/domain/seat): `Backend/be-movie-theater/src/main/java/com/group3/be/movie/theater/domain/seat`
- [Show dates](https://github.com/duongnthe180971/movietheater/blob/main/Backend/be-movie-theater/src/main/java/com/group3/be/movie/theater/domain/show_dates/ShowDateService.java): `Backend/be-movie-theater/src/main/java/com/group3/be/movie/theater/domain/show_dates/ShowDateService.java`
- [Schedules](https://github.com/duongnthe180971/movietheater/blob/main/Backend/be-movie-theater/src/main/java/com/group3/be/movie/theater/domain/schedule/ScheduleService.java): `Backend/be-movie-theater/src/main/java/com/group3/be/movie/theater/domain/schedule/ScheduleService.java`

### Booking and payment

- [Ticket and invoice UI](https://github.com/duongnthe180971/movietheater/blob/main/Frontend/fe-movie-theater/src/pages/client/ticket/Payment.jsx): `Frontend/fe-movie-theater/src/pages/client/ticket/Payment.jsx`
- [Invoice processing](https://github.com/duongnthe180971/movietheater/blob/main/Backend/be-movie-theater/src/main/java/com/group3/be/movie/theater/domain/invoice/InvoiceService.java): `Backend/be-movie-theater/src/main/java/com/group3/be/movie/theater/domain/invoice/InvoiceService.java`
- [Schedule seat state](https://github.com/duongnthe180971/movietheater/tree/main/Backend/be-movie-theater/src/main/java/com/group3/be/movie/theater/domain/schedule_seat): `Backend/be-movie-theater/src/main/java/com/group3/be/movie/theater/domain/schedule_seat`
- [VNPay integration](https://github.com/duongnthe180971/movietheater/tree/main/Backend/be-movie-theater/src/main/java/com/group3/be/movie/theater/domain/vnpay): `Backend/be-movie-theater/src/main/java/com/group3/be/movie/theater/domain/vnpay`

### Identity and administration

- [Accounts and OTP](https://github.com/duongnthe180971/movietheater/blob/main/Backend/be-movie-theater/src/main/java/com/group3/be/movie/theater/domain/account/AccountService.java): `Backend/be-movie-theater/src/main/java/com/group3/be/movie/theater/domain/account/AccountService.java`
- [Roles and permissions](https://github.com/duongnthe180971/movietheater/blob/main/Backend/be-movie-theater/src/main/java/com/group3/be/movie/theater/domain/role/RoleService.java): `Backend/be-movie-theater/src/main/java/com/group3/be/movie/theater/domain/role/RoleService.java`
- [Promotions](https://github.com/duongnthe180971/movietheater/tree/main/Backend/be-movie-theater/src/main/java/com/group3/be/movie/theater/domain/promotion): `Backend/be-movie-theater/src/main/java/com/group3/be/movie/theater/domain/promotion`
- [Image files](https://github.com/duongnthe180971/movietheater/blob/main/Backend/be-movie-theater/src/main/java/com/group3/be/movie/theater/util/file/FileService.java): `Backend/be-movie-theater/src/main/java/com/group3/be/movie/theater/util/file/FileService.java`

### Other components

- **Customer**
- **Administrator**
- **MySQL database**
- **VNPay gateway**
- **Email service**

## Connections

- Customer → Route dispatch: browses (evidence: `Frontend/fe-movie-theater/src/routes.jsx`)
- Administrator → Route dispatch: manages (evidence: `Frontend/fe-movie-theater/src/routes.jsx`)
- Route dispatch → Customer pages: routes to (evidence: `Frontend/fe-movie-theater/src/routes.jsx`)
- Route dispatch → Admin pages: routes to (evidence: `Frontend/fe-movie-theater/src/routes.jsx`)
- Customer pages → API clients: requests data
- Admin pages → API clients: requests data
- API clients → Movie catalog: calls REST API (evidence: `README.md`)
- API clients → Show dates: calls REST API (evidence: `README.md`)
- API clients → Schedules: calls REST API (evidence: `README.md`)
- API clients → Rooms and seats: calls REST API (evidence: `README.md`)
- Ticket and invoice UI → API clients: starts payment
- API clients → Invoice processing: submits booking (evidence: `README.md`)
- Invoice processing → Accounts and OTP: loads account (evidence: `Backend/be-movie-theater/src/main/java/com/group3/be/movie/theater/domain/invoice/InvoiceService.java`)
- Invoice processing → Schedule seat state: updates seat state (evidence: `Backend/be-movie-theater/src/main/java/com/group3/be/movie/theater/domain/invoice/InvoiceService.java`)
- Invoice processing → VNPay integration: processes payment (evidence: `README.md`)
- VNPay integration → VNPay gateway: redirects payment (evidence: `README.md`)
- Schedules → Show dates: loads show dates (evidence: `Backend/be-movie-theater/src/main/java/com/group3/be/movie/theater/domain/schedule/ScheduleService.java`)
- Show dates → Schedules: creates schedules (evidence: `Backend/be-movie-theater/src/main/java/com/group3/be/movie/theater/domain/show_dates/ShowDateService.java`)
- Accounts and OTP → Email service: sends OTP (evidence: `README.md`)
- Accounts and OTP → Roles and permissions: assigns role (evidence: `Backend/be-movie-theater/src/main/java/com/group3/be/movie/theater/domain/account/AccountService.java`)
- Roles and permissions → MySQL database: persists roles (evidence: `README.md`)
- Movie catalog → MySQL database: persists catalog (evidence: `README.md`)
- Rooms and seats → MySQL database: persists layout (evidence: `README.md`)
- Show dates → MySQL database: persists dates (evidence: `README.md`)
- Schedules → MySQL database: persists schedules (evidence: `README.md`)
- Invoice processing → MySQL database: persists invoices (evidence: `README.md`)
- Schedule seat state → MySQL database: persists seat state (evidence: `README.md`)
- Promotions → MySQL database: persists promotions (evidence: `README.md`)
- Image files → Customer pages: serves images (evidence: `README.md`)
