How ezequieldhonatan/tourism-agency-system works
Project type and purpose
• This is a monolithic, full-stack Laravel PHP application for a travel agency (“Sistema de agência de turismo”).
• It exposes two user-facing interfaces:
• “Panel” – an administrative backend for managing airports, flights, planes, brands, reserves, states, cities, users.
• “Site” – a public website where end-customers search for flights, view promotions, manage their profile and purchases.
File structure
• Top-level separation:
• public/ – web-servable assets (CSS, JS, images, index.php)
• app/ – application code (Controllers, Models, Middleware, Requests, Helpers, Console commands)
• config/ – environment-specific configuration
• database/ – migrations, seeders, factories
• resources/ – Blade views (panel/ and site/), front-end assets (sass/js), language files
• routes/ – route definitions (web.php, api.php, console.php, channels.php)
• storage/ – compiled views, logs, cache, sessions
• tests/ – unit and feature tests
• bootstrap/ – framework bootstrap and cached files
• MVC pattern:
• Models under app/Models
• Controllers under app/Http/Controllers (subfolders Auth, Panel, Site)
• Views under resources/views (mirroring Controller structure)
• Build tool: webpack.mix.js (Laravel Mix) to compile JS, CSS, Sass into public/assets and public/js/app.js, public/css/app.css.
• Config files for DB, cache, mail, queue, session, services under config/.
README
• Minimal: “Sistema de agência de turismo”. Confirms domain is travel bookings.
Main components and their interactions
a. Components:
1) Client browsers/mobile apps
2) Web server (Apache/Nginx) + PHP-FPM
3) Laravel Application:
– Routing (routes/web.php, api.php)
– Controllers (Auth, Panel, Site)
– Request validation (FormRequest classes)
– Domain Models & Eloquent ORM
– Helpers, Rules, Console Commands
4) Database (MySQL/PostgreSQL)
5) Cache/Session store (Redis/File)
6) Queue system (Redis/Beanstalkd)
7) Mail/Notification service (SMTP/third-party)
8) Front-end assets (Blade + optional Vue components in resources/js/components)
9) External APIs (if any—e.g., payment gateways)
b. Relationships and data flows:
• Browser → HTTP → public/index.php → Laravel Router → Middleware pipeline → Controller → Model (Eloquent) → Database
• Controller → returns Blade view + compiled CSS/JS assets → Browser
• Jobs dispatched to queue → queue worker (artisan queue:work) → handle background tasks (e-mail, data sync)
• Console commands scheduled (app/Console/Kernel.php) for cron jobs
• Cache/store interactions via Cache facade and session middleware
c. Architectural patterns and design principles:
• MVC
• Layered architecture: HTTP Layer → Application Layer (Controllers/Requests) → Domain Layer (Models/Rules) → Infrastructure Layer (Database, Cache, Queue)
• Dependency Injection via Service Providers (app/Providers)
• Separation of concerns: Panel vs. Site modules; Auth subsystem; Helpers/Rules extracted from Controllers
• Single codebase with logical sub-modules under Controllers and Views
d. Key technologies/frameworks:
• Laravel Framework (Routing, Eloquent ORM, Blade, Middleware, Service Providers)
• PHP 7/8
• MySQL or Postgres
• Redis or native file cache/session
• Laravel Mix (Webpack) for asset compilation: SCSS, JS, Vue components
• PHPUnit for testing
Detail without over-fragmenting
• Break the monolith into logical pieces: HTTP gateway, Laravel core (split by sub-modules), persistence.
• Make clear boundaries: show what lives in code vs. infrastructure.
• Essential elements: Authentication flow, admin vs. public UI, asset pipeline, background jobs.