# joseluisbg/empresacontigo architecture

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

- Interactive diagram: https://gitdiagram.com/joseluisbg/empresacontigo
- Repository: https://github.com/joseluisbg/empresacontigo

## Overview

Empresa Contigo is a Laravel web application for company and employee administration, workplace-health surveys, clinical information, notices, and mailboxes. Users and administrators enter through web routes, which dispatch to controllers or Livewire components; survey controllers calculate and persist results, while employee and notice features support company operations. Authentication and role/company middleware gate many routes. The graph reflects route declarations and sampled controller/component references; several listed subsystems were not sampled, so their internal behavior and storage links are left unspecified.

Main entry points: [`routes/web.php`](https://github.com/joseluisbg/empresacontigo/blob/master/routes/web.php) (Web routes), [`app/Models/notificaciones.php`](https://github.com/joseluisbg/empresacontigo/blob/master/app/Models/notificaciones.php) (Notices), [`app/Policies/notificacionesPolicy.php`](https://github.com/joseluisbg/empresacontigo/blob/master/app/Policies/notificacionesPolicy.php) (Notice policy), [`app/Providers/FortifyServiceProvider.php`](https://github.com/joseluisbg/empresacontigo/blob/master/app/Providers/FortifyServiceProvider.php) (Authentication setup)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Web entry and access"]
  node_web_routes["Web routes<br/>[web.php]"]
  node_route_provider["Route provider"]
  node_http_kernel["HTTP middleware<br/>[Kernel.php]"]
end

subgraph group_surveys["Health surveys"]
  node_survey_one["Survey one"]
  node_survey_two["Survey two"]
  node_survey_info["Survey information<br/>[InfoEncuestas.php]"]
  node_survey_store[("Survey results<br/>[results.php]")]
end

subgraph group_operations["Company operations"]
  node_employee_records["Employee records"]
  node_employee_list["Employee list<br/>[ListaEmpleados.php]"]
  node_employee_model[("Employee model<br/>[Empleado.php]")]
  node_clinical_info["Clinical information"]
  node_clinic_model[("Clinical model<br/>[InfoClinica.php]")]
  node_notices["Notice management<br/>[Avisos.php]"]
  node_notice_detail["Notice detail"]
  node_notice_save["Save notice<br/>[GuardaAvisos.php]"]
  node_notice_model[("Notices<br/>[notificaciones.php]")]
  node_mailbox_list["Mailbox list<br/>[ListaMailbox.php]"]
  node_mailbox_create["Mailbox registration"]
  node_company_registration["Company registration"]
  node_reports["Company reports"]
end

subgraph group_identity["Identity and authorization"]
  node_auth_provider["Authentication setup"]
  node_user_creation["Create account<br/>[CreateNewUser.php]"]
  node_user_profile["Update profile"]
  node_user_model[("User model<br/>[User.php]")]
  node_notice_policy["Notice policy"]
  node_authz_provider["Authorization setup"]
end

node_visitor(("User or admin"))

node_route_provider -->|"loads routes"| node_web_routes
node_web_routes -->|"applies middleware"| node_http_kernel
node_web_routes -->|"routes to"| node_survey_one
node_web_routes -->|"routes to"| node_survey_two
node_web_routes -->|"routes to"| node_survey_info
node_web_routes -->|"routes to"| node_employee_records
node_web_routes -->|"routes to"| node_employee_list
node_web_routes -->|"routes to"| node_clinical_info
node_web_routes -->|"routes to"| node_notices
node_web_routes -->|"routes to"| node_notice_detail
node_web_routes -->|"routes to"| node_notice_save
node_web_routes -->|"routes to"| node_mailbox_list
node_web_routes -->|"routes to"| node_mailbox_create
node_web_routes -->|"routes to"| node_company_registration
node_web_routes -->|"routes to"| node_reports
node_visitor -.->|"requests pages"| node_web_routes
node_survey_one -->|"reads and writes"| node_survey_store
node_survey_two -->|"reads and writes"| node_survey_store
node_employee_records -->|"creates employee"| node_employee_model
node_employee_list -->|"queries employees"| node_employee_model
node_clinical_info -->|"uses clinical data"| node_clinic_model
node_notices -->|"uses notices"| node_notice_model
node_notice_detail -->|"uses notices"| node_notice_model
node_notice_save -->|"uses notices"| node_notice_model
node_auth_provider -->|"registers handler"| node_user_creation
node_auth_provider -->|"registers handler"| node_user_profile
node_user_creation -->|"creates user"| node_user_model
node_authz_provider -->|"registers policy"| node_notice_policy
node_notice_policy -->|"checks user"| node_user_model
node_notice_policy -->|"checks notice"| node_notice_model

click node_web_routes "https://github.com/joseluisbg/empresacontigo/blob/master/routes/web.php"
click node_route_provider "https://github.com/joseluisbg/empresacontigo/blob/master/app/Providers/RouteServiceProvider.php"
click node_http_kernel "https://github.com/joseluisbg/empresacontigo/blob/master/app/Http/Kernel.php"
click node_survey_one "https://github.com/joseluisbg/empresacontigo/blob/master/app/Http/Controllers/CuestionarioController.php"
click node_survey_two "https://github.com/joseluisbg/empresacontigo/blob/master/app/Http/Controllers/CuestionariodosController.php"
click node_survey_info "https://github.com/joseluisbg/empresacontigo/blob/master/app/Http/Livewire/InfoEncuestas.php"
click node_survey_store "https://github.com/joseluisbg/empresacontigo/blob/master/app/Models/results.php"
click node_employee_records "https://github.com/joseluisbg/empresacontigo/blob/master/app/Http/Controllers/EmpleadosController.php"
click node_employee_list "https://github.com/joseluisbg/empresacontigo/blob/master/app/Http/Livewire/ListaEmpleados.php"
click node_employee_model "https://github.com/joseluisbg/empresacontigo/blob/master/app/Models/Empleado.php"
click node_clinical_info "https://github.com/joseluisbg/empresacontigo/blob/master/app/Http/Livewire/InformacionClinica.php"
click node_clinic_model "https://github.com/joseluisbg/empresacontigo/blob/master/app/Models/InfoClinica.php"
click node_notices "https://github.com/joseluisbg/empresacontigo/blob/master/app/Http/Livewire/Avisos.php"
click node_notice_detail "https://github.com/joseluisbg/empresacontigo/blob/master/app/Http/Livewire/EspecificAvisos.php"
click node_notice_save "https://github.com/joseluisbg/empresacontigo/blob/master/app/Http/Livewire/GuardaAvisos.php"
click node_notice_model "https://github.com/joseluisbg/empresacontigo/blob/master/app/Models/notificaciones.php"
click node_mailbox_list "https://github.com/joseluisbg/empresacontigo/blob/master/app/Http/Livewire/ListaMailbox.php"
click node_mailbox_create "https://github.com/joseluisbg/empresacontigo/blob/master/app/Http/Livewire/RegistraMailbox.php"
click node_company_registration "https://github.com/joseluisbg/empresacontigo/blob/master/app/Http/Livewire/RegistrerCompanies.php"
click node_reports "https://github.com/joseluisbg/empresacontigo/blob/master/app/Http/Controllers/ReporteController.php"
click node_auth_provider "https://github.com/joseluisbg/empresacontigo/blob/master/app/Providers/FortifyServiceProvider.php"
click node_user_creation "https://github.com/joseluisbg/empresacontigo/blob/master/app/Actions/Fortify/CreateNewUser.php"
click node_user_profile "https://github.com/joseluisbg/empresacontigo/blob/master/app/Actions/Fortify/UpdateUserProfileInformation.php"
click node_user_model "https://github.com/joseluisbg/empresacontigo/blob/master/app/Models/User.php"
click node_notice_policy "https://github.com/joseluisbg/empresacontigo/blob/master/app/Policies/notificacionesPolicy.php"
click node_authz_provider "https://github.com/joseluisbg/empresacontigo/blob/master/app/Providers/AuthServiceProvider.php"

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_web_routes,node_route_provider,node_http_kernel,node_visitor toneBlue
class node_survey_one,node_survey_two,node_survey_info,node_survey_store toneAmber
class node_employee_records,node_employee_list,node_employee_model,node_clinical_info,node_clinic_model,node_notices,node_notice_detail,node_notice_save,node_notice_model,node_mailbox_list,node_mailbox_create,node_company_registration,node_reports toneMint
class node_auth_provider,node_user_creation,node_user_profile,node_user_model,node_notice_policy,node_authz_provider toneRose
```

## Components

### Web entry and access

- [Web routes](https://github.com/joseluisbg/empresacontigo/blob/master/routes/web.php): `routes/web.php`
- [Route provider](https://github.com/joseluisbg/empresacontigo/blob/master/app/Providers/RouteServiceProvider.php): `app/Providers/RouteServiceProvider.php`
- [HTTP middleware](https://github.com/joseluisbg/empresacontigo/blob/master/app/Http/Kernel.php): `app/Http/Kernel.php`

### Health surveys

- [Survey one](https://github.com/joseluisbg/empresacontigo/blob/master/app/Http/Controllers/CuestionarioController.php): `app/Http/Controllers/CuestionarioController.php`
- [Survey two](https://github.com/joseluisbg/empresacontigo/blob/master/app/Http/Controllers/CuestionariodosController.php): `app/Http/Controllers/CuestionariodosController.php`
- [Survey information](https://github.com/joseluisbg/empresacontigo/blob/master/app/Http/Livewire/InfoEncuestas.php): `app/Http/Livewire/InfoEncuestas.php`
- [Survey results](https://github.com/joseluisbg/empresacontigo/blob/master/app/Models/results.php): `app/Models/results.php`

### Company operations

- [Employee records](https://github.com/joseluisbg/empresacontigo/blob/master/app/Http/Controllers/EmpleadosController.php): `app/Http/Controllers/EmpleadosController.php`
- [Employee list](https://github.com/joseluisbg/empresacontigo/blob/master/app/Http/Livewire/ListaEmpleados.php): `app/Http/Livewire/ListaEmpleados.php`
- [Employee model](https://github.com/joseluisbg/empresacontigo/blob/master/app/Models/Empleado.php): `app/Models/Empleado.php`
- [Clinical information](https://github.com/joseluisbg/empresacontigo/blob/master/app/Http/Livewire/InformacionClinica.php): `app/Http/Livewire/InformacionClinica.php`
- [Clinical model](https://github.com/joseluisbg/empresacontigo/blob/master/app/Models/InfoClinica.php): `app/Models/InfoClinica.php`
- [Notice management](https://github.com/joseluisbg/empresacontigo/blob/master/app/Http/Livewire/Avisos.php): `app/Http/Livewire/Avisos.php`
- [Notice detail](https://github.com/joseluisbg/empresacontigo/blob/master/app/Http/Livewire/EspecificAvisos.php): `app/Http/Livewire/EspecificAvisos.php`
- [Save notice](https://github.com/joseluisbg/empresacontigo/blob/master/app/Http/Livewire/GuardaAvisos.php): `app/Http/Livewire/GuardaAvisos.php`
- [Notices](https://github.com/joseluisbg/empresacontigo/blob/master/app/Models/notificaciones.php): `app/Models/notificaciones.php`
- [Mailbox list](https://github.com/joseluisbg/empresacontigo/blob/master/app/Http/Livewire/ListaMailbox.php): `app/Http/Livewire/ListaMailbox.php`
- [Mailbox registration](https://github.com/joseluisbg/empresacontigo/blob/master/app/Http/Livewire/RegistraMailbox.php): `app/Http/Livewire/RegistraMailbox.php`
- [Company registration](https://github.com/joseluisbg/empresacontigo/blob/master/app/Http/Livewire/RegistrerCompanies.php): `app/Http/Livewire/RegistrerCompanies.php`
- [Company reports](https://github.com/joseluisbg/empresacontigo/blob/master/app/Http/Controllers/ReporteController.php): `app/Http/Controllers/ReporteController.php`

### Identity and authorization

- [Authentication setup](https://github.com/joseluisbg/empresacontigo/blob/master/app/Providers/FortifyServiceProvider.php): `app/Providers/FortifyServiceProvider.php`
- [Create account](https://github.com/joseluisbg/empresacontigo/blob/master/app/Actions/Fortify/CreateNewUser.php): `app/Actions/Fortify/CreateNewUser.php`
- [Update profile](https://github.com/joseluisbg/empresacontigo/blob/master/app/Actions/Fortify/UpdateUserProfileInformation.php): `app/Actions/Fortify/UpdateUserProfileInformation.php`
- [User model](https://github.com/joseluisbg/empresacontigo/blob/master/app/Models/User.php): `app/Models/User.php`
- [Notice policy](https://github.com/joseluisbg/empresacontigo/blob/master/app/Policies/notificacionesPolicy.php): `app/Policies/notificacionesPolicy.php`
- [Authorization setup](https://github.com/joseluisbg/empresacontigo/blob/master/app/Providers/AuthServiceProvider.php): `app/Providers/AuthServiceProvider.php`

### Other components

- **User or admin**

## Connections

- Route provider → Web routes: loads routes (evidence: `app/Providers/RouteServiceProvider.php`)
- Web routes → HTTP middleware: applies middleware (evidence: `routes/web.php`)
- Web routes → Survey one: routes to (evidence: `routes/web.php`)
- Web routes → Survey two: routes to (evidence: `routes/web.php`)
- Web routes → Survey information: routes to (evidence: `routes/web.php`)
- Web routes → Employee records: routes to (evidence: `routes/web.php`)
- Web routes → Employee list: routes to (evidence: `routes/web.php`)
- Web routes → Clinical information: routes to (evidence: `routes/web.php`)
- Web routes → Notice management: routes to (evidence: `routes/web.php`)
- Web routes → Notice detail: routes to (evidence: `routes/web.php`)
- Web routes → Save notice: routes to (evidence: `routes/web.php`)
- Web routes → Mailbox list: routes to (evidence: `routes/web.php`)
- Web routes → Mailbox registration: routes to (evidence: `routes/web.php`)
- Web routes → Company registration: routes to (evidence: `routes/web.php`)
- Web routes → Company reports: routes to (evidence: `routes/web.php`)
- User or admin → Web routes: requests pages
- Survey one → Survey results: reads and writes (evidence: `app/Http/Controllers/CuestionarioController.php`)
- Survey two → Survey results: reads and writes (evidence: `app/Http/Controllers/CuestionariodosController.php`)
- Employee records → Employee model: creates employee (evidence: `app/Http/Controllers/EmpleadosController.php`)
- Employee list → Employee model: queries employees (evidence: `app/Http/Livewire/ListaEmpleados.php`)
- Clinical information → Clinical model: uses clinical data (evidence: `app/Http/Livewire/InformacionClinica.php`)
- Notice management → Notices: uses notices (evidence: `app/Http/Livewire/Avisos.php`)
- Notice detail → Notices: uses notices (evidence: `app/Http/Livewire/EspecificAvisos.php`)
- Save notice → Notices: uses notices (evidence: `app/Http/Livewire/GuardaAvisos.php`)
- Authentication setup → Create account: registers handler (evidence: `app/Providers/FortifyServiceProvider.php`)
- Authentication setup → Update profile: registers handler (evidence: `app/Providers/FortifyServiceProvider.php`)
- Create account → User model: creates user (evidence: `app/Actions/Fortify/CreateNewUser.php`)
- Authorization setup → Notice policy: registers policy (evidence: `app/Providers/AuthServiceProvider.php`)
- Notice policy → User model: checks user (evidence: `app/Policies/notificacionesPolicy.php`)
- Notice policy → Notices: checks notice (evidence: `app/Policies/notificacionesPolicy.php`)
