> For the complete documentation index, see [llms.txt](https://senselab.gitbook.io/senselab-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://senselab.gitbook.io/senselab-docs/docs/diagrams.md).

# Diagramas y Visualizaciones — Senselab Core API

> Guía visual de arquitectura enterprise para desarrolladores y ejecutivos.\
> Todos los diagramas usan **Mermaid** y se renderizan automáticamente en GitHub, GitLab, VS Code y documentación estática.

***

## 🏆 Badges de Auditoría

![PHPStan Level 8](/files/mx2kRR79v8iUwuQEtEvM) ![Tests 959+ Passing](/files/JPyTd2rLL4JDTSffgxsa) ![Audit Score 9.2/10](/files/O14Yje5WoXGNngc3Flr7) ![Hacienda v4.4 Compliance](/files/3K76OlCo48o6Moe3cMpi) ![AI Services](/files/5yWU2QsNCgNIFuSRz1to) ![Multi-Tenant](/files/LFn3sbe5Xd0sjgjLZGue)

***

## 📁 Índice de Diagramas

| # | Diagrama                                                                                          | Tipo                | Audiencia               | Archivo                               |
| - | ------------------------------------------------------------------------------------------------- | ------------------- | ----------------------- | ------------------------------------- |
| 1 | [Arquitectura Multi-Tenant](/senselab-docs/docs/diagrams/01-arquitectura-multi-tenant.md)         | Graph (Topología)   | Desarrolladores, DevOps | `01-arquitectura-multi-tenant.md`     |
| 2 | [Flujo Facturación Electrónica](/senselab-docs/docs/diagrams/02-flujo-facturacion-electronica.md) | Sequence Diagram    | Desarrolladores, QA     | `02-flujo-facturacion-electronica.md` |
| 3 | [Ciclo de Vida del Dato con IA](/senselab-docs/docs/diagrams/03-ciclo-vida-dato-ia.md)            | Flow Diagram        | Ejecutivos, Ventas      | `03-ciclo-vida-dato-ia.md`            |
| 4 | [Precisión de Servicios IA](/senselab-docs/docs/diagrams/04-precision-servicios-ia.md)            | Bar Chart + Pie     | Ejecutivos, Ventas      | `04-precision-servicios-ia.md`        |
| 5 | [ERD Módulo Contable](/senselab-docs/docs/diagrams/05-erd-modulo-contable.md)                     | Entity-Relationship | Desarrolladores         | `05-erd-modulo-contable.md`           |
| 6 | [ERD Módulo Logística](/senselab-docs/docs/diagrams/06-erd-modulo-logistica.md)                   | Entity-Relationship | Desarrolladores         | `06-erd-modulo-logistica.md`          |
| 7 | [Matriz RBAC Seguridad](/senselab-docs/docs/diagrams/07-matriz-rbac-seguridad.md)                 | Table + Graph       | Admins, Seguridad       | `07-matriz-rbac-seguridad.md`         |
| 8 | [Benchmarks Rendimiento Redis](/senselab-docs/docs/diagrams/08-benchmarks-rendimiento-redis.md)   | XY Chart + Graph    | Ventas, DevOps          | `08-benchmarks-rendimiento-redis.md`  |

***

## 🎯 Resumen Ejecutivo Visual

### Métricas Clave (Abril 2026 — v5.0.1)

```
┌─────────────────────────────────────────────────────────────┐
│                    SENSELAB CORE API v5.0.1                     │
├──────────────┬──────────────┬──────────────┬────────────────┤
│  96 Controllers │  98 Models   │  67 Services │  80 Policies  │
├──────────────┼──────────────┼──────────────┼────────────────┤
│  175 Requests │  81 Resources │  103 Migrations │ 63 DTOs    │
├──────────────┼──────────────┼──────────────┼────────────────┤
│  154 Test Files │  10 AI Svcs │  9 Hacienda  │ 22 Fases ✅   │
├──────────────┴──────────────┴──────────────┴────────────────┤
│  PHPStan L8 ✅ │ 9.2/10 Audit │ Hacienda v4.4 100% │ Redis  │
└─────────────────────────────────────────────────────────────┘
```

### Para Equipo de Ventas

* **Diagrama 1** → "Cada empresa tiene su propia base de datos aislada"
* **Diagrama 3** → "La IA procesa facturas automáticamente"
* **Diagrama 4** → "92% precisión OCR, 98% clasificación tributaria"
* **Diagrama 8** → "93% más rápido con cache inteligente"

### Para Equipo Técnico

* **Diagrama 2** → Flujo completo de firma XAdES-EPES y envío a Hacienda
* **Diagramas 5-6** → ERDs para entender las relaciones de datos
* **Diagrama 7** → 68 permisos, doble capa enforcement
* **Diagrama 8** → Arquitectura Redis multi-capa + read replicas


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://senselab.gitbook.io/senselab-docs/docs/diagrams.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
