# cristhianllanque/san_roman architecture

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

- Interactive diagram: https://gitdiagram.com/cristhianllanque/san_roman
- Repository: https://github.com/cristhianllanque/san_roman

## Overview

This is a classic Laravel monolith organized around an MVC flow: HTTP requests enter through `public/index.php`, are routed in `routes/web.php` and `routes/auth.php`, handled by controllers under `app/Http/Controllers`, persisted with Eloquent models in `app/Models`, and rendered with Blade templates in `resources/views`.

The application’s core domain is a support-ticket system. The main entities are `User`, `Ticket`, `Mensaje` (messages/chat), `Incidencia` (incident records), and `Oficina` (office/location or department). The migrations show the schema evolution: users gained role/status fields, tickets gained technician assignment and user data fields, and incidents were added later with an eventual delivery date.

Authentication and account management are built in using Laravel’s standard auth stack. The `Auth` controllers and views cover login, registration, password reset, email verification, and password confirmation. A separate `ProfileController` and profile views handle user profile updates and account deletion.

Access is segmented by role. The views and controllers indicate at least three personas: `usuario` (end user), `tecnico` (support technician), and `admin`. Each persona has its own dashboard and ticket views, suggesting role-based navigation and authorization boundaries around the same core ticket data.

Ticket lifecycle is the main data flow. Users can create tickets, view their own tickets, follow ticket status, and open a chat view for conversation. Technicians have their own ticket list plus an incidence form, implying they process or resolve tickets and record incident details. The `Mensaje` model and `resources/views/tickets/chat.blade.php` point to a threaded message flow attached to tickets.

The admin subsystem is broader operational management. Admin views exist for dashboards, statistics, offices, technicians, users, tickets, and reports. That implies the admin can oversee the support operation end-to-end: manage reference data (`Oficinas`), manage personnel and accounts, inspect ticket volume, and generate summary reports.

The UI layer is server-rendered Blade rather than a SPA. Layouts are split into app/guest shells, with reusable Blade components for forms, buttons, dropdowns, navigation, modal dialogs, and chat bubbles. This keeps presentation centralized while each role-specific screen composes the shared shell differently.

Front-end tooling is lightweight and Laravel-native. `resources/css/app.css`, `resources/js/app.js`, Tailwind config, and Vite config indicate asset compilation with Vite and utility-first styling. A small amount of client-side behavior is likely present for navigation, modals, and chat updates, but the system remains primarily server-rendered.

Persistence is handled through Laravel’s database layer with migrations, factories, and seeders. The `AdminUserSeeder` suggests the app boots with at least one privileged account. Standard framework tables for cache and jobs are present, but there is no sign of a separate queue worker or external backend service in the repository structure.

Operationally, the app stores public assets under `public/` and uses Laravel’s storage directories for generated files, logs, sessions, cache, and private app data. The presence of a chat notification sound and a couple of video files in `public/` suggests some media assets are shipped directly with the application UI.

Testing is mostly framework-default feature coverage around auth and profile flows, with unit and feature test scaffolding in place. That implies the most critical automated checks currently focus on access/account management rather than the ticket domain, at least from the visible tree.

For an architecture diagram, the main boundaries to draw are: browser/UI → Laravel HTTP layer → controllers → Eloquent models/database, with a secondary boundary for role-specific dashboards and admin/reporting screens. The central shared domain is ticket handling, and everything else—auth, profiles, admin management, technician workflows—branches around that core.

Main entry points: [`app/Http/Controllers/AdminController.php`](https://github.com/cristhianllanque/san_roman/blob/main/app/Http/Controllers/AdminController.php) (Admin ctrl), [`app/Http/Controllers/TicketController.php`](https://github.com/cristhianllanque/san_roman/blob/main/app/Http/Controllers/TicketController.php) (Ticket ctrl), [`resources/views/layouts/app.blade.php`](https://github.com/cristhianllanque/san_roman/blob/main/resources/views/layouts/app.blade.php) (Layouts), [`routes/web.php`](https://github.com/cristhianllanque/san_roman/blob/main/routes/web.php) (Web routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_g_http["HTTP layer"]
  node_n_routes["Web routes<br/>route definitions<br/>[web.php]"]
  node_n_auth_routes["Auth routes<br/>[auth.php]"]
  node_n_ticket_ctrl["Ticket ctrl<br/>domain controller"]
  node_n_admin_ctrl["Admin ctrl<br/>admin controller"]
  node_n_profile_ctrl["Profile ctrl<br/>profile controller"]
  node_n_auth_ctrls["Auth ctrls<br/>auth controllers"]
  node_n_requests["Form requests<br/>validation<br/>[LoginRequest.php]"]
end

subgraph group_g_domain["Domain & data"]
  node_n_user[("User<br/>account model<br/>[User.php]")]
  node_n_ticket[("Ticket<br/>support model<br/>[Ticket.php]")]
  node_n_msg[("Mensaje<br/>chat model<br/>[Mensaje.php]")]
  node_n_incidencia[("Incidencia<br/>incident model<br/>[Incidencia.php]")]
  node_n_oficina[("Oficina<br/>reference model<br/>[Oficina.php]")]
end

subgraph group_g_ui["Server UI"]
  node_n_views_layouts["Layouts<br/>Blade shells<br/>[app.blade.php]"]
  node_n_views_components["Components"]
  node_n_views_roles["Role screens<br/>role dashboards"]
  node_n_views_admin["Admin screens<br/>admin views"]
  node_n_views_auth_profile["Auth & profile UI<br/>account views<br/>[login.blade.php]"]
end

subgraph group_g_infra["Infra & assets"]
  node_n_public["Entry point<br/>php front controller<br/>[index.php]"]
  node_n_storage["Assets & storage<br/>static/runtime files<br/>[new-message.mp3]"]
end

node_n_public -->|"boots app"| node_n_routes
node_n_public -->|"auth entry"| node_n_auth_routes
node_n_routes -->|"dispatches"| node_n_ticket_ctrl
node_n_routes -->|"dispatches"| node_n_admin_ctrl
node_n_routes -->|"dispatches"| node_n_profile_ctrl
node_n_auth_routes -->|"dispatches"| node_n_auth_ctrls
node_n_ticket_ctrl -->|"reads/writes"| node_n_ticket
node_n_ticket_ctrl -->|"chat data"| node_n_msg
node_n_ticket_ctrl -->|"creates incidents"| node_n_incidencia
node_n_admin_ctrl -->|"manages"| node_n_user
node_n_admin_ctrl -->|"oversees"| node_n_ticket
node_n_admin_ctrl -->|"manages"| node_n_oficina
node_n_admin_ctrl -->|"reports on"| node_n_incidencia
node_n_profile_ctrl -->|"updates"| node_n_user
node_n_auth_ctrls -->|"auth accounts"| node_n_user
node_n_requests -->|"validates"| node_n_auth_ctrls
node_n_requests -->|"validates"| node_n_profile_ctrl
node_n_views_layouts -->|"composes"| node_n_views_components
node_n_views_layouts -->|"wraps"| node_n_views_roles
node_n_views_layouts -->|"wraps"| node_n_views_admin
node_n_views_layouts -->|"wraps"| node_n_views_auth_profile
node_n_views_roles -->|"drives"| node_n_ticket_ctrl
node_n_views_admin -->|"drives"| node_n_admin_ctrl
node_n_views_auth_profile -->|"submits to"| node_n_auth_ctrls
node_n_views_auth_profile -->|"submits to"| node_n_profile_ctrl
node_n_views_roles -->|"shows"| node_n_ticket
node_n_views_admin -->|"shows"| node_n_user
node_n_views_roles -->|"shows"| node_n_msg
node_n_storage -->|"serves assets"| node_n_views_components

click node_n_public "https://github.com/cristhianllanque/san_roman/blob/main/public/index.php"
click node_n_routes "https://github.com/cristhianllanque/san_roman/blob/main/routes/web.php"
click node_n_auth_routes "https://github.com/cristhianllanque/san_roman/blob/main/routes/auth.php"
click node_n_ticket_ctrl "https://github.com/cristhianllanque/san_roman/blob/main/app/Http/Controllers/TicketController.php"
click node_n_admin_ctrl "https://github.com/cristhianllanque/san_roman/blob/main/app/Http/Controllers/AdminController.php"
click node_n_profile_ctrl "https://github.com/cristhianllanque/san_roman/blob/main/app/Http/Controllers/ProfileController.php"
click node_n_auth_ctrls "https://github.com/cristhianllanque/san_roman/blob/main/app/Http/Controllers/Auth/AuthenticatedSessionController.php"
click node_n_requests "https://github.com/cristhianllanque/san_roman/blob/main/app/Http/Requests/Auth/LoginRequest.php"
click node_n_user "https://github.com/cristhianllanque/san_roman/blob/main/app/Models/User.php"
click node_n_ticket "https://github.com/cristhianllanque/san_roman/blob/main/app/Models/Ticket.php"
click node_n_msg "https://github.com/cristhianllanque/san_roman/blob/main/app/Models/Mensaje.php"
click node_n_incidencia "https://github.com/cristhianllanque/san_roman/blob/main/app/Models/Incidencia.php"
click node_n_oficina "https://github.com/cristhianllanque/san_roman/blob/main/app/Models/Oficina.php"
click node_n_views_layouts "https://github.com/cristhianllanque/san_roman/blob/main/resources/views/layouts/app.blade.php"
click node_n_views_components "https://github.com/cristhianllanque/san_roman/blob/main/resources/views/components/chat-bubbles.blade.php"
click node_n_views_roles "https://github.com/cristhianllanque/san_roman/blob/main/resources/views/usuario/dashboard.blade.php"
click node_n_views_admin "https://github.com/cristhianllanque/san_roman/blob/main/resources/views/admin/dashboard.blade.php"
click node_n_views_auth_profile "https://github.com/cristhianllanque/san_roman/blob/main/resources/views/auth/login.blade.php"
click node_n_storage "https://github.com/cristhianllanque/san_roman/blob/main/public/sounds/new-message.mp3"

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_n_routes,node_n_auth_routes,node_n_ticket_ctrl,node_n_admin_ctrl,node_n_profile_ctrl,node_n_auth_ctrls,node_n_requests toneBlue
class node_n_user,node_n_ticket,node_n_msg,node_n_incidencia,node_n_oficina toneAmber
class node_n_views_layouts,node_n_views_components,node_n_views_roles,node_n_views_admin,node_n_views_auth_profile toneMint
class node_n_public,node_n_storage toneRose
```

## Components

### HTTP layer

Laravel request entry, routing, controllers, and request validation.

- [Web routes](https://github.com/cristhianllanque/san_roman/blob/main/routes/web.php): route definitions · Main HTTP routes for app, tickets, admin, and role-specific screens. · `routes/web.php`
- [Auth routes](https://github.com/cristhianllanque/san_roman/blob/main/routes/auth.php): auth routes · Authentication and account-management routes. · `routes/auth.php`
- [Ticket ctrl](https://github.com/cristhianllanque/san_roman/blob/main/app/Http/Controllers/TicketController.php): domain controller · Handles ticket creation, listing, chat, and follow-up flows. · `app/Http/Controllers/TicketController.php`
- [Admin ctrl](https://github.com/cristhianllanque/san_roman/blob/main/app/Http/Controllers/AdminController.php): admin controller · Coordinates admin dashboards, reports, users, offices, and technicians. · `app/Http/Controllers/AdminController.php`
- [Profile ctrl](https://github.com/cristhianllanque/san_roman/blob/main/app/Http/Controllers/ProfileController.php): profile controller · Manages profile updates and account deletion. · `app/Http/Controllers/ProfileController.php`
- [Auth ctrls](https://github.com/cristhianllanque/san_roman/blob/main/app/Http/Controllers/Auth/AuthenticatedSessionController.php): auth controllers · Login, registration, verification, password reset, and confirmation controllers. · `app/Http/Controllers/Auth/AuthenticatedSessionController.php`
- [Form requests](https://github.com/cristhianllanque/san_roman/blob/main/app/Http/Requests/Auth/LoginRequest.php): validation · Request validation for login and profile updates. · `app/Http/Requests/Auth/LoginRequest.php`

### Domain & data

Support-ticket entities and database persistence.

- [User](https://github.com/cristhianllanque/san_roman/blob/main/app/Models/User.php): account model · Application user with role and status fields. · `app/Models/User.php`
- [Ticket](https://github.com/cristhianllanque/san_roman/blob/main/app/Models/Ticket.php): support model · Core support request entity, including technician assignment and user data. · `app/Models/Ticket.php`
- [Mensaje](https://github.com/cristhianllanque/san_roman/blob/main/app/Models/Mensaje.php): chat model · Threaded ticket messages used by the chat flow. · `app/Models/Mensaje.php`
- [Incidencia](https://github.com/cristhianllanque/san_roman/blob/main/app/Models/Incidencia.php): incident model · Incident record linked to ticket handling and delivery timing. · `app/Models/Incidencia.php`
- [Oficina](https://github.com/cristhianllanque/san_roman/blob/main/app/Models/Oficina.php): reference model · Office or department reference data. · `app/Models/Oficina.php`

### Server UI

Blade layouts, role dashboards, and shared components.

- [Layouts](https://github.com/cristhianllanque/san_roman/blob/main/resources/views/layouts/app.blade.php): Blade shells · Shared app, guest, and navigation layouts for server-rendered screens. · `resources/views/layouts/app.blade.php`
- [Components](https://github.com/cristhianllanque/san_roman/blob/main/resources/views/components/chat-bubbles.blade.php): Blade components · Reusable UI pieces such as buttons, inputs, modal, nav, and chat bubbles. · `resources/views/components/chat-bubbles.blade.php`
- [Role screens](https://github.com/cristhianllanque/san_roman/blob/main/resources/views/usuario/dashboard.blade.php): role dashboards · User, technician, and admin dashboards plus role-specific ticket screens. · `resources/views/usuario/dashboard.blade.php`
- [Admin screens](https://github.com/cristhianllanque/san_roman/blob/main/resources/views/admin/dashboard.blade.php): admin views · Admin dashboards, statistics, offices, technicians, users, tickets, and reports. · `resources/views/admin/dashboard.blade.php`
- [Auth & profile UI](https://github.com/cristhianllanque/san_roman/blob/main/resources/views/auth/login.blade.php): account views · Login, registration, password, verification, and profile management screens. · `resources/views/auth/login.blade.php`

### Infra & assets

Public entrypoint, asset pipeline, storage, and bootstrapping.

- [Entry point](https://github.com/cristhianllanque/san_roman/blob/main/public/index.php): php front controller · Web requests enter Laravel through the public bootstrap file. · `public/index.php`
- [Assets & storage](https://github.com/cristhianllanque/san_roman/blob/main/public/sounds/new-message.mp3): static/runtime files · Public media assets, compiled front-end assets, logs, cache, and generated storage. · `public/sounds/new-message.mp3`

## Connections

- Entry point → Web routes: boots app · The front controller hands off to Laravel routing.
- Entry point → Auth routes: auth entry · Authentication paths are registered through the route layer.
- Web routes → Ticket ctrl: dispatches · Ticket-related endpoints are routed to the ticket controller.
- Web routes → Admin ctrl: dispatches · Admin endpoints are routed to the admin controller.
- Web routes → Profile ctrl: dispatches · Profile endpoints are routed to the profile controller.
- Auth routes → Auth ctrls: dispatches · Auth routes map to the auth controller set.
- Ticket ctrl → Ticket: reads/writes · Ticket workflows persist support requests.
- Ticket ctrl → Mensaje: chat data · Ticket chat uses message records.
- Ticket ctrl → Incidencia: creates incidents · Technician handling can produce incident records.
- Admin ctrl → User: manages · Admin views and updates users and their roles.
- Admin ctrl → Ticket: oversees · Admin reporting and dashboards inspect ticket data.
- Admin ctrl → Oficina: manages · Admin maintains office reference data.
- Admin ctrl → Incidencia: reports on · Incident records support operational reporting.
- Profile ctrl → User: updates · Profile changes apply to the authenticated user.
- Auth ctrls → User: auth accounts · Registration, login, and recovery operate on user accounts.
- Form requests → Auth ctrls: validates · Form requests validate auth submissions.
- Form requests → Profile ctrl: validates · Profile update requests are validated before persistence.
- Layouts → Components: composes · Layouts reuse shared Blade components.
- Layouts → Role screens: wraps · Role-specific screens render inside the main app shell.
- Layouts → Admin screens: wraps · Admin screens use the shared application layout.
- Layouts → Auth & profile UI: wraps · Auth and profile pages use guest or app layouts.
- Role screens → Ticket ctrl: drives · User and technician screens present ticket actions and statuses.
- Admin screens → Admin ctrl: drives · Admin screens surface management and reporting actions.
- Auth & profile UI → Auth ctrls: submits to · Auth forms post to the auth controller set.
- Auth & profile UI → Profile ctrl: submits to · Profile forms post to profile actions.
- Role screens → Ticket: shows · Role dashboards and ticket pages render ticket data.
- Admin screens → User: shows · Admin views display user management data.
- Role screens → Mensaje: shows · Chat screens display ticket conversations.
- Assets & storage → Components: serves assets · UI uses public media and compiled front-end resources.
