# anhhoang0529/hotel-management-system architecture

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

- Interactive diagram: https://gitdiagram.com/anhhoang0529/hotel-management-system
- Repository: https://github.com/anhhoang0529/hotel-management-system

## Overview

Hotel Management System is a PHP/MySQL hotel website with a public-facing site and a staff management area. Guests browse rooms and hotel offerings, then reach the booking page; staff use the management portal for login, booking administration, check-in, checkout, and hotel resource management. The README also documents invoice printing and account, customer, room, and room-type management. The source index confirms several page-to-database references, but the booking and checkout implementation details are not fully shown, so those workflow links are not inferred.

Main entry points: [`admin/db_connect.php`](https://github.com/anhhoang0529/hotel-management-system/blob/main/admin/db_connect.php) (MySQL Hotel Data), [`homepage/index.php`](https://github.com/anhhoang0529/hotel-management-system/blob/main/homepage/index.php) (Homepage), [`homepage/book.php`](https://github.com/anhhoang0529/hotel-management-system/blob/main/homepage/book.php) (Booking Page), [`admin/index.php`](https://github.com/anhhoang0529/hotel-management-system/blob/main/admin/index.php) (Management Portal)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_public["Guest Website"]
  node_homepage["Homepage<br/>[index.php]"]
  node_room_catalog["Room Details<br/>[room.php]"]
  node_services["Services<br/>[service.php]"]
  node_food["Food And Drinks<br/>[food.php]"]
end

subgraph group_booking["Booking"]
  node_booking_page["Booking Page<br/>[book.php]"]
  node_public_db["Booking Connection<br/>[connect.php]"]
end

subgraph group_staff["Staff Portal"]
  node_staff_login["Staff Login<br/>[login.php]"]
  node_auth_handler["Login Handler<br/>[xuli_login.php]"]
  node_admin_router["Management Portal<br/>[index.php]"]
  node_dashboard["Dashboard<br/>[home.php]"]
  node_metrics["Dashboard Metrics"]
end

subgraph group_operations["Front Desk"]
  node_frontdesk["Reception Workflow<br/>[check_in.php]"]
  node_checkin_admin["Check-In Management"]
  node_checkout_admin["Checkout And Invoice<br/>[check_out.php]"]
  node_booking_admin["Booking Management<br/>[manage_booking.php]"]
end

subgraph group_management["Hotel Administration"]
  node_customers["Customer Management"]
  node_rooms["Room Management<br/>[manage_room.php]"]
  node_users["Account Management<br/>[manage_user.php]"]
  node_database[("MySQL Hotel Data<br/>[db_connect.php]")]
end

node_guest(("Guest"))

node_guest -->|"browses"| node_homepage
node_homepage -->|"links to"| node_room_catalog
node_homepage -->|"links to"| node_services
node_homepage -->|"links to"| node_food
node_homepage -->|"links to"| node_booking_page
node_room_catalog -->|"links to"| node_booking_page
node_booking_page -.->|"uses connection"| node_public_db
node_guest -->|"books room"| node_booking_page
node_staff_login -->|"queries"| node_database
node_staff_login -.->|"submits login"| node_auth_handler
node_auth_handler -->|"queries"| node_database
node_admin_router -->|"loads default"| node_dashboard
node_admin_router -.->|"routes pages"| node_booking_admin
node_admin_router -.->|"routes pages"| node_frontdesk
node_dashboard -->|"includes counters"| node_metrics
node_dashboard -->|"queries"| node_database
node_frontdesk -->|"queries"| node_database
node_checkin_admin -->|"queries"| node_database
node_checkout_admin -->|"queries"| node_database
node_booking_admin -->|"queries"| node_database
node_customers -->|"queries"| node_database
node_rooms -->|"queries"| node_database
node_users -->|"queries"| node_database
node_database -.->|"stores records"| node_frontdesk
node_guest -->|"staff access"| node_staff_login

click node_homepage "https://github.com/anhhoang0529/hotel-management-system/blob/main/homepage/index.php"
click node_room_catalog "https://github.com/anhhoang0529/hotel-management-system/blob/main/homepage/room.php"
click node_services "https://github.com/anhhoang0529/hotel-management-system/blob/main/homepage/service.php"
click node_food "https://github.com/anhhoang0529/hotel-management-system/blob/main/homepage/food.php"
click node_booking_page "https://github.com/anhhoang0529/hotel-management-system/blob/main/homepage/book.php"
click node_public_db "https://github.com/anhhoang0529/hotel-management-system/blob/main/homepage/connect.php"
click node_staff_login "https://github.com/anhhoang0529/hotel-management-system/blob/main/admin/login.php"
click node_auth_handler "https://github.com/anhhoang0529/hotel-management-system/blob/main/admin/xuli_login.php"
click node_admin_router "https://github.com/anhhoang0529/hotel-management-system/blob/main/admin/index.php"
click node_dashboard "https://github.com/anhhoang0529/hotel-management-system/blob/main/admin/home.php"
click node_metrics "https://github.com/anhhoang0529/hotel-management-system/tree/main/admin/counters"
click node_frontdesk "https://github.com/anhhoang0529/hotel-management-system/blob/main/admin/check_in.php"
click node_checkin_admin "https://github.com/anhhoang0529/hotel-management-system/blob/main/admin/manage_check_in.php"
click node_checkout_admin "https://github.com/anhhoang0529/hotel-management-system/blob/main/admin/check_out.php"
click node_booking_admin "https://github.com/anhhoang0529/hotel-management-system/blob/main/admin/manage_booking.php"
click node_customers "https://github.com/anhhoang0529/hotel-management-system/blob/main/admin/manage_customer.php"
click node_rooms "https://github.com/anhhoang0529/hotel-management-system/blob/main/admin/manage_room.php"
click node_users "https://github.com/anhhoang0529/hotel-management-system/blob/main/admin/manage_user.php"
click node_database "https://github.com/anhhoang0529/hotel-management-system/blob/main/admin/db_connect.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_homepage,node_room_catalog,node_services,node_food toneBlue
class node_booking_page,node_public_db toneAmber
class node_staff_login,node_auth_handler,node_admin_router,node_dashboard,node_metrics toneMint
class node_frontdesk,node_checkin_admin,node_checkout_admin,node_booking_admin toneRose
class node_customers,node_rooms,node_users,node_database,node_guest toneIndigo
```

## Components

### Guest Website

- [Homepage](https://github.com/anhhoang0529/hotel-management-system/blob/main/homepage/index.php): `homepage/index.php`
- [Room Details](https://github.com/anhhoang0529/hotel-management-system/blob/main/homepage/room.php): `homepage/room.php`
- [Services](https://github.com/anhhoang0529/hotel-management-system/blob/main/homepage/service.php): `homepage/service.php`
- [Food And Drinks](https://github.com/anhhoang0529/hotel-management-system/blob/main/homepage/food.php): `homepage/food.php`

### Booking

- [Booking Page](https://github.com/anhhoang0529/hotel-management-system/blob/main/homepage/book.php): `homepage/book.php`
- [Booking Connection](https://github.com/anhhoang0529/hotel-management-system/blob/main/homepage/connect.php): `homepage/connect.php`

### Staff Portal

- [Staff Login](https://github.com/anhhoang0529/hotel-management-system/blob/main/admin/login.php): `admin/login.php`
- [Login Handler](https://github.com/anhhoang0529/hotel-management-system/blob/main/admin/xuli_login.php): `admin/xuli_login.php`
- [Management Portal](https://github.com/anhhoang0529/hotel-management-system/blob/main/admin/index.php): `admin/index.php`
- [Dashboard](https://github.com/anhhoang0529/hotel-management-system/blob/main/admin/home.php): `admin/home.php`
- [Dashboard Metrics](https://github.com/anhhoang0529/hotel-management-system/tree/main/admin/counters): `admin/counters`

### Front Desk

- [Reception Workflow](https://github.com/anhhoang0529/hotel-management-system/blob/main/admin/check_in.php): `admin/check_in.php`
- [Check-In Management](https://github.com/anhhoang0529/hotel-management-system/blob/main/admin/manage_check_in.php): `admin/manage_check_in.php`
- [Checkout And Invoice](https://github.com/anhhoang0529/hotel-management-system/blob/main/admin/check_out.php): `admin/check_out.php`
- [Booking Management](https://github.com/anhhoang0529/hotel-management-system/blob/main/admin/manage_booking.php): `admin/manage_booking.php`

### Hotel Administration

- [Customer Management](https://github.com/anhhoang0529/hotel-management-system/blob/main/admin/manage_customer.php): `admin/manage_customer.php`
- [Room Management](https://github.com/anhhoang0529/hotel-management-system/blob/main/admin/manage_room.php): `admin/manage_room.php`
- [Account Management](https://github.com/anhhoang0529/hotel-management-system/blob/main/admin/manage_user.php): `admin/manage_user.php`
- [MySQL Hotel Data](https://github.com/anhhoang0529/hotel-management-system/blob/main/admin/db_connect.php): `admin/db_connect.php`

### Other components

- **Guest**

## Connections

- Guest → Homepage: browses (evidence: `README.md`)
- Homepage → Room Details: links to (evidence: `homepage/index.php`)
- Homepage → Services: links to (evidence: `homepage/index.php`)
- Homepage → Food And Drinks: links to (evidence: `homepage/index.php`)
- Homepage → Booking Page: links to (evidence: `homepage/index.php`)
- Room Details → Booking Page: links to (evidence: `homepage/room.php`)
- Booking Page → Booking Connection: uses connection
- Guest → Booking Page: books room (evidence: `README.md`)
- Staff Login → MySQL Hotel Data: queries (evidence: `admin/login.php`)
- Staff Login → Login Handler: submits login
- Login Handler → MySQL Hotel Data: queries (evidence: `admin/xuli_login.php`)
- Management Portal → Dashboard: loads default (evidence: `admin/index.php`)
- Management Portal → Booking Management: routes pages
- Management Portal → Reception Workflow: routes pages
- Dashboard → Dashboard Metrics: includes counters (evidence: `admin/home.php`)
- Dashboard → MySQL Hotel Data: queries (evidence: `admin/home.php`)
- Reception Workflow → MySQL Hotel Data: queries (evidence: `admin/check_in.php`)
- Check-In Management → MySQL Hotel Data: queries (evidence: `admin/manage_check_in.php`)
- Checkout And Invoice → MySQL Hotel Data: queries (evidence: `admin/check_out.php`)
- Booking Management → MySQL Hotel Data: queries (evidence: `admin/manage_booking.php`)
- Customer Management → MySQL Hotel Data: queries (evidence: `admin/manage_customer.php`)
- Room Management → MySQL Hotel Data: queries (evidence: `admin/manage_room.php`)
- Account Management → MySQL Hotel Data: queries (evidence: `admin/manage_user.php`)
- MySQL Hotel Data → Reception Workflow: stores records (evidence: `admin/check_in.php`)
- Guest → Staff Login: staff access (evidence: `README.md`)
