Overview
Macuin follows the standard Laravel 11 directory structure, organized for building a SaaS e-commerce platform for automotive parts. The application uses a Docker-based development environment with PostgreSQL, Nginx, and Node.js.Root Directory Structure
Key Directories
app/
Theapp/ directory contains the core application code:
The
app/ directory follows Laravel conventions for organizing business logic, controllers, and models.Models
Eloquent models define the structure and relationships of your database tables:app/Models/User.php
View Components
Blade components for reusable UI elements:Alert.php- Alert messagesFooter.php- Page footerNavbar.php- Navigation barProductCard.php- Product display card
resources/
Front-end assets and Blade templates:auth/
Login and registration pages
carrito/
Shopping cart interface
catalogos/
Product catalog views
pedidos/
Order management pages
routes/
Route definitions for the application:web.php- Web application routes
database/
Database-related files:config/
Configuration files for various Laravel services:app.php- Application configurationauth.php- Authentication settingsdatabase.php- Database connectionscache.php- Cache configurationmail.php- Email settingsqueue.php- Queue configurationservices.php- Third-party services
public/
Public assets accessible via web server:The
public/ directory is the web server document root. All requests are routed through index.php.storage/
Application-generated files:docker/
Docker configuration files:Laravel Conventions
Naming Conventions
Models
Singular, PascalCase:
User, ProductControllers
PascalCase with suffix:
UserControllerMigrations
Snake case:
create_users_tableRoutes
Kebab case:
/order-detailsFile Organization
- Controllers: Handle HTTP requests and return responses
- Models: Represent database tables and relationships
- Views: Blade templates for rendering HTML
- Migrations: Version control for database schema
- Routes: Define URL patterns and map to controllers
Docker Architecture
The application runs in Docker containers defined indocker-compose.yml:
Development Workflow
- Code changes are made in the project root
- Views are compiled by Laravel’s Blade engine
- Assets are bundled by Vite (Node container)
- Requests are handled by Nginx → PHP-FPM → Laravel
- Database operations use PostgreSQL container
All containers share the project directory via volume mounts, enabling live code updates without rebuilding.