How wailantirajoh/laravel-hotel works
Project Type and Purpose
• This is a monolithic full-stack web application built with Laravel (PHP) and a Vue.js-augmented frontend.
• It provides a hotel reservation system with real-time notifications via Laravel WebSockets, serving Admin, Super, and Customer roles.
Main Architectural Components
a. Client Side
• Browser/UI
– Blade templates (resources/views/)
– Vue.js pages & components (resources/js/pages/, resources/js/components/)
– CSS/SASS assets (resources/css/, resources/sass/)
– Public assets (public/js, public/css, public/img)
b. Web Server & HTTP Layer
• Nginx/Apache → public/index.php → bootstrap/app.php → HTTP Kernel
• Middleware stack (app/Http/Middleware/)
• Routing (routes/web.php, routes/api.php, channels.php)
c. Application / Business Logic
• Controllers (app/Http/Controllers/)
• Requests / Form Validation (app/Http/Requests/)
• Events & Listeners (app/Events/, broadcasting configured in config/broadcasting.php)
• Notifications (app/Notifications/)
• Jobs & Queues (config/queue.php, driver configured in .env)
d. Domain & Data Access
• Models (app/Models/)
• Repository Pattern
– Interfaces (app/Repositories/Interface/)
– Implementations (app/Repositories/Implementation/)
• Eloquent ORM & relationships
• Database migrations & seeders (database/migrations/, database/seeders/)
• Factories (database/factories/)
e. Real-Time Layer
• Laravel WebSockets Server (artisan command reverb:start)
• Echo client (resources/js/echo.js)
• Broadcasting channels (routes/channels.php)
f. External Services & Infrastructure
• MySQL/PostgreSQL database
• Redis (optional, for cache or queues)
• Mail server (SMTP configured in .env, config/mail.php)
• Storage (local disk / cloud via config/filesystems.php)
Relationships & Data Flows
• HTTP client → Web Server: GET/POST requests to controllers
• Controllers → Repositories → Models → Database
• Controllers/Jobs → Events → WebSockets Server → Browser (via Echo channels)
• Controllers → Notifications (mail, broadcast) → Mail server / WebSockets
• Frontend forms → Validation in Form Requests → Controllers
• Views render data via controllers pulling from repositories
Architectural Patterns & Principles
• MVC (Controllers + Views + Models)
• Repository pattern for decoupling data access
• Event-driven updates (app/Events + Laravel WebSockets)
• Layered architecture: Presentation, Application/Business, Domain, Infrastructure
Technologies & Frameworks
• Laravel 8/11 (PHP framework)
• Blade templating + Vue.js for interactive UI
• Laravel Echo & WebSockets for real-time push
• Eloquent ORM
• MySQL database
• NPM/Webpack/Vite (vite.config.js) for asset bundling