# joyannbalaguer/hotel-management-system architecture

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

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

## Overview

This Laravel application supports hotel room bookings and separate facility reservations, with guest accounts, deposits, staff operations, invoices, reporting, and reviews. Guests enter through web routes, authenticate, submit a booking or facility reservation, and follow its approval and payment state; staff manage inventory and operational records. The excerpts show booking and reservation controllers handling availability, deposits, and persistence, and the booking model’s relationships. Other controllers and views are represented from the route index and file tree; their internal behavior was not sampled, so those connections are limited.

Main entry points: [`routes/web.php`](https://github.com/joyannbalaguer/hotel-management-system/blob/master/routes/web.php) (Web routes), [`app/Http/Controllers/BookingController.php`](https://github.com/joyannbalaguer/hotel-management-system/blob/master/app/Http/Controllers/BookingController.php) (Room booking), [`app/Models/Booking.php`](https://github.com/joyannbalaguer/hotel-management-system/blob/master/app/Models/Booking.php) (Booking records), [`app/Http/Controllers/ReservationController.php`](https://github.com/joyannbalaguer/hotel-management-system/blob/master/app/Http/Controllers/ReservationController.php) (Facility reservation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Web entry and identity"]
  node_web_routes["Web routes<br/>[web.php]"]
  node_guest_auth["Guest accounts"]
end

subgraph group_stays["Room bookings"]
  node_booking["Room booking"]
  node_booking_state[("Booking records<br/>[Booking.php]")]
  node_room[("Rooms<br/>[Room.php]")]
  node_room_types[("Room types<br/>[RoomType.php]")]
  node_coupon[("Discount coupons<br/>[Coupon.php]")]
  node_guest_model[("Guest records<br/>[Guest.php]")]
end

subgraph group_facilities["Facility reservations"]
  node_facility_res["Facility reservation"]
  node_reservation_state[("Reservation records<br/>[Reservation.php]")]
  node_facility[("Facilities<br/>[Facility.php]")]
end

subgraph group_operations["Staff operations"]
  node_admin_auth["Staff sign-in"]
  node_admin_ops["Staff operations"]
  node_payments[("Payment records<br/>[Payment.php]")]
  node_invoices[("Invoices<br/>[Invoice.php]")]
  node_comments["Guest reviews"]
  node_reports["Reports"]
end

node_guest(("Guest"))
node_staff(("Staff"))
node_paymongo["PayMongo"]

node_guest -->|"opens pages"| node_web_routes
node_staff -->|"opens pages"| node_web_routes
node_web_routes -->|"routes requests"| node_guest_auth
node_web_routes -->|"routes requests"| node_booking
node_web_routes -->|"routes requests"| node_facility_res
node_web_routes -->|"routes requests"| node_admin_auth
node_web_routes -->|"routes requests"| node_admin_ops
node_web_routes -->|"routes requests"| node_comments
node_web_routes -->|"routes requests"| node_reports
node_booking -->|"creates and reads"| node_booking_state
node_booking -->|"checks availability"| node_room
node_booking -->|"loads options"| node_room_types
node_booking -->|"loads discounts"| node_coupon
node_booking -->|"creates checkout"| node_paymongo
node_booking_state -->|"belongs to"| node_guest_model
node_booking_state -->|"has payments"| node_payments
node_booking_state -->|"has invoice"| node_invoices
node_facility_res -->|"creates and reads"| node_reservation_state
node_facility_res -->|"loads facilities"| node_facility
node_facility_res -->|"creates checkout"| node_paymongo
node_reservation_state -->|"belongs to"| node_facility
node_comments -->|"uses booking"| node_booking_state
node_reports -->|"queries bookings"| node_booking_state
node_reports -->|"queries payments"| node_payments
node_reports -->|"queries reservations"| node_reservation_state

click node_web_routes "https://github.com/joyannbalaguer/hotel-management-system/blob/master/routes/web.php"
click node_guest_auth "https://github.com/joyannbalaguer/hotel-management-system/blob/master/app/Http/Controllers/GuestAuthController.php"
click node_booking "https://github.com/joyannbalaguer/hotel-management-system/blob/master/app/Http/Controllers/BookingController.php"
click node_booking_state "https://github.com/joyannbalaguer/hotel-management-system/blob/master/app/Models/Booking.php"
click node_room "https://github.com/joyannbalaguer/hotel-management-system/blob/master/app/Models/Room.php"
click node_room_types "https://github.com/joyannbalaguer/hotel-management-system/blob/master/app/Models/RoomType.php"
click node_coupon "https://github.com/joyannbalaguer/hotel-management-system/blob/master/app/Models/Coupon.php"
click node_guest_model "https://github.com/joyannbalaguer/hotel-management-system/blob/master/app/Models/Guest.php"
click node_facility_res "https://github.com/joyannbalaguer/hotel-management-system/blob/master/app/Http/Controllers/ReservationController.php"
click node_reservation_state "https://github.com/joyannbalaguer/hotel-management-system/blob/master/app/Models/Reservation.php"
click node_facility "https://github.com/joyannbalaguer/hotel-management-system/blob/master/app/Models/Facility.php"
click node_admin_auth "https://github.com/joyannbalaguer/hotel-management-system/blob/master/app/Http/Controllers/AdminAuthController.php"
click node_admin_ops "https://github.com/joyannbalaguer/hotel-management-system/blob/master/app/Http/Controllers/DashboardController.php"
click node_payments "https://github.com/joyannbalaguer/hotel-management-system/blob/master/app/Models/Payment.php"
click node_invoices "https://github.com/joyannbalaguer/hotel-management-system/blob/master/app/Models/Invoice.php"
click node_comments "https://github.com/joyannbalaguer/hotel-management-system/blob/master/app/Http/Controllers/CommentController.php"
click node_reports "https://github.com/joyannbalaguer/hotel-management-system/blob/master/app/Http/Controllers/ReportController.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_web_routes,node_guest_auth toneBlue
class node_booking,node_booking_state,node_room,node_room_types,node_coupon,node_guest_model toneAmber
class node_facility_res,node_reservation_state,node_facility toneMint
class node_admin_auth,node_admin_ops,node_payments,node_invoices,node_comments,node_reports toneRose
class node_guest,node_staff,node_paymongo toneIndigo
```

## Components

### Web entry and identity

- [Web routes](https://github.com/joyannbalaguer/hotel-management-system/blob/master/routes/web.php): `routes/web.php`
- [Guest accounts](https://github.com/joyannbalaguer/hotel-management-system/blob/master/app/Http/Controllers/GuestAuthController.php): `app/Http/Controllers/GuestAuthController.php`

### Room bookings

- [Room booking](https://github.com/joyannbalaguer/hotel-management-system/blob/master/app/Http/Controllers/BookingController.php): `app/Http/Controllers/BookingController.php`
- [Booking records](https://github.com/joyannbalaguer/hotel-management-system/blob/master/app/Models/Booking.php): `app/Models/Booking.php`
- [Rooms](https://github.com/joyannbalaguer/hotel-management-system/blob/master/app/Models/Room.php): `app/Models/Room.php`
- [Room types](https://github.com/joyannbalaguer/hotel-management-system/blob/master/app/Models/RoomType.php): `app/Models/RoomType.php`
- [Discount coupons](https://github.com/joyannbalaguer/hotel-management-system/blob/master/app/Models/Coupon.php): `app/Models/Coupon.php`
- [Guest records](https://github.com/joyannbalaguer/hotel-management-system/blob/master/app/Models/Guest.php): `app/Models/Guest.php`

### Facility reservations

- [Facility reservation](https://github.com/joyannbalaguer/hotel-management-system/blob/master/app/Http/Controllers/ReservationController.php): `app/Http/Controllers/ReservationController.php`
- [Reservation records](https://github.com/joyannbalaguer/hotel-management-system/blob/master/app/Models/Reservation.php): `app/Models/Reservation.php`
- [Facilities](https://github.com/joyannbalaguer/hotel-management-system/blob/master/app/Models/Facility.php): `app/Models/Facility.php`

### Staff operations

- [Staff sign-in](https://github.com/joyannbalaguer/hotel-management-system/blob/master/app/Http/Controllers/AdminAuthController.php): `app/Http/Controllers/AdminAuthController.php`
- [Staff operations](https://github.com/joyannbalaguer/hotel-management-system/blob/master/app/Http/Controllers/DashboardController.php): `app/Http/Controllers/DashboardController.php`
- [Payment records](https://github.com/joyannbalaguer/hotel-management-system/blob/master/app/Models/Payment.php): `app/Models/Payment.php`
- [Invoices](https://github.com/joyannbalaguer/hotel-management-system/blob/master/app/Models/Invoice.php): `app/Models/Invoice.php`
- [Guest reviews](https://github.com/joyannbalaguer/hotel-management-system/blob/master/app/Http/Controllers/CommentController.php): `app/Http/Controllers/CommentController.php`
- [Reports](https://github.com/joyannbalaguer/hotel-management-system/blob/master/app/Http/Controllers/ReportController.php): `app/Http/Controllers/ReportController.php`

### Other components

- **Guest**
- **Staff**
- **PayMongo**

## Connections

- Guest → Web routes: opens pages (evidence: `routes/web.php`)
- Staff → Web routes: opens pages (evidence: `routes/web.php`)
- Web routes → Guest accounts: routes requests (evidence: `routes/web.php`)
- Web routes → Room booking: routes requests (evidence: `routes/web.php`)
- Web routes → Facility reservation: routes requests (evidence: `routes/web.php`)
- Web routes → Staff sign-in: routes requests (evidence: `routes/web.php`)
- Web routes → Staff operations: routes requests (evidence: `routes/web.php`)
- Web routes → Guest reviews: routes requests (evidence: `routes/web.php`)
- Web routes → Reports: routes requests (evidence: `routes/web.php`)
- Room booking → Booking records: creates and reads (evidence: `app/Http/Controllers/BookingController.php`)
- Room booking → Rooms: checks availability (evidence: `app/Http/Controllers/BookingController.php`)
- Room booking → Room types: loads options (evidence: `app/Http/Controllers/BookingController.php`)
- Room booking → Discount coupons: loads discounts (evidence: `app/Http/Controllers/BookingController.php`)
- Room booking → PayMongo: creates checkout (evidence: `app/Http/Controllers/BookingController.php`)
- Booking records → Guest records: belongs to (evidence: `app/Models/Booking.php`)
- Booking records → Payment records: has payments (evidence: `app/Models/Booking.php`)
- Booking records → Invoices: has invoice (evidence: `app/Models/Booking.php`)
- Facility reservation → Reservation records: creates and reads (evidence: `app/Http/Controllers/ReservationController.php`)
- Facility reservation → Facilities: loads facilities (evidence: `app/Http/Controllers/ReservationController.php`)
- Facility reservation → PayMongo: creates checkout (evidence: `app/Http/Controllers/ReservationController.php`)
- Reservation records → Facilities: belongs to (evidence: `app/Models/Reservation.php`)
- Guest reviews → Booking records: uses booking (evidence: `app/Http/Controllers/CommentController.php`)
- Reports → Booking records: queries bookings (evidence: `app/Http/Controllers/ReportController.php`)
- Reports → Payment records: queries payments (evidence: `app/Http/Controllers/ReportController.php`)
- Reports → Reservation records: queries reservations (evidence: `app/Http/Controllers/ReportController.php`)
