# salaheddinedaghri/hotel-app-project architecture

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

- Interactive diagram: https://gitdiagram.com/salaheddinedaghri/hotel-app-project
- Repository: https://github.com/salaheddinedaghri/hotel-app-project

## Overview

##### Project Type and Purpose
- This is a monolithic full-stack web application built on Laravel (PHP MVC).
- Purpose: an online hotel room booking system with two user roles (Admin & Customer). Admins manage rooms, users, statuses, payments, transactions. Customers browse rooms, book online, view history, manage profile.

##### File Structure
- Top-level Laravel scaffolding: artisan, bootstrap/, config/, public/, resources/, routes/, storage/, tests/.
- app/ contains MVC layers:
- Http/Controllers → all HTTP entry points (DashboardController, RoomController, StripeController, etc.)
- Models → Eloquent ORM models (Room, Payment, Transaction, User, etc.)
- Events & Notifications → real-time events (NewReservationEvent, RefreshDashboardEvent) and notification classes
- Console & Providers → artisan commands, service registration, event wiring
- resources/views → Blade templates for admin/dashboard and public frontend
- public/ → static assets (CSS/JS frameworks, custom frontend, invoice templates)
- config/queue, broadcasting, services → hints at using queues (Redis or database) and external services (Stripe, Mail, broadcasting driver)
- database/migrations & seeders → MySQL schema and seed data for rooms, types, users, transactions

##### README for Additional Insights
- Two distinct user flows: Admin Dashboard (manage back end) vs. Public Booking Site (browse & reserve).
- Real-time updates: reservation events broadcast to dashboard.
- Stripe integration for payment processing.
- Offline reservations sync into the same pipeline.

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Clients"
        AdminUI["Admin Dashboard UI"]:::sync
        PublicUI["Public Booking Site UI"]:::sync
    end

    subgraph "Web Server"
        WebServer["Web Server (Nginx/Apache)"]:::sync
        index["index.php"]:::sync
    end

    subgraph "Laravel Application"
        HTTPKernel["HTTP Kernel & Middleware"]:::app
        Router["Routing (routes/web.php, routes/api.php)"]:::app
        Controllers["Controllers"]:::app
        Models["Models (Eloquent ORM)"]:::app
        Events["Events & Broadcasting"]:::async
        Queue["Queues & Workers"]:::async
        Listeners["Listeners & Notifications"]:::async
        ServiceProviders["Service Providers"]:::app
    end

    subgraph "Data & Storage"
        DB["MySQL Database"]:::external
        Storage["Storage (Uploads & Invoices)"]:::external
    end

    subgraph "External Services"
        StripeAPI["Stripe Payment API"]:::external
        MailService["Mail Service (SMTP/3rd-party)"]:::external
        BroadcastDriver["Broadcast Driver (Pusher/Redis)"]:::external
        ArtisanConsole["Artisan Console & Scheduler"]:::external
    end

    %% Client to Server
    AdminUI -->|HTTP Request| WebServer
    PublicUI -->|HTTP Request| WebServer

    WebServer -->|serves| index
    index -->|enters| HTTPKernel
    HTTPKernel -->|routes through| Router
    Router -->|dispatches to| Controllers

    Controllers -->|queries/updates| DB
    Controllers -->|stores files| Storage

    Controllers -->|dispatches| Events
    Events -->|pushes to| Queue
    Queue -->|triggers| Listeners
    Listeners -->|broadcasts| BroadcastDriver
    BroadcastDriver -->|real-time updates| AdminUI

    Controllers -->|calls| StripeAPI
    StripeAPI -->|webhook callback| Controllers

    Controllers -->|sends emails| MailService

    ArtisanConsole -->|runs commands| Queue
    ServiceProviders -->|bootstrap| HTTPKernel

    %% Click Events
    click AdminUI "https://github.com/salaheddinedaghri/hotel-app-project/tree/main/resources/views/dashboard/"
    click PublicUI "https://github.com/salaheddinedaghri/hotel-app-project/tree/main/resources/views/frontend/"
    click index "https://github.com/salaheddinedaghri/hotel-app-project/blob/main/public/index.php"
    click HTTPKernel "https://github.com/salaheddinedaghri/hotel-app-project/blob/main/app/Http/Kernel.php"
    click Router "https://github.com/salaheddinedaghri/hotel-app-project/blob/main/routes/web.php"
    click Controllers "https://github.com/salaheddinedaghri/hotel-app-project/tree/main/app/Http/Controllers/"
    click Models "https://github.com/salaheddinedaghri/hotel-app-project/tree/main/app/Models/"
    click Events "https://github.com/salaheddinedaghri/hotel-app-project/blob/main/app/Events/NewReservationEvent.php"
    click Queue "https://github.com/salaheddinedaghri/hotel-app-project/blob/main/config/queue.php"
    click Listeners "https://github.com/salaheddinedaghri/hotel-app-project/tree/main/app/Notifications/"
    click DB "https://github.com/salaheddinedaghri/hotel-app-project/tree/main/database/migrations/"
    click Storage "https://github.com/salaheddinedaghri/hotel-app-project/tree/main/storage/app/public/"
    click StripeAPI "https://github.com/salaheddinedaghri/hotel-app-project/blob/main/app/Http/Controllers/StripeController.php"
    click MailService "https://github.com/salaheddinedaghri/hotel-app-project/blob/main/config/mail.php"
    click BroadcastDriver "https://github.com/salaheddinedaghri/hotel-app-project/blob/main/config/broadcasting.php"
    click ArtisanConsole "https://github.com/salaheddinedaghri/hotel-app-project/blob/main/app/Console/Kernel.php"
    click ServiceProviders "https://github.com/salaheddinedaghri/hotel-app-project/blob/main/app/Providers/AppServiceProvider.php"

    %% Styles
    classDef sync fill:#a8d0e6,stroke:#000
    classDef async fill:#98fb98,stroke:#000
    classDef external fill:#ffcc99,stroke:#000
    classDef app fill:#f3eac2,stroke:#000
```
