# andbet39/hotel architecture

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

- Interactive diagram: https://gitdiagram.com/andbet39/hotel
- Repository: https://github.com/andbet39/hotel

## Overview

This is a Laravel and AngularJS hotel booking application. Guests search for available rooms, create a reservation, then proceed to payment; hotel staff manage room types and prices. The graph follows the documented SPA-to-REST design and the inspected route and controller code. Payment and several AngularJS module implementations were not sampled, so their internal behavior and dependencies are left unspecified.

Main entry points: [`app/Http/routes.php`](https://github.com/andbet39/hotel/blob/master/app/Http/routes.php) (API routes), [`public/hotel/app/app.js`](https://github.com/andbet39/hotel/blob/master/public/hotel/app/app.js) (Booking SPA), [`app/Http/Controllers/ReservationController.php`](https://github.com/andbet39/hotel/blob/master/app/Http/Controllers/ReservationController.php) (Reservations), [`app/Http/Controllers/RoomCalendarController.php`](https://github.com/andbet39/hotel/blob/master/app/Http/Controllers/RoomCalendarController.php) (Availability and pricing)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["AngularJS app"]
  node_spa["Booking SPA<br/>[app.js]"]
  node_search_ui["Room search<br/>[book.js]"]
  node_finalize_ui["Reservation details<br/>[finalize.js]"]
  node_payment_ui["Payment UI<br/>[pay.js]"]
  node_admin_ui["Room admin UI<br/>[room_admin.js]"]
end

subgraph group_api["Laravel API"]
  node_routes["API routes<br/>[routes.php]"]
  node_calendar_controller["Availability and pricing"]
  node_reservation_controller["Reservations"]
  node_payment_controller["Payment handler"]
  node_room_type_controller["Room type management"]
end

subgraph group_domain["Booking domain"]
  node_room_type["Room types<br/>[RoomType.php]"]
  node_room_calendar["Room calendar<br/>[RoomCalendar.php]"]
  node_reservation["Reservation<br/>[Reservation.php]"]
  node_reservation_night["Reserved nights"]
  node_customer["Customer<br/>[Customer.php]"]
end

node_guest(("Guest"))
node_staff(("Hotel staff"))

node_guest -->|"uses"| node_spa
node_staff -->|"uses"| node_spa
node_spa -->|"includes"| node_search_ui
node_spa -->|"includes"| node_finalize_ui
node_spa -->|"includes"| node_payment_ui
node_spa -->|"includes"| node_admin_ui
node_search_ui -->|"requests search"| node_routes
node_finalize_ui -->|"submits reservation"| node_routes
node_payment_ui -->|"requests payment"| node_routes
node_admin_ui -->|"requests admin"| node_routes
node_routes -->|"dispatches search and pricing"| node_calendar_controller
node_routes -->|"dispatches reservations"| node_reservation_controller
node_routes -->|"dispatches payment"| node_payment_controller
node_routes -->|"dispatches room types"| node_room_type_controller
node_calendar_controller -->|"queries room types"| node_room_type
node_calendar_controller -->|"queries and updates calendar"| node_room_calendar
node_reservation_controller -->|"creates and reads"| node_reservation
node_reservation_controller -->|"finds or creates"| node_customer
node_reservation_controller -->|"updates availability"| node_room_calendar
node_reservation_controller -->|"creates nights"| node_reservation_night
node_room_type_controller -->|"manages"| node_room_type

click node_spa "https://github.com/andbet39/hotel/blob/master/public/hotel/app/app.js"
click node_search_ui "https://github.com/andbet39/hotel/blob/master/public/hotel/app/book/book.js"
click node_finalize_ui "https://github.com/andbet39/hotel/blob/master/public/hotel/app/book/finalize.js"
click node_payment_ui "https://github.com/andbet39/hotel/blob/master/public/hotel/app/payment/pay.js"
click node_admin_ui "https://github.com/andbet39/hotel/blob/master/public/hotel/app/room_admin/room_admin.js"
click node_routes "https://github.com/andbet39/hotel/blob/master/app/Http/routes.php"
click node_calendar_controller "https://github.com/andbet39/hotel/blob/master/app/Http/Controllers/RoomCalendarController.php"
click node_reservation_controller "https://github.com/andbet39/hotel/blob/master/app/Http/Controllers/ReservationController.php"
click node_payment_controller "https://github.com/andbet39/hotel/blob/master/app/Http/Controllers/PaymentController.php"
click node_room_type_controller "https://github.com/andbet39/hotel/blob/master/app/Http/Controllers/RoomTypeController.php"
click node_room_type "https://github.com/andbet39/hotel/blob/master/app/RoomType.php"
click node_room_calendar "https://github.com/andbet39/hotel/blob/master/app/RoomCalendar.php"
click node_reservation "https://github.com/andbet39/hotel/blob/master/app/Reservation.php"
click node_reservation_night "https://github.com/andbet39/hotel/blob/master/app/ReservationNight.php"
click node_customer "https://github.com/andbet39/hotel/blob/master/app/Customer.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_spa,node_search_ui,node_finalize_ui,node_payment_ui,node_admin_ui toneBlue
class node_routes,node_calendar_controller,node_reservation_controller,node_payment_controller,node_room_type_controller toneAmber
class node_room_type,node_room_calendar,node_reservation,node_reservation_night,node_customer toneMint
class node_guest,node_staff toneIndigo
```

## Components

### AngularJS app

- [Booking SPA](https://github.com/andbet39/hotel/blob/master/public/hotel/app/app.js): `public/hotel/app/app.js`
- [Room search](https://github.com/andbet39/hotel/blob/master/public/hotel/app/book/book.js): `public/hotel/app/book/book.js`
- [Reservation details](https://github.com/andbet39/hotel/blob/master/public/hotel/app/book/finalize.js): `public/hotel/app/book/finalize.js`
- [Payment UI](https://github.com/andbet39/hotel/blob/master/public/hotel/app/payment/pay.js): `public/hotel/app/payment/pay.js`
- [Room admin UI](https://github.com/andbet39/hotel/blob/master/public/hotel/app/room_admin/room_admin.js): `public/hotel/app/room_admin/room_admin.js`

### Laravel API

- [API routes](https://github.com/andbet39/hotel/blob/master/app/Http/routes.php): `app/Http/routes.php`
- [Availability and pricing](https://github.com/andbet39/hotel/blob/master/app/Http/Controllers/RoomCalendarController.php): `app/Http/Controllers/RoomCalendarController.php`
- [Reservations](https://github.com/andbet39/hotel/blob/master/app/Http/Controllers/ReservationController.php): `app/Http/Controllers/ReservationController.php`
- [Payment handler](https://github.com/andbet39/hotel/blob/master/app/Http/Controllers/PaymentController.php): `app/Http/Controllers/PaymentController.php`
- [Room type management](https://github.com/andbet39/hotel/blob/master/app/Http/Controllers/RoomTypeController.php): `app/Http/Controllers/RoomTypeController.php`

### Booking domain

- [Room types](https://github.com/andbet39/hotel/blob/master/app/RoomType.php): `app/RoomType.php`
- [Room calendar](https://github.com/andbet39/hotel/blob/master/app/RoomCalendar.php): `app/RoomCalendar.php`
- [Reservation](https://github.com/andbet39/hotel/blob/master/app/Reservation.php): `app/Reservation.php`
- [Reserved nights](https://github.com/andbet39/hotel/blob/master/app/ReservationNight.php): `app/ReservationNight.php`
- [Customer](https://github.com/andbet39/hotel/blob/master/app/Customer.php): `app/Customer.php`

### Other components

- **Guest**
- **Hotel staff**

## Connections

- Guest → Booking SPA: uses
- Hotel staff → Booking SPA: uses
- Booking SPA → Room search: includes
- Booking SPA → Reservation details: includes
- Booking SPA → Payment UI: includes
- Booking SPA → Room admin UI: includes
- Room search → API routes: requests search
- Reservation details → API routes: submits reservation
- Payment UI → API routes: requests payment
- Room admin UI → API routes: requests admin
- API routes → Availability and pricing: dispatches search and pricing
- API routes → Reservations: dispatches reservations
- API routes → Payment handler: dispatches payment
- API routes → Room type management: dispatches room types
- Availability and pricing → Room types: queries room types
- Availability and pricing → Room calendar: queries and updates calendar
- Reservations → Reservation: creates and reads
- Reservations → Customer: finds or creates
- Reservations → Room calendar: updates availability
- Reservations → Reserved nights: creates nights
- Room type management → Room types: manages
