How alejandro-echavarria/maet works
Main Components
• Frontend Layer:
• Consists of Vue components and pages located in resources/js, which include separate directories for Admin and Public pages.
• Layout components and reusable UI helpers (e.g., buttons, modals, forms) are part of this layer.
• Backend Layer:
• Controllers: Organized under app/Http/Controllers with separate subdirectories for Admin and Public functionality.
• Actions and service providers (found in app/Actions, app/Providers) which encapsulate the business logic related to Fortify (authentication) and Jetstream (user management).
• Middleware: Implements authentication, CSRF protection, and other request handling (located in app/Http/Middleware).
• Routes: Defined in routes/web.php, routes/api.php, routes/admin.php, etc. These act as the entry points directing traffic to the controllers.
• Domain/Data Layer:
• Models: Found in app/Models; these use Laravel’s Eloquent ORM to interact with the database and represent entities such as Category, Client, Job, Company, etc.
• Migrations and Seeders: In the database folder, these files establish the schema and initial data for tables (e.g., jobs, companies, educations).
• Policies: In app/Policies to manage authorization logic.
• Infrastructure & Configuration:
• Configuration files (stored in the config directory) that dictate settings for app behavior, caching, sessions, logging, and external services.
• Artisan and bootstrap files which initiate the application.
• Public assets (in public/) that are served directly to end users (images, CSS, JavaScript).
• Testing: Tests are present in tests/Feature and tests/Unit ensuring quality and function.
• External Dependencies and Packages:
• Laravel core features, plus the Fortify and Jetstream packages that extend authentication and UI scaffolding.
• Other helper integrations like mail (in app/Mail) and job processing (queues mentioned in config/queue.php).
Relationships and Data Flows
• User requests (from the browser) initiate via the public frontend layer. These requests are directed through the routes defined (web, admin, api).
• The routing layer forwards requests to the appropriate controllers (Admin controllers for admin functionalities, Public controllers for general user access).
• Controllers interact with business logic encapsulated in the app/Actions files or directly use Eloquent models for CRUD operations.
• Data persistence occurs via interactions with the database, with schemas defined in the migrations and seeders.
• Cross-cutting concerns (authentication, session management, etc.) are handled by middleware.
• View rendering: The backend returns views (blade files in resources/views) or JSON responses (API endpoints) which are processed by Vue.js on the client side.
Architectural Patterns and Technology Stack
• MVC Pattern: The typical separation of concerns is clear with Models, Views, and Controllers structured in the app and resources directories.
• Service Providers and Actions: Contribute to the dependency injection and business logic separation.
• Use of Laravel’s Routing and Middleware: Directs request handling with built-in protection and session management.
• Integration of Frontend (Vue.js) with Laravel via Inertia (suggested by the structure in resources/js and layout components).
• Database: Managed via migrations and seeders using Laravel’s Eloquent ORM.
• External packages: Fortify and Jetstream streamline authentication and user management, integrated in app/Actions and app/Providers.