How franciscodubon/ctrl_citas_para_salon_de_belleza works
1. Application type and scope
- This is a Laravel monolith for a salon/business management system.
- The main domain appears to be managing appointments, clients, employees, services, promotions, roles, and combos.
- The UI is server-rendered with Blade templates, not a separate SPA/frontend app.
2. High-level request flow
- Browser requests enter through public/index.php, which boots Laravel.
- Routing is centralized in routes/web.php.
- Requests are handled by controller classes in app/Http/Controllers.
- Controllers read/write domain models in app/Models.
- Responses are typically rendered Blade views under resources/views.
3. Core domain boundary
- The business logic is organized around these main entities:
- Cita for appointments
- Cliente for customers
- Empleado for staff
- Servicio for services offered
- Promocion for discounts/promotions
- Rol for access roles
- Combo and ComboServicio for service bundles and their composition
- User for authentication/account linkage
- The presence of a SQL dump (database/dbsalon.sql) suggests the system is backed by a predesigned relational schema, likely more important than migrations in this repo snapshot.
4. Controller layer
- Controllers are separated by domain, not by API vs UI:
- CitaController
- ClienteController
- EmpleadoController
- PromocionController
- RolController
- ServicioController
- This indicates a classic MVC architecture where each controller mediates CRUD and workflow actions for a specific business area.
5. Role-based user experience
- The view structure is strongly segmented by user role:
- admin/*
- cliente/*
- estilista/*
- recepcionista/*
- This implies the app has role-specific dashboards and workflows rather than a single generic interface.
- app/Models/Rol.php and app/Models/User.php likely support authorization and navigation decisions across these role boundaries.
6. UI composition
- Presentation is done with Blade templates in resources/views.
- Each role has its own dashboard and feature screens:
- Admin: dashboards, services, promotions, reports, user management
- Cliente: appointments, settings, services, promotions
- Estilista: appointments and dashboard
- Recepcionista: appointments, clients, services, promotions, dashboard
- Static assets are split between public/ and Vite-managed assets in resources/css and resources/js.
7. Data persistence model
- The app uses Laravel’s ORM layer (Eloquent) for database access.
- The model set suggests relational links such as:
- users ↔ roles
- employees ↔ roles or users
- appointments ↔ clients/services/employees
- combos ↔ services via ComboServicio
- The system likely relies on a normalized MySQL/MariaDB schema captured in database/dbsalon.sql.
8. Authentication and session boundary
- Standard Laravel auth configuration exists in config/auth.php, with session, cache, and database settings available in config/.
- There is a dedicated resources/views/login.blade.php, so login is part of the app’s primary flow.
- Authentication and authorization are likely central because of the multi-role UI and role model.
9. Operational/runtime concerns
- The repo includes standard Laravel environment and infrastructure files:
- .env.example
- config/database.php, config/mail.php, config/queue.php, config/session.php
- storage/ and bootstrap/cache/
- This is a conventional PHP/Laravel runtime with local filesystem storage, server-side sessions, and database-backed application state.
10. Frontend build pipeline
- The frontend build is handled with Vite (vite.config.js) and Laravel asset entrypoints in resources/js/app.js and resources/css/app.css.
- There are also global static assets in public/css/global-styles.css and public/js/global-scripts.js, suggesting a mix of compiled assets and directly served custom assets.
11. Reporting and back-office functionality
- The admin area includes reportesAdmin.blade.php, which indicates some reporting/analytics capability.
- This is one of the few higher-level business outputs beyond CRUD, and it likely reads from the same appointment/client/service data model.
12. Testing and project scaffolding
- The repo includes the default Laravel test structure in tests/, plus composer.json, package.json, and phpunit.xml.
- No evidence of separate microservices, message brokers, or external APIs is present in the file tree, so the architecture is primarily a single-process, database-backed web app.
13. How to draw the architecture
- A useful diagram would show:
- Browser users split into four roles
- Laravel HTTP layer with routes/controllers
- Eloquent models as the domain/persistence layer
- Database as the central state store
- Blade views as the server-rendered presentation layer
- The main architectural boundary is role-based UI + domain CRUD/reporting, all inside one Laravel application.
Main entry points: CitaController.php Citas · web.php Web routes · dbsalon.sql Salon DB · Cita.php Cita
Components 28
Presentation
Server-rendered role-based Blade UI
- Blade views · Role-specific server-rendered screens
resources/views - Login · Primary sign-in screen
resources/views/login.blade.php - Admin area · Admin dashboards, services, promotions, reports, and users
resources/views/admin - Cliente area · Client appointments, settings, services, and promotions
resources/views/cliente - Estilista area · Stylist dashboard and appointments
resources/views/estilista - Recepcionista area · Reception workflows for appointments, clients, services, and promotions
resources/views/recepcionista
HTTP Layer
Laravel entrypoint, routing, and controllers
- Front door · Bootstraps the application for browser requests
public/index.php - Web routes · Central HTTP route definitions
routes/web.php - Base controller · Shared controller foundation
app/Http/Controllers/Controller.php - Citas · Appointment workflows and CRUD
app/Http/Controllers/CitaController.php - Clientes · Customer workflows and CRUD
app/Http/Controllers/ClienteController.php - Empleados · Staff workflows and CRUD
app/Http/Controllers/EmpleadoController.php - Promociones · Promotion workflows and CRUD
app/Http/Controllers/PromocionController.php - Roles · Role management and access boundaries
app/Http/Controllers/RolController.php - Servicios · Service catalog workflows and CRUD
app/Http/Controllers/ServicioController.php
Domain
Core salon entities and persistence
- User · Application user and login identity
app/Models/User.php - Rol · Role model for authorization and UI segmentation
app/Models/Rol.php - Cita · Appointments and scheduling records
app/Models/Cita.php - Cliente · Customer records and profile data
app/Models/Cliente.php - Empleado · Employee and stylist records
app/Models/Empleado.php - Servicio · Services offered by the salon
app/Models/Servicio.php - Promocion · Discounts and promotional offers
app/Models/Promocion.php - Combo · Service bundle definition
app/Models/Combo.php - ComboServicio · Bundle-to-service composition link
app/Models/ComboServicio.php
Runtime
Build, config, and application infrastructure
Connections 45
- Front door → Web routes: boots · Laravel entrypoint hands requests to the route layer
- Web routes → Citas: dispatches · Routes map to appointment controller actions
- Web routes → Clientes: dispatches · Routes map to customer controller actions
- Web routes → Empleados: dispatches · Routes map to staff controller actions
- Web routes → Promociones: dispatches · Routes map to promotion controller actions
- Web routes → Roles: dispatches · Routes map to role management actions
- Web routes → Servicios: dispatches · Routes map to service controller actions
- Citas → Cita: uses · Controller reads and writes appointments
- Citas → Cliente: uses · Appointments reference customers
- Citas → Empleado: uses · Appointments reference staff
- Citas → Servicio: uses · Appointments reference services
- Clientes → Cliente: uses · Customer management persists through the client model
- Empleados → Empleado: uses · Staff management persists through the employee model
- Promociones → Promocion: uses · Promotion workflows use the promotion model
- Roles → Rol: uses · Role management uses the role model
- Servicios → Servicio: uses · Service catalog management uses the service model
- Admin area → Promociones: renders · Admin screens expose promotion management
- Admin area → Servicios: renders · Admin screens expose service management
- Admin area → Roles: renders · Admin screens expose user and role administration
- Cliente area → Citas: renders · Client screens handle appointment actions
- Cliente area → Servicios: renders · Client screens browse services
- Cliente area → Promociones: renders · Client screens browse promotions
- Estilista area → Citas: renders · Stylist screens focus on appointments
- Recepcionista area → Citas: renders · Reception screens manage appointments
- Recepcionista area → Clientes: renders · Reception screens manage customers
- Recepcionista area → Servicios: renders · Reception screens manage services
- Recepcionista area → Promociones: renders · Reception screens manage promotions
- Login → User: authenticates · Login screen feeds the user account boundary
- User → Rol: belongs to · Users are associated with access roles
- Empleado → Rol: belongs to · Employees are likely governed by role assignments
- Cita → Cliente: references · Appointments reference customers
- Cita → Empleado: references · Appointments reference staff
- Cita → Servicio: references · Appointments reference services
- Combo → ComboServicio: contains · Bundles are composed through the join model
- ComboServicio → Servicio: links · Join model connects bundles to services
- Cita → Salon DB: persists · Appointments are stored in the salon database
- Cliente → Salon DB: persists · Customer data is stored in the salon database
- Empleado → Salon DB: persists · Staff data is stored in the salon database
- Servicio → Salon DB: persists · Services are stored in the salon database
- Promocion → Salon DB: persists · Promotions are stored in the salon database
- Rol → Salon DB: persists · Roles are stored in the salon database
- User → Salon DB: persists · Users are stored in the salon database
- Config → Salon DB: configures · Database and session settings connect the app to persistent storage
- Config → Storage: configures · Framework configuration targets filesystem-backed runtime state
- Assets → Blade views: supports · Compiled and global assets support the Blade interface