# nirmalfdo183/web_project-moviebook architecture

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

- Interactive diagram: https://gitdiagram.com/nirmalfdo183/web_project-moviebook
- Repository: https://github.com/nirmalfdo183/web_project-moviebook

## Overview

1. This is a monolithic Core PHP application for online movie booking, with a split between the public customer site and a separate admin back office. The main entry points are top-level PHP pages, not a framework-based app.

2. The public UI is page-oriented: `index.php`, `allmovie.php`, `movie_details.php`, `seatbooking.php`, `payment.php`, `my_bookings.php`, `contact.php`, `feedback.php`, and account pages like `login.php`, `register.php`, `forget.php`, `reset_password.php`, and `edit_profile.php`. Shared layout is assembled through `header.php`, `footer.php`, `breadcrumb.php`, and CSS/JS assets under `css/` and `js/`.

3. The booking flow is the core runtime path: users browse movies, open a movie detail page, choose show/seat selection in `seatbooking.php`, then proceed to payment-related pages (`payment_form.php`, `payment.php`). After booking, tickets can be viewed, downloaded, or printed through `my_bookings.php`, `download_ticket.php`, `temp_ticket_show.php`, and ticket-related scripts.

4. The app has a clear ticketing/output subsystem. It bundles `tcpdf/` for PDF generation and `qr-code-main/` for QR code generation, which strongly suggests tickets are produced as downloadable PDFs with embedded QR codes for validation at the theater.

5. Authentication and profile management are handled entirely in PHP with dedicated endpoints for signup, login, logout, password recovery, and validation. `check_username.php`, `forgot_password_request.php`, `forget_password.php`, `reset_password.php`, and `logout.php` indicate a self-managed user account flow rather than an external identity provider.

6. The admin area is isolated under `admin/` and has its own login, layout templates, scripts, and styles. Key admin screens include `admin/index.php`, `admin/Add-movie.php`, `admin/Theater_and_show.php`, `admin/customers.php`, `admin/users.php`, and `admin/feedback.php`, with reusable admin chrome in `admin/templates/`.

7. Admin responsibilities center on content and operational management: adding movies, configuring theaters/showtimes, viewing customers/users, reviewing feedback, and handling data insertion/search. `admin/search_tmdb.php` indicates the admin can enrich movie data from the TMDb API, making the system partially dependent on an external movie metadata service.

8. Persistence is relational and file-backed by a SQL dump. `moviebook.sql` is the database schema/bootstrap, while `database_connection.php`, `Database.php`, and `admin/Database.php` are the connection layers used by the public and admin sides. The architecture implies a shared database accessed directly from PHP pages.

9. Server-side processing is mostly request/response with some AJAX support. Files like `allmovie_fetch.php`, `feedback_action.php`, `check_username.php`, and `admin/ajaxValidation.js` show that certain UI actions are asynchronously validated or populated without full page reloads.

10. The application is styled as a traditional server-rendered site. Most interaction is driven by static assets in `css/`, `js/`, `img/`, `fonts/`, and `admin/css`/`admin/js`, with Bootstrap and custom theme files handling page composition, forms, and booking UI.

11. The repo includes a large amount of vendored third-party code rather than depending only on Composer packages. `tcpdf/` and `qr-code-main/` are embedded libraries, and `vendor/` suggests additional Composer-managed dependencies. This matters architecturally because ticket generation and output formatting are implemented locally, not outsourced.

12. If you are drawing the architecture, the main boundaries are: public customer UI, admin back office, shared database layer, ticket/PDF+QR generation, and external movie-metadata integration. Data primarily flows from browser forms to PHP handlers to MySQL, then back to rendered HTML/PDF ticket artifacts.

Main entry points: [`header.php`](https://github.com/nirmalfdo183/web_project-moviebook/blob/main/header.php) (Shared layout), [`database_connection.php`](https://github.com/nirmalfdo183/web_project-moviebook/blob/main/database_connection.php) (DB access), [`admin/Add-movie.php`](https://github.com/nirmalfdo183/web_project-moviebook/blob/main/admin/Add-movie.php) (Content ops), [`download_ticket.php`](https://github.com/nirmalfdo183/web_project-moviebook/blob/main/download_ticket.php) (Tickets)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_public["Public site"]
  node_index["Home<br/>public page<br/>[index.php]"]
  node_allmovie["Browse movies<br/>public page<br/>[allmovie.php]"]
  node_movie_details["Movie details<br/>public page<br/>[movie_details.php]"]
  node_seatbooking["Seat booking<br/>booking page<br/>[seatbooking.php]"]
  node_payment_form["Payment form<br/>checkout page<br/>[payment_form.php]"]
  node_payment["Payment<br/>checkout page<br/>[payment.php]"]
  node_my_bookings["My bookings<br/>account page<br/>[my_bookings.php]"]
  node_account["Auth & profile<br/>account flow<br/>[login.php]"]
end

subgraph group_admin["Admin back office"]
  node_admin_home["Admin home<br/>admin dashboard<br/>[index.php]"]
  node_admin_content["Content ops<br/>admin pages<br/>[Add-movie.php]"]
  node_admin_users["Users & feedback<br/>admin pages<br/>[customers.php]"]
  node_admin_layout["Admin chrome<br/>admin templates<br/>[navbar.php]"]
end

subgraph group_shared["Shared runtime"]
  node_shared_layout["Shared layout<br/>ui templates<br/>[header.php]"]
  node_shared_assets["Assets"]
  node_db_layer[("DB access<br/>database layer")]
  node_schema["Schema dump<br/>sql bootstrap<br/>[moviebook.sql]"]
end

subgraph group_ticketing["Ticket output"]
  node_tickets["Tickets<br/>output flow"]
  node_pdf_engine["PDF engine<br/>vendor library<br/>[tcpdf.php]"]
  node_qr_engine["QR engine<br/>vendor library<br/>[QrCode.php]"]
end

subgraph group_external["External services"]
  node_tmdb(("TMDb API<br/>external service"))
end

node_index -->|"renders with"| node_shared_layout
node_allmovie -->|"renders with"| node_shared_layout
node_movie_details -->|"renders with"| node_shared_layout
node_seatbooking -->|"renders with"| node_shared_layout
node_payment_form -->|"renders with"| node_shared_layout
node_payment -->|"renders with"| node_shared_layout
node_my_bookings -->|"renders with"| node_shared_layout
node_account -->|"renders with"| node_shared_layout
node_shared_layout -->|"loads"| node_shared_assets
node_index -->|"reads data"| node_db_layer
node_allmovie -->|"reads data"| node_db_layer
node_movie_details -->|"reads data"| node_db_layer
node_seatbooking -->|"writes booking"| node_db_layer
node_payment -->|"confirms booking"| node_db_layer
node_my_bookings -->|"opens tickets"| node_tickets
node_tickets -->|"generates PDF"| node_pdf_engine
node_tickets -->|"embeds QR"| node_qr_engine
node_admin_home -->|"renders with"| node_admin_layout
node_admin_content -->|"renders with"| node_admin_layout
node_admin_users -->|"renders with"| node_admin_layout
node_admin_home -->|"manages data"| node_db_layer
node_admin_content -->|"manages data"| node_db_layer
node_admin_users -->|"manages data"| node_db_layer
node_admin_content -.->|"enriches metadata"| node_tmdb
node_schema -->|"bootstraps"| node_db_layer

click node_index "https://github.com/nirmalfdo183/web_project-moviebook/blob/main/index.php"
click node_allmovie "https://github.com/nirmalfdo183/web_project-moviebook/blob/main/allmovie.php"
click node_movie_details "https://github.com/nirmalfdo183/web_project-moviebook/blob/main/movie_details.php"
click node_seatbooking "https://github.com/nirmalfdo183/web_project-moviebook/blob/main/seatbooking.php"
click node_payment_form "https://github.com/nirmalfdo183/web_project-moviebook/blob/main/payment_form.php"
click node_payment "https://github.com/nirmalfdo183/web_project-moviebook/blob/main/payment.php"
click node_my_bookings "https://github.com/nirmalfdo183/web_project-moviebook/blob/main/my_bookings.php"
click node_account "https://github.com/nirmalfdo183/web_project-moviebook/blob/main/login.php"
click node_shared_layout "https://github.com/nirmalfdo183/web_project-moviebook/blob/main/header.php"
click node_shared_assets "https://github.com/nirmalfdo183/web_project-moviebook/tree/main/css"
click node_db_layer "https://github.com/nirmalfdo183/web_project-moviebook/blob/main/database_connection.php"
click node_schema "https://github.com/nirmalfdo183/web_project-moviebook/blob/main/moviebook.sql"
click node_tickets "https://github.com/nirmalfdo183/web_project-moviebook/blob/main/download_ticket.php"
click node_pdf_engine "https://github.com/nirmalfdo183/web_project-moviebook/blob/main/tcpdf/tcpdf.php"
click node_qr_engine "https://github.com/nirmalfdo183/web_project-moviebook/blob/main/qr-code-main/src/QrCode.php"
click node_admin_home "https://github.com/nirmalfdo183/web_project-moviebook/blob/main/admin/index.php"
click node_admin_content "https://github.com/nirmalfdo183/web_project-moviebook/blob/main/admin/Add-movie.php"
click node_admin_users "https://github.com/nirmalfdo183/web_project-moviebook/blob/main/admin/customers.php"
click node_admin_layout "https://github.com/nirmalfdo183/web_project-moviebook/blob/main/admin/templates/navbar.php"

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_index,node_allmovie,node_movie_details,node_seatbooking,node_payment_form,node_payment,node_my_bookings,node_account toneBlue
class node_admin_home,node_admin_content,node_admin_users,node_admin_layout toneAmber
class node_shared_layout,node_shared_assets,node_db_layer,node_schema toneMint
class node_tickets,node_pdf_engine,node_qr_engine toneRose
class node_tmdb toneIndigo
```

## Components

### Public site

Customer-facing pages and shared layout for browsing, booking, and account management.

- [Home](https://github.com/nirmalfdo183/web_project-moviebook/blob/main/index.php): public page · Landing page for the customer site. · `index.php`
- [Browse movies](https://github.com/nirmalfdo183/web_project-moviebook/blob/main/allmovie.php): public page · Movie listing and discovery page. · `allmovie.php`
- [Movie details](https://github.com/nirmalfdo183/web_project-moviebook/blob/main/movie_details.php): public page · Detail page for a selected movie and show context. · `movie_details.php`
- [Seat booking](https://github.com/nirmalfdo183/web_project-moviebook/blob/main/seatbooking.php): booking page · Core seat and show selection step in the booking flow. · `seatbooking.php`
- [Payment form](https://github.com/nirmalfdo183/web_project-moviebook/blob/main/payment_form.php): checkout page · Collects payment details before final booking. · `payment_form.php`
- [Payment](https://github.com/nirmalfdo183/web_project-moviebook/blob/main/payment.php): checkout page · Final payment processing and booking confirmation step. · `payment.php`
- [My bookings](https://github.com/nirmalfdo183/web_project-moviebook/blob/main/my_bookings.php): account page · User booking history and ticket access hub. · `my_bookings.php`
- [Auth & profile](https://github.com/nirmalfdo183/web_project-moviebook/blob/main/login.php): account flow · Login, registration, password recovery, logout, and profile editing. · `login.php`

### Admin back office

Separate administrative UI for content, show, and user operations.

- [Admin home](https://github.com/nirmalfdo183/web_project-moviebook/blob/main/admin/index.php): admin dashboard · Entry point for the back-office admin experience. · `admin/index.php`
- [Content ops](https://github.com/nirmalfdo183/web_project-moviebook/blob/main/admin/Add-movie.php): admin pages · Admin pages for adding movies, theater/show setup, insertion, and search enrichment. · `admin/Add-movie.php`
- [Users & feedback](https://github.com/nirmalfdo183/web_project-moviebook/blob/main/admin/customers.php): admin pages · Admin views for customers, users, and feedback moderation. · `admin/customers.php`
- [Admin chrome](https://github.com/nirmalfdo183/web_project-moviebook/blob/main/admin/templates/navbar.php): admin templates · Reusable navigation, sidebar, top bar, and footer templates for the admin area. · `admin/templates/navbar.php`

### Shared runtime

Common database, assets, and utility layers used by both sides.

- [Shared layout](https://github.com/nirmalfdo183/web_project-moviebook/blob/main/header.php): ui templates · Common page chrome and navigation used across the public site. · `header.php`
- [Assets](https://github.com/nirmalfdo183/web_project-moviebook/tree/main/css): static assets · Shared CSS, JavaScript, images, and fonts for the rendered site. · `css`
- [DB access](https://github.com/nirmalfdo183/web_project-moviebook/blob/main/database_connection.php): database layer · Shared connection and helper classes for direct MySQL access. · `database_connection.php`
- [Schema dump](https://github.com/nirmalfdo183/web_project-moviebook/blob/main/moviebook.sql): sql bootstrap · Database schema and seed data for the movie booking application. · `moviebook.sql`

### Ticket output

PDF and QR code generation used for downloadable tickets.

- [Tickets](https://github.com/nirmalfdo183/web_project-moviebook/blob/main/download_ticket.php): output flow · Ticket viewing, download, temporary render, and cancellation-related handling. · `download_ticket.php`
- [PDF engine](https://github.com/nirmalfdo183/web_project-moviebook/blob/main/tcpdf/tcpdf.php): vendor library · Embedded TCPDF library used to generate downloadable PDF tickets. · `tcpdf/tcpdf.php`
- [QR engine](https://github.com/nirmalfdo183/web_project-moviebook/blob/main/qr-code-main/src/QrCode.php): vendor library · Embedded QR code library used to embed validation codes in tickets. · `qr-code-main/src/QrCode.php`

### External services

Third-party or external dependencies integrated by the app.

- **TMDb API**: external service · External movie metadata source used by admin enrichment.

## Connections

- Home → Shared layout: renders with · Public landing page uses the shared site chrome.
- Browse movies → Shared layout: renders with · Movie browsing page is assembled with shared header/footer.
- Movie details → Shared layout: renders with · Details page shares the same site shell.
- Seat booking → Shared layout: renders with · Booking page uses common layout and styling.
- Payment form → Shared layout: renders with · Checkout form is presented in the shared public shell.
- Payment → Shared layout: renders with · Payment step uses shared site templates.
- My bookings → Shared layout: renders with · Booking history page uses the shared layout.
- Auth & profile → Shared layout: renders with · Account pages are rendered through shared templates.
- Shared layout → Assets: loads · Shared templates depend on CSS and JavaScript assets.
- Home → DB access: reads data · Public pages query the shared database layer for listings and content.
- Browse movies → DB access: reads data · Movie list is populated from the database.
- Movie details → DB access: reads data · Movie and show details are fetched from the shared database.
- Seat booking → DB access: writes booking · Seat selection and reservation state are persisted through the DB layer.
- Payment → DB access: confirms booking · Successful checkout updates booking records in the database.
- My bookings → Tickets: opens tickets · Booking history links to viewing, downloading, and printing tickets.
- Tickets → PDF engine: generates PDF · Ticket download output is produced with TCPDF.
- Tickets → QR engine: embeds QR · Tickets include QR codes for validation.
- Admin home → Admin chrome: renders with · Admin dashboard uses its own reusable layout templates.
- Content ops → Admin chrome: renders with · Content management screens use admin chrome.
- Users & feedback → Admin chrome: renders with · User and feedback screens share the admin shell.
- Admin home → DB access: manages data · Admin area reads and writes directly through the shared database layer.
- Content ops → DB access: manages data · Movie, theater, and show administration persists to the database.
- Users & feedback → DB access: manages data · Customer, user, and feedback management uses the shared database.
- Content ops → TMDb API: enriches metadata · Admin can pull movie metadata from TMDb.
- Schema dump → DB access: bootstraps · SQL schema defines the data model used by the PHP connection layer.
