# franciscodubon/ctrl_citas_para_salon_de_belleza architecture

> Architecture diagram of the GitHub repository franciscodubon/ctrl_citas_para_salon_de_belleza, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-04-16). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/franciscodubon/ctrl_citas_para_salon_de_belleza
- Repository: https://github.com/franciscodubon/ctrl_citas_para_salon_de_belleza

## Overview

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: [`app/Http/Controllers/CitaController.php`](https://github.com/franciscodubon/ctrl_citas_para_salon_de_belleza/blob/main/app/Http/Controllers/CitaController.php) (Citas), [`routes/web.php`](https://github.com/franciscodubon/ctrl_citas_para_salon_de_belleza/blob/main/routes/web.php) (Web routes), [`database/dbsalon.sql`](https://github.com/franciscodubon/ctrl_citas_para_salon_de_belleza/blob/main/database/dbsalon.sql) (Salon DB), [`app/Models/Cita.php`](https://github.com/franciscodubon/ctrl_citas_para_salon_de_belleza/blob/main/app/Models/Cita.php) (Cita)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_presentation["Presentation"]
  node_blade_views["Blade views<br/>server UI"]
  node_login_view["Login<br/>auth view<br/>[login.blade.php]"]
  node_admin_views["Admin area<br/>role UI"]
  node_cliente_views["Cliente area<br/>role UI"]
  node_estilista_views["Estilista area<br/>role UI"]
  node_recepcionista_views["Recepcionista area<br/>role UI"]
end

subgraph group_http["HTTP Layer"]
  node_public_index["Front door<br/>Laravel entrypoint<br/>[index.php]"]
  node_routes_web["Web routes<br/>route map<br/>[web.php]"]
  node_base_controller["Base controller<br/>controller base<br/>[Controller.php]"]
  node_cita_controller["Citas<br/>domain controller<br/>[CitaController.php]"]
  node_cliente_controller["Clientes<br/>domain controller"]
  node_empleado_controller["Empleados<br/>domain controller"]
  node_promocion_controller["Promociones<br/>domain controller"]
  node_rol_controller["Roles<br/>domain controller<br/>[RolController.php]"]
  node_servicio_controller["Servicios<br/>domain controller"]
end

subgraph group_domain["Domain"]
  node_user_model["User<br/>auth account<br/>[User.php]"]
  node_rol_model["Rol<br/>[Rol.php]"]
  node_cita_model["Cita<br/>appointment model<br/>[Cita.php]"]
  node_cliente_model["Cliente<br/>customer model<br/>[Cliente.php]"]
  node_empleado_model["Empleado<br/>staff model<br/>[Empleado.php]"]
  node_servicio_model["Servicio<br/>service model<br/>[Servicio.php]"]
  node_promocion_model["Promocion<br/>promotion model<br/>[Promocion.php]"]
  node_combo_model["Combo<br/>bundle model<br/>[Combo.php]"]
  node_combo_servicio_model["ComboServicio<br/>join model<br/>[ComboServicio.php]"]
end

subgraph group_runtime["Runtime"]
  node_db_salon[("Salon DB<br/>relational database<br/>[dbsalon.sql]")]
  node_config["Config"]
  node_assets["Assets<br/>frontend build<br/>[app.js]"]
  node_storage[("Storage")]
end

node_public_index -->|"boots"| node_routes_web
node_routes_web -->|"dispatches"| node_cita_controller
node_routes_web -->|"dispatches"| node_cliente_controller
node_routes_web -->|"dispatches"| node_empleado_controller
node_routes_web -->|"dispatches"| node_promocion_controller
node_routes_web -->|"dispatches"| node_rol_controller
node_routes_web -->|"dispatches"| node_servicio_controller
node_cita_controller -->|"uses"| node_cita_model
node_cita_controller -->|"uses"| node_cliente_model
node_cita_controller -->|"uses"| node_empleado_model
node_cita_controller -->|"uses"| node_servicio_model
node_cliente_controller -->|"uses"| node_cliente_model
node_empleado_controller -->|"uses"| node_empleado_model
node_promocion_controller -->|"uses"| node_promocion_model
node_rol_controller -->|"uses"| node_rol_model
node_servicio_controller -->|"uses"| node_servicio_model
node_admin_views -->|"renders"| node_promocion_controller
node_admin_views -->|"renders"| node_servicio_controller
node_admin_views -->|"renders"| node_rol_controller
node_cliente_views -->|"renders"| node_cita_controller
node_cliente_views -->|"renders"| node_servicio_controller
node_cliente_views -->|"renders"| node_promocion_controller
node_estilista_views -->|"renders"| node_cita_controller
node_recepcionista_views -->|"renders"| node_cita_controller
node_recepcionista_views -->|"renders"| node_cliente_controller
node_recepcionista_views -->|"renders"| node_servicio_controller
node_recepcionista_views -->|"renders"| node_promocion_controller
node_login_view -->|"authenticates"| node_user_model
node_user_model -->|"belongs to"| node_rol_model
node_empleado_model -->|"belongs to"| node_rol_model
node_cita_model -->|"references"| node_cliente_model
node_cita_model -->|"references"| node_empleado_model
node_cita_model -->|"references"| node_servicio_model
node_combo_model -->|"contains"| node_combo_servicio_model
node_combo_servicio_model -->|"links"| node_servicio_model
node_cita_model -->|"persists"| node_db_salon
node_cliente_model -->|"persists"| node_db_salon
node_empleado_model -->|"persists"| node_db_salon
node_servicio_model -->|"persists"| node_db_salon
node_promocion_model -->|"persists"| node_db_salon
node_rol_model -->|"persists"| node_db_salon
node_user_model -->|"persists"| node_db_salon
node_config -->|"configures"| node_db_salon
node_config -->|"configures"| node_storage
node_assets -->|"supports"| node_blade_views

click node_public_index "https://github.com/franciscodubon/ctrl_citas_para_salon_de_belleza/blob/main/public/index.php"
click node_routes_web "https://github.com/franciscodubon/ctrl_citas_para_salon_de_belleza/blob/main/routes/web.php"
click node_base_controller "https://github.com/franciscodubon/ctrl_citas_para_salon_de_belleza/blob/main/app/Http/Controllers/Controller.php"
click node_cita_controller "https://github.com/franciscodubon/ctrl_citas_para_salon_de_belleza/blob/main/app/Http/Controllers/CitaController.php"
click node_cliente_controller "https://github.com/franciscodubon/ctrl_citas_para_salon_de_belleza/blob/main/app/Http/Controllers/ClienteController.php"
click node_empleado_controller "https://github.com/franciscodubon/ctrl_citas_para_salon_de_belleza/blob/main/app/Http/Controllers/EmpleadoController.php"
click node_promocion_controller "https://github.com/franciscodubon/ctrl_citas_para_salon_de_belleza/blob/main/app/Http/Controllers/PromocionController.php"
click node_rol_controller "https://github.com/franciscodubon/ctrl_citas_para_salon_de_belleza/blob/main/app/Http/Controllers/RolController.php"
click node_servicio_controller "https://github.com/franciscodubon/ctrl_citas_para_salon_de_belleza/blob/main/app/Http/Controllers/ServicioController.php"
click node_blade_views "https://github.com/franciscodubon/ctrl_citas_para_salon_de_belleza/tree/main/resources/views"
click node_login_view "https://github.com/franciscodubon/ctrl_citas_para_salon_de_belleza/blob/main/resources/views/login.blade.php"
click node_admin_views "https://github.com/franciscodubon/ctrl_citas_para_salon_de_belleza/tree/main/resources/views/admin"
click node_cliente_views "https://github.com/franciscodubon/ctrl_citas_para_salon_de_belleza/tree/main/resources/views/cliente"
click node_estilista_views "https://github.com/franciscodubon/ctrl_citas_para_salon_de_belleza/tree/main/resources/views/estilista"
click node_recepcionista_views "https://github.com/franciscodubon/ctrl_citas_para_salon_de_belleza/tree/main/resources/views/recepcionista"
click node_user_model "https://github.com/franciscodubon/ctrl_citas_para_salon_de_belleza/blob/main/app/Models/User.php"
click node_rol_model "https://github.com/franciscodubon/ctrl_citas_para_salon_de_belleza/blob/main/app/Models/Rol.php"
click node_cita_model "https://github.com/franciscodubon/ctrl_citas_para_salon_de_belleza/blob/main/app/Models/Cita.php"
click node_cliente_model "https://github.com/franciscodubon/ctrl_citas_para_salon_de_belleza/blob/main/app/Models/Cliente.php"
click node_empleado_model "https://github.com/franciscodubon/ctrl_citas_para_salon_de_belleza/blob/main/app/Models/Empleado.php"
click node_servicio_model "https://github.com/franciscodubon/ctrl_citas_para_salon_de_belleza/blob/main/app/Models/Servicio.php"
click node_promocion_model "https://github.com/franciscodubon/ctrl_citas_para_salon_de_belleza/blob/main/app/Models/Promocion.php"
click node_combo_model "https://github.com/franciscodubon/ctrl_citas_para_salon_de_belleza/blob/main/app/Models/Combo.php"
click node_combo_servicio_model "https://github.com/franciscodubon/ctrl_citas_para_salon_de_belleza/blob/main/app/Models/ComboServicio.php"
click node_db_salon "https://github.com/franciscodubon/ctrl_citas_para_salon_de_belleza/blob/main/database/dbsalon.sql"
click node_config "https://github.com/franciscodubon/ctrl_citas_para_salon_de_belleza/tree/main/config"
click node_assets "https://github.com/franciscodubon/ctrl_citas_para_salon_de_belleza/blob/main/resources/js/app.js"
click node_storage "https://github.com/franciscodubon/ctrl_citas_para_salon_de_belleza/tree/main/storage"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_blade_views,node_login_view,node_admin_views,node_cliente_views,node_estilista_views,node_recepcionista_views toneBlue
class node_public_index,node_routes_web,node_base_controller,node_cita_controller,node_cliente_controller,node_empleado_controller,node_promocion_controller,node_rol_controller,node_servicio_controller toneAmber
class node_user_model,node_rol_model,node_cita_model,node_cliente_model,node_empleado_model,node_servicio_model,node_promocion_model,node_combo_model,node_combo_servicio_model toneMint
class node_db_salon,node_config,node_assets,node_storage toneRose
```

## Components

### Presentation

Server-rendered role-based Blade UI

- [Blade views](https://github.com/franciscodubon/ctrl_citas_para_salon_de_belleza/tree/main/resources/views): server UI · Role-specific server-rendered screens · `resources/views`
- [Login](https://github.com/franciscodubon/ctrl_citas_para_salon_de_belleza/blob/main/resources/views/login.blade.php): auth view · Primary sign-in screen · `resources/views/login.blade.php`
- [Admin area](https://github.com/franciscodubon/ctrl_citas_para_salon_de_belleza/tree/main/resources/views/admin): role UI · Admin dashboards, services, promotions, reports, and users · `resources/views/admin`
- [Cliente area](https://github.com/franciscodubon/ctrl_citas_para_salon_de_belleza/tree/main/resources/views/cliente): role UI · Client appointments, settings, services, and promotions · `resources/views/cliente`
- [Estilista area](https://github.com/franciscodubon/ctrl_citas_para_salon_de_belleza/tree/main/resources/views/estilista): role UI · Stylist dashboard and appointments · `resources/views/estilista`
- [Recepcionista area](https://github.com/franciscodubon/ctrl_citas_para_salon_de_belleza/tree/main/resources/views/recepcionista): role UI · Reception workflows for appointments, clients, services, and promotions · `resources/views/recepcionista`

### HTTP Layer

Laravel entrypoint, routing, and controllers

- [Front door](https://github.com/franciscodubon/ctrl_citas_para_salon_de_belleza/blob/main/public/index.php): Laravel entrypoint · Bootstraps the application for browser requests · `public/index.php`
- [Web routes](https://github.com/franciscodubon/ctrl_citas_para_salon_de_belleza/blob/main/routes/web.php): route map · Central HTTP route definitions · `routes/web.php`
- [Base controller](https://github.com/franciscodubon/ctrl_citas_para_salon_de_belleza/blob/main/app/Http/Controllers/Controller.php): controller base · Shared controller foundation · `app/Http/Controllers/Controller.php`
- [Citas](https://github.com/franciscodubon/ctrl_citas_para_salon_de_belleza/blob/main/app/Http/Controllers/CitaController.php): domain controller · Appointment workflows and CRUD · `app/Http/Controllers/CitaController.php`
- [Clientes](https://github.com/franciscodubon/ctrl_citas_para_salon_de_belleza/blob/main/app/Http/Controllers/ClienteController.php): domain controller · Customer workflows and CRUD · `app/Http/Controllers/ClienteController.php`
- [Empleados](https://github.com/franciscodubon/ctrl_citas_para_salon_de_belleza/blob/main/app/Http/Controllers/EmpleadoController.php): domain controller · Staff workflows and CRUD · `app/Http/Controllers/EmpleadoController.php`
- [Promociones](https://github.com/franciscodubon/ctrl_citas_para_salon_de_belleza/blob/main/app/Http/Controllers/PromocionController.php): domain controller · Promotion workflows and CRUD · `app/Http/Controllers/PromocionController.php`
- [Roles](https://github.com/franciscodubon/ctrl_citas_para_salon_de_belleza/blob/main/app/Http/Controllers/RolController.php): domain controller · Role management and access boundaries · `app/Http/Controllers/RolController.php`
- [Servicios](https://github.com/franciscodubon/ctrl_citas_para_salon_de_belleza/blob/main/app/Http/Controllers/ServicioController.php): domain controller · Service catalog workflows and CRUD · `app/Http/Controllers/ServicioController.php`

### Domain

Core salon entities and persistence

- [User](https://github.com/franciscodubon/ctrl_citas_para_salon_de_belleza/blob/main/app/Models/User.php): auth account · Application user and login identity · `app/Models/User.php`
- [Rol](https://github.com/franciscodubon/ctrl_citas_para_salon_de_belleza/blob/main/app/Models/Rol.php): access role · Role model for authorization and UI segmentation · `app/Models/Rol.php`
- [Cita](https://github.com/franciscodubon/ctrl_citas_para_salon_de_belleza/blob/main/app/Models/Cita.php): appointment model · Appointments and scheduling records · `app/Models/Cita.php`
- [Cliente](https://github.com/franciscodubon/ctrl_citas_para_salon_de_belleza/blob/main/app/Models/Cliente.php): customer model · Customer records and profile data · `app/Models/Cliente.php`
- [Empleado](https://github.com/franciscodubon/ctrl_citas_para_salon_de_belleza/blob/main/app/Models/Empleado.php): staff model · Employee and stylist records · `app/Models/Empleado.php`
- [Servicio](https://github.com/franciscodubon/ctrl_citas_para_salon_de_belleza/blob/main/app/Models/Servicio.php): service model · Services offered by the salon · `app/Models/Servicio.php`
- [Promocion](https://github.com/franciscodubon/ctrl_citas_para_salon_de_belleza/blob/main/app/Models/Promocion.php): promotion model · Discounts and promotional offers · `app/Models/Promocion.php`
- [Combo](https://github.com/franciscodubon/ctrl_citas_para_salon_de_belleza/blob/main/app/Models/Combo.php): bundle model · Service bundle definition · `app/Models/Combo.php`
- [ComboServicio](https://github.com/franciscodubon/ctrl_citas_para_salon_de_belleza/blob/main/app/Models/ComboServicio.php): join model · Bundle-to-service composition link · `app/Models/ComboServicio.php`

### Runtime

Build, config, and application infrastructure

- [Salon DB](https://github.com/franciscodubon/ctrl_citas_para_salon_de_belleza/blob/main/database/dbsalon.sql): relational database · Predefined SQL schema and persistent business state · `database/dbsalon.sql`
- [Config](https://github.com/franciscodubon/ctrl_citas_para_salon_de_belleza/tree/main/config): app config · Auth, database, session, mail, queue, and service settings · `config`
- [Assets](https://github.com/franciscodubon/ctrl_citas_para_salon_de_belleza/blob/main/resources/js/app.js): frontend build · Vite entrypoints and global static assets · `resources/js/app.js`
- [Storage](https://github.com/franciscodubon/ctrl_citas_para_salon_de_belleza/tree/main/storage): runtime storage · Sessions, cache, logs, and file storage · `storage`

## Connections

- 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
