# crazzycoderhacker/biomedsys architecture

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

- Interactive diagram: https://gitdiagram.com/crazzycoderhacker/biomedsys
- Repository: https://github.com/crazzycoderhacker/biomedsys

## Overview

BioMedGest es una aplicación web para gestionar equipamiento médico y sus operaciones clínicas. El flujo principal va desde el inicio de sesión hasta la consulta de inventario o el registro de un reporte; los reportes pueden originar órdenes correctivas, cuya ejecución se documenta en mantenimiento. La aplicación también cubre administración de inventario, capacitación, cotizaciones, usuarios y trazabilidad. La capa Supabase centraliza acceso a datos y autenticación; el README documenta PostgreSQL/Supabase como persistencia. Algunas capacidades están documentadas, pero sus enlaces de ejecución no aparecen en los fragmentos disponibles.

Main entry points: [`src/lib/supabase.ts`](https://github.com/crazzycoderhacker/biomedsys/blob/main/src/lib/supabase.ts) (Acceso Supabase), [`src/App.tsx`](https://github.com/crazzycoderhacker/biomedsys/blob/main/src/App.tsx) (App y navegación), [`src/components/InventoryViews.tsx`](https://github.com/crazzycoderhacker/biomedsys/blob/main/src/components/InventoryViews.tsx) (Consulta de inventario), [`src/components/PrivateAttachmentPanel.tsx`](https://github.com/crazzycoderhacker/biomedsys/blob/main/src/components/PrivateAttachmentPanel.tsx) (Archivos privados)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Aplicación web"]
  node_app["App y navegación<br/>[App.tsx]"]
  node_dashboard["Panel de control<br/>[DashboardViews.tsx]"]
  node_reporting["Reportes de servicio<br/>[App.tsx]"]
end

subgraph group_operations["Inventario y operaciones"]
  node_inventory["Consulta de inventario<br/>[InventoryViews.tsx]"]
  node_inventoryadmin["Administración de inventario"]
  node_equipmentselector["Selector de equipo"]
  node_maintenance["Mantenimiento operativo"]
  node_attachments["Archivos privados"]
  node_training["Capacitación<br/>[TrainingViews.tsx]"]
end

subgraph group_governance["Administración y seguimiento"]
  node_admin["Usuarios y permisos<br/>[AdminViews.tsx]"]
  node_audit["Trazabilidad<br/>[AdminViews.tsx]"]
  node_quotes["Cotizaciones<br/>[AdminViews.tsx]"]
  node_platform["Solicitudes y avisos<br/>[PlatformViews.tsx]"]
end

subgraph group_backend["Datos y servicios"]
  node_data["Acceso Supabase<br/>[supabase.ts]"]
  node_database[("PostgreSQL en Supabase")]
  node_http["HTTP compartido<br/>[http.ts]"]
  node_adminfn["Funciones de usuarios<br/>[index.ts]"]
  node_storagefn["Administración de archivos<br/>[index.ts]"]
end

node_staff(("Personal clínico"))

node_staff -->|"usa"| node_app
node_app -->|"muestra"| node_dashboard
node_app -->|"muestra"| node_inventory
node_app -->|"registra"| node_reporting
node_reporting -->|"crea reportes"| node_data
node_reporting -->|"crea órdenes"| node_data
node_dashboard -->|"carga resumen"| node_data
node_inventory -->|"incluye administración"| node_inventoryadmin
node_inventory -->|"muestra archivos"| node_attachments
node_inventory -.->|"consulta inventario"| node_data
node_equipmentselector -->|"consulta equipos"| node_data
node_maintenance -->|"guarda intervenciones"| node_data
node_maintenance -->|"adjunta evidencia"| node_attachments
node_training -->|"gestiona capacitación"| node_data
node_training -->|"adjunta evidencia"| node_attachments
node_admin -->|"administra perfiles"| node_data
node_audit -->|"consulta bitácora"| node_data
node_quotes -->|"guarda cotizaciones"| node_data
node_platform -.->|"usa servicios"| node_data
node_data -->|"lee y escribe"| node_database
node_adminfn -->|"usa respuestas HTTP"| node_http
node_storagefn -->|"usa respuestas HTTP"| node_http

click node_app "https://github.com/crazzycoderhacker/biomedsys/blob/main/src/App.tsx"
click node_dashboard "https://github.com/crazzycoderhacker/biomedsys/blob/main/src/components/DashboardViews.tsx"
click node_reporting "https://github.com/crazzycoderhacker/biomedsys/blob/main/src/App.tsx"
click node_inventory "https://github.com/crazzycoderhacker/biomedsys/blob/main/src/components/InventoryViews.tsx"
click node_inventoryadmin "https://github.com/crazzycoderhacker/biomedsys/blob/main/src/components/InventoryAdministration.tsx"
click node_equipmentselector "https://github.com/crazzycoderhacker/biomedsys/blob/main/src/components/EquipmentReportSelector.tsx"
click node_maintenance "https://github.com/crazzycoderhacker/biomedsys/blob/main/src/components/OperationalViews.tsx"
click node_attachments "https://github.com/crazzycoderhacker/biomedsys/blob/main/src/components/PrivateAttachmentPanel.tsx"
click node_training "https://github.com/crazzycoderhacker/biomedsys/blob/main/src/components/TrainingViews.tsx"
click node_admin "https://github.com/crazzycoderhacker/biomedsys/blob/main/src/components/AdminViews.tsx"
click node_audit "https://github.com/crazzycoderhacker/biomedsys/blob/main/src/components/AdminViews.tsx"
click node_quotes "https://github.com/crazzycoderhacker/biomedsys/blob/main/src/components/AdminViews.tsx"
click node_platform "https://github.com/crazzycoderhacker/biomedsys/blob/main/src/components/PlatformViews.tsx"
click node_data "https://github.com/crazzycoderhacker/biomedsys/blob/main/src/lib/supabase.ts"
click node_database "https://github.com/crazzycoderhacker/biomedsys/tree/main/supabase"
click node_http "https://github.com/crazzycoderhacker/biomedsys/blob/main/supabase/functions/_shared/http.ts"
click node_adminfn "https://github.com/crazzycoderhacker/biomedsys/blob/main/supabase/functions/admin-users/index.ts"
click node_storagefn "https://github.com/crazzycoderhacker/biomedsys/blob/main/supabase/functions/storage-admin/index.ts"

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_app,node_dashboard,node_reporting toneBlue
class node_inventory,node_inventoryadmin,node_equipmentselector,node_maintenance,node_attachments,node_training toneAmber
class node_admin,node_audit,node_quotes,node_platform toneMint
class node_data,node_database,node_http,node_adminfn,node_storagefn toneRose
class node_staff toneIndigo
```

## Components

### Aplicación web

- [App y navegación](https://github.com/crazzycoderhacker/biomedsys/blob/main/src/App.tsx): `src/App.tsx`
- [Panel de control](https://github.com/crazzycoderhacker/biomedsys/blob/main/src/components/DashboardViews.tsx): `src/components/DashboardViews.tsx`
- [Reportes de servicio](https://github.com/crazzycoderhacker/biomedsys/blob/main/src/App.tsx): `src/App.tsx`

### Inventario y operaciones

- [Consulta de inventario](https://github.com/crazzycoderhacker/biomedsys/blob/main/src/components/InventoryViews.tsx): `src/components/InventoryViews.tsx`
- [Administración de inventario](https://github.com/crazzycoderhacker/biomedsys/blob/main/src/components/InventoryAdministration.tsx): `src/components/InventoryAdministration.tsx`
- [Selector de equipo](https://github.com/crazzycoderhacker/biomedsys/blob/main/src/components/EquipmentReportSelector.tsx): `src/components/EquipmentReportSelector.tsx`
- [Mantenimiento operativo](https://github.com/crazzycoderhacker/biomedsys/blob/main/src/components/OperationalViews.tsx): `src/components/OperationalViews.tsx`
- [Archivos privados](https://github.com/crazzycoderhacker/biomedsys/blob/main/src/components/PrivateAttachmentPanel.tsx): `src/components/PrivateAttachmentPanel.tsx`
- [Capacitación](https://github.com/crazzycoderhacker/biomedsys/blob/main/src/components/TrainingViews.tsx): `src/components/TrainingViews.tsx`

### Administración y seguimiento

- [Usuarios y permisos](https://github.com/crazzycoderhacker/biomedsys/blob/main/src/components/AdminViews.tsx): `src/components/AdminViews.tsx`
- [Trazabilidad](https://github.com/crazzycoderhacker/biomedsys/blob/main/src/components/AdminViews.tsx): `src/components/AdminViews.tsx`
- [Cotizaciones](https://github.com/crazzycoderhacker/biomedsys/blob/main/src/components/AdminViews.tsx): `src/components/AdminViews.tsx`
- [Solicitudes y avisos](https://github.com/crazzycoderhacker/biomedsys/blob/main/src/components/PlatformViews.tsx): `src/components/PlatformViews.tsx`

### Datos y servicios

- [Acceso Supabase](https://github.com/crazzycoderhacker/biomedsys/blob/main/src/lib/supabase.ts): `src/lib/supabase.ts`
- [PostgreSQL en Supabase](https://github.com/crazzycoderhacker/biomedsys/tree/main/supabase): `supabase`
- [HTTP compartido](https://github.com/crazzycoderhacker/biomedsys/blob/main/supabase/functions/_shared/http.ts): `supabase/functions/_shared/http.ts`
- [Funciones de usuarios](https://github.com/crazzycoderhacker/biomedsys/blob/main/supabase/functions/admin-users/index.ts): `supabase/functions/admin-users/index.ts`
- [Administración de archivos](https://github.com/crazzycoderhacker/biomedsys/blob/main/supabase/functions/storage-admin/index.ts): `supabase/functions/storage-admin/index.ts`

### Other components

- **Personal clínico**

## Connections

- Personal clínico → App y navegación: usa
- App y navegación → Panel de control: muestra (evidence: `src/App.tsx`)
- App y navegación → Consulta de inventario: muestra (evidence: `src/App.tsx`)
- App y navegación → Reportes de servicio: registra (evidence: `src/App.tsx`)
- Reportes de servicio → Acceso Supabase: crea reportes (evidence: `src/App.tsx`)
- Reportes de servicio → Acceso Supabase: crea órdenes (evidence: `src/App.tsx`)
- Panel de control → Acceso Supabase: carga resumen (evidence: `src/components/DashboardViews.tsx`)
- Consulta de inventario → Administración de inventario: incluye administración (evidence: `src/components/InventoryViews.tsx`)
- Consulta de inventario → Archivos privados: muestra archivos (evidence: `src/components/InventoryViews.tsx`)
- Consulta de inventario → Acceso Supabase: consulta inventario (evidence: `src/components/InventoryViews.tsx`)
- Selector de equipo → Acceso Supabase: consulta equipos (evidence: `src/components/EquipmentReportSelector.tsx`)
- Mantenimiento operativo → Acceso Supabase: guarda intervenciones (evidence: `src/components/OperationalViews.tsx`)
- Mantenimiento operativo → Archivos privados: adjunta evidencia (evidence: `src/components/OperationalViews.tsx`)
- Capacitación → Acceso Supabase: gestiona capacitación (evidence: `src/components/TrainingViews.tsx`)
- Capacitación → Archivos privados: adjunta evidencia (evidence: `src/components/TrainingViews.tsx`)
- Usuarios y permisos → Acceso Supabase: administra perfiles (evidence: `src/components/AdminViews.tsx`)
- Trazabilidad → Acceso Supabase: consulta bitácora (evidence: `src/components/AdminViews.tsx`)
- Cotizaciones → Acceso Supabase: guarda cotizaciones (evidence: `src/components/AdminViews.tsx`)
- Solicitudes y avisos → Acceso Supabase: usa servicios (evidence: `src/components/PlatformViews.tsx`)
- Acceso Supabase → PostgreSQL en Supabase: lee y escribe (evidence: `README.md`)
- Funciones de usuarios → HTTP compartido: usa respuestas HTTP (evidence: `supabase/functions/admin-users/index.ts`)
- Administración de archivos → HTTP compartido: usa respuestas HTTP (evidence: `supabase/functions/storage-admin/index.ts`)
