How medab123/laravel-metronic-inertia-vue-demo1 works
• Backend (Laravel):
• Application Layer (app/):
▪ Controllers (found in app/Http/Controllers) – handle incoming requests.
▪ Models (e.g., app/Models/User.php) – represent domain/data logic.
▪ Providers – register and configure application-level services.
• Configuration and Environment:
▪ config/ – holds application configurations (app, auth, database, etc.).
▪ Environment Variables (.env) – used for database and other settings.
• Routing and Request Handling:
▪ routes/ (web.php, console.php) – defines HTTP and console routes.
• Database:
▪ Migrations (database/migrations) – define schema changes.
▪ Seeders (database/seeders) – populate the database.
• Frontend (Vue 3 + Inertia.js + Metronic):
• Vue Components & Pages:
▪ Located in resources/js (or resources/ts) – include Pages, Components, and Layouts that represent different parts of the UI.
▪ Inertia.js setup – acts as the bridge between the server-rendered Laravel responses and the interactive Vue components.
• Assets and Theming:
▪ Public Folder – serves Metronic assets (CSS, JavaScript, images) and other publicly accessible resources.
▪ resources/css/ and resources/ts/assets – for custom styling and additional assets.
• Development and Build Tools:
• Composer and PHP packages (composer.json, composer.lock).
• Node.js, npm (or Yarn) packages (package.json, package-lock.json).
• Vite configuration (vite.config.mts) – for asset bundling and development server.
How the Components Interact
• Flow starting from a client browser:
• Client requests hit the Laravel server.
• Laravel routes determine the correct controller.
• Controllers then use Inertia.js to return a response that includes a Vue component’s props.
• Data Flow:
• The backend retrieves data via models and migrations connect with the database.
• Data is packaged by controllers and passed through Inertia to the Vue frontend.
• Vue components (organized within Pages and Components folders) render the dynamic user interface.
• Integration points:
• Inertia.js acts as the glue that minimizes the gap between the server and client (API-less SPA mechanism).
• The Metronic Admin Template, available as static assets in the public folder, is used to style the frontend.
Architectural Patterns
• MVC for the Laravel backend (separating concerns into Models, Views (via Inertia), and Controllers).
• Single-Page Application (SPA) behavior enabled by Inertia.js, which abstracts traditional API endpoints.
• Modular frontend organization – with separation into pages, reusable components, layouts, and services.
Specific Technologies and Technologies Stack
• Laravel 12, PHP 8.1+ for backend logic.
• Vue 3 for dynamic user interface rendering.
• Inertia.js for linking backend responses with Vue frontend components.
• Metronic Admin Template – for a modern responsive UI.
• Build tools like Vite for asset bundling.
• Node.js/npm or Yarn for managing frontend dependencies and building assets.
• Composer for PHP dependencies.