# userdavidgar03/warehouse architecture

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

- Interactive diagram: https://gitdiagram.com/userdavidgar03/warehouse
- Repository: https://github.com/userdavidgar03/warehouse

## Overview

Warehouse OS es una aplicación web para administrar inventario, proveedores, entradas de stock y órdenes de salida con autenticación y escaneo de SKU/códigos de barras. El flujo principal va desde la interfaz React, a través del cliente HTTP con JWT, hasta los endpoints Minimal API y la persistencia relacional. El README documenta capacidades que no aparecen completas en los extractos; las relaciones no verificables en el código se apoyan solo en esa documentación.

Main entry points: [`frontend/client/src/App.jsx`](https://github.com/userdavidgar03/warehouse/blob/main/frontend/client/src/App.jsx) (App y sesión), [`backend/WarehouseAPI/Program.cs`](https://github.com/userdavidgar03/warehouse/blob/main/backend/WarehouseAPI/Program.cs) (Endpoints y reglas), [`frontend/client/src/api/warehouseApi.js`](https://github.com/userdavidgar03/warehouse/blob/main/frontend/client/src/api/warehouseApi.js) (Cliente REST JWT), [`frontend/client/src/pages/dashboard/ProductsTab.jsx`](https://github.com/userdavidgar03/warehouse/blob/main/frontend/client/src/pages/dashboard/ProductsTab.jsx) (Inventario y CSV)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Interfaz de almacén"]
  node_app["App y sesión<br/>[App.jsx]"]
  node_auth["Acceso y registro<br/>[AuthFormView.jsx]"]
  node_welcome["Bienvenida<br/>[WelcomeView.jsx]"]
  node_header["Cabecera<br/>[Header.jsx]"]
  node_sidebar["Navegación<br/>[Sidebar.jsx]"]
  node_kpi["Métricas KPI<br/>[KpiCards.jsx]"]
  node_api_client["Cliente REST JWT<br/>[warehouseApi.js]"]
end

subgraph group_api["API y dominio"]
  node_program["Endpoints y reglas<br/>[Program.cs]"]
  node_user["Usuario<br/>[User.cs]"]
  node_product["Producto e inventario<br/>[Product.cs]"]
  node_supplier["Proveedor<br/>[Supplier.cs]"]
  node_order["Orden y partidas<br/>[Order.cs]"]
end

subgraph group_persistence["Persistencia"]
  node_context["Contexto EF"]
  node_postgres[("PostgreSQL")]
end

subgraph group_operations["Operaciones UI"]
  node_products_ui["Inventario y CSV<br/>[ProductsTab.jsx]"]
  node_add_product["Alta de producto<br/>[AddProductTab.jsx]"]
  node_alerts["Alertas de stock<br/>[AlertsTab.jsx]"]
  node_suppliers_ui["Proveedores UI<br/>[SuppliersTab.jsx]"]
  node_orders_ui["Historial órdenes<br/>[OrdersTab.jsx]"]
  node_new_order["Crear orden<br/>[NewOrderModal.jsx]"]
  node_stock_entry["Entrada de stock"]
  node_scanner["Escáner cámara"]
  node_csv["Exportación CSV<br/>[exportcsv.js]"]
end

node_operator(("Personal almacén"))

node_operator -->|"opera"| node_app
node_app -->|"muestra"| node_welcome
node_app -->|"muestra"| node_auth
node_app -->|"renderiza"| node_header
node_app -->|"renderiza"| node_sidebar
node_app -->|"renderiza"| node_kpi
node_app -->|"muestra"| node_products_ui
node_app -->|"muestra"| node_add_product
node_app -->|"muestra"| node_alerts
node_app -->|"muestra"| node_suppliers_ui
node_app -->|"muestra"| node_orders_ui
node_auth -->|"solicita acceso"| node_api_client
node_app -->|"carga datos"| node_api_client
node_products_ui -->|"abre"| node_stock_entry
node_products_ui -->|"exporta"| node_csv
node_orders_ui -->|"abre"| node_new_order
node_new_order -->|"abre"| node_scanner
node_add_product -->|"usa"| node_scanner
node_products_ui -.->|"consulta API"| node_api_client
node_add_product -->|"consulta API"| node_api_client
node_suppliers_ui -->|"consulta API"| node_api_client
node_new_order -->|"registra orden"| node_api_client
node_stock_entry -->|"registra entrada"| node_api_client
node_api_client -->|"envía HTTP"| node_program
node_program -->|"consulta y guarda"| node_context
node_program -->|"gestiona usuarios"| node_user
node_program -->|"gestiona productos"| node_product
node_program -->|"gestiona proveedores"| node_supplier
node_program -->|"crea órdenes"| node_order
node_context -->|"persiste datos"| node_postgres
node_program -->|"transacciona entradas y salidas"| node_postgres

click node_app "https://github.com/userdavidgar03/warehouse/blob/main/frontend/client/src/App.jsx"
click node_auth "https://github.com/userdavidgar03/warehouse/blob/main/frontend/client/src/pages/auth/AuthFormView.jsx"
click node_welcome "https://github.com/userdavidgar03/warehouse/blob/main/frontend/client/src/pages/auth/WelcomeView.jsx"
click node_header "https://github.com/userdavidgar03/warehouse/blob/main/frontend/client/src/components/layout/Header.jsx"
click node_sidebar "https://github.com/userdavidgar03/warehouse/blob/main/frontend/client/src/components/layout/Sidebar.jsx"
click node_kpi "https://github.com/userdavidgar03/warehouse/blob/main/frontend/client/src/components/dashboard/KpiCards.jsx"
click node_api_client "https://github.com/userdavidgar03/warehouse/blob/main/frontend/client/src/api/warehouseApi.js"
click node_products_ui "https://github.com/userdavidgar03/warehouse/blob/main/frontend/client/src/pages/dashboard/ProductsTab.jsx"
click node_add_product "https://github.com/userdavidgar03/warehouse/blob/main/frontend/client/src/pages/dashboard/AddProductTab.jsx"
click node_alerts "https://github.com/userdavidgar03/warehouse/blob/main/frontend/client/src/pages/dashboard/AlertsTab.jsx"
click node_suppliers_ui "https://github.com/userdavidgar03/warehouse/blob/main/frontend/client/src/pages/dashboard/SuppliersTab.jsx"
click node_orders_ui "https://github.com/userdavidgar03/warehouse/blob/main/frontend/client/src/pages/dashboard/OrdersTab.jsx"
click node_new_order "https://github.com/userdavidgar03/warehouse/blob/main/frontend/client/src/components/dashboard/NewOrderModal.jsx"
click node_stock_entry "https://github.com/userdavidgar03/warehouse/blob/main/frontend/client/src/components/dashboard/StockEntryModal.jsx"
click node_scanner "https://github.com/userdavidgar03/warehouse/blob/main/frontend/client/src/pages/dashboard/BarcodeScannerModal.jsx"
click node_csv "https://github.com/userdavidgar03/warehouse/blob/main/frontend/client/src/utils/exportcsv.js"
click node_program "https://github.com/userdavidgar03/warehouse/blob/main/backend/WarehouseAPI/Program.cs"
click node_user "https://github.com/userdavidgar03/warehouse/blob/main/backend/WarehouseAPI/Models/User.cs"
click node_product "https://github.com/userdavidgar03/warehouse/blob/main/backend/WarehouseAPI/Models/Product.cs"
click node_supplier "https://github.com/userdavidgar03/warehouse/blob/main/backend/WarehouseAPI/Models/Supplier.cs"
click node_order "https://github.com/userdavidgar03/warehouse/blob/main/backend/WarehouseAPI/Models/Order.cs"
click node_context "https://github.com/userdavidgar03/warehouse/blob/main/backend/WarehouseAPI/Data/WarehouseContext.cs"

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_auth,node_welcome,node_header,node_sidebar,node_kpi,node_api_client toneBlue
class node_program,node_user,node_product,node_supplier,node_order toneAmber
class node_context,node_postgres toneMint
class node_products_ui,node_add_product,node_alerts,node_suppliers_ui,node_orders_ui,node_new_order,node_stock_entry,node_scanner,node_csv toneRose
class node_operator toneIndigo
```

## Components

### Interfaz de almacén

- [App y sesión](https://github.com/userdavidgar03/warehouse/blob/main/frontend/client/src/App.jsx): `frontend/client/src/App.jsx`
- [Acceso y registro](https://github.com/userdavidgar03/warehouse/blob/main/frontend/client/src/pages/auth/AuthFormView.jsx): `frontend/client/src/pages/auth/AuthFormView.jsx`
- [Bienvenida](https://github.com/userdavidgar03/warehouse/blob/main/frontend/client/src/pages/auth/WelcomeView.jsx): `frontend/client/src/pages/auth/WelcomeView.jsx`
- [Cabecera](https://github.com/userdavidgar03/warehouse/blob/main/frontend/client/src/components/layout/Header.jsx): `frontend/client/src/components/layout/Header.jsx`
- [Navegación](https://github.com/userdavidgar03/warehouse/blob/main/frontend/client/src/components/layout/Sidebar.jsx): `frontend/client/src/components/layout/Sidebar.jsx`
- [Métricas KPI](https://github.com/userdavidgar03/warehouse/blob/main/frontend/client/src/components/dashboard/KpiCards.jsx): `frontend/client/src/components/dashboard/KpiCards.jsx`
- [Cliente REST JWT](https://github.com/userdavidgar03/warehouse/blob/main/frontend/client/src/api/warehouseApi.js): `frontend/client/src/api/warehouseApi.js`

### API y dominio

- [Endpoints y reglas](https://github.com/userdavidgar03/warehouse/blob/main/backend/WarehouseAPI/Program.cs): `backend/WarehouseAPI/Program.cs`
- [Usuario](https://github.com/userdavidgar03/warehouse/blob/main/backend/WarehouseAPI/Models/User.cs): `backend/WarehouseAPI/Models/User.cs`
- [Producto e inventario](https://github.com/userdavidgar03/warehouse/blob/main/backend/WarehouseAPI/Models/Product.cs): `backend/WarehouseAPI/Models/Product.cs`
- [Proveedor](https://github.com/userdavidgar03/warehouse/blob/main/backend/WarehouseAPI/Models/Supplier.cs): `backend/WarehouseAPI/Models/Supplier.cs`
- [Orden y partidas](https://github.com/userdavidgar03/warehouse/blob/main/backend/WarehouseAPI/Models/Order.cs): `backend/WarehouseAPI/Models/Order.cs`

### Persistencia

- [Contexto EF](https://github.com/userdavidgar03/warehouse/blob/main/backend/WarehouseAPI/Data/WarehouseContext.cs): `backend/WarehouseAPI/Data/WarehouseContext.cs`
- **PostgreSQL**

### Operaciones UI

- [Inventario y CSV](https://github.com/userdavidgar03/warehouse/blob/main/frontend/client/src/pages/dashboard/ProductsTab.jsx): `frontend/client/src/pages/dashboard/ProductsTab.jsx`
- [Alta de producto](https://github.com/userdavidgar03/warehouse/blob/main/frontend/client/src/pages/dashboard/AddProductTab.jsx): `frontend/client/src/pages/dashboard/AddProductTab.jsx`
- [Alertas de stock](https://github.com/userdavidgar03/warehouse/blob/main/frontend/client/src/pages/dashboard/AlertsTab.jsx): `frontend/client/src/pages/dashboard/AlertsTab.jsx`
- [Proveedores UI](https://github.com/userdavidgar03/warehouse/blob/main/frontend/client/src/pages/dashboard/SuppliersTab.jsx): `frontend/client/src/pages/dashboard/SuppliersTab.jsx`
- [Historial órdenes](https://github.com/userdavidgar03/warehouse/blob/main/frontend/client/src/pages/dashboard/OrdersTab.jsx): `frontend/client/src/pages/dashboard/OrdersTab.jsx`
- [Crear orden](https://github.com/userdavidgar03/warehouse/blob/main/frontend/client/src/components/dashboard/NewOrderModal.jsx): `frontend/client/src/components/dashboard/NewOrderModal.jsx`
- [Entrada de stock](https://github.com/userdavidgar03/warehouse/blob/main/frontend/client/src/components/dashboard/StockEntryModal.jsx): `frontend/client/src/components/dashboard/StockEntryModal.jsx`
- [Escáner cámara](https://github.com/userdavidgar03/warehouse/blob/main/frontend/client/src/pages/dashboard/BarcodeScannerModal.jsx): `frontend/client/src/pages/dashboard/BarcodeScannerModal.jsx`
- [Exportación CSV](https://github.com/userdavidgar03/warehouse/blob/main/frontend/client/src/utils/exportcsv.js): `frontend/client/src/utils/exportcsv.js`

### Other components

- **Personal almacén**

## Connections

- Personal almacén → App y sesión: opera (evidence: `README.md`)
- App y sesión → Bienvenida: muestra (evidence: `frontend/client/src/App.jsx`)
- App y sesión → Acceso y registro: muestra (evidence: `frontend/client/src/App.jsx`)
- App y sesión → Cabecera: renderiza (evidence: `frontend/client/src/App.jsx`)
- App y sesión → Navegación: renderiza (evidence: `frontend/client/src/App.jsx`)
- App y sesión → Métricas KPI: renderiza (evidence: `frontend/client/src/App.jsx`)
- App y sesión → Inventario y CSV: muestra (evidence: `frontend/client/src/App.jsx`)
- App y sesión → Alta de producto: muestra (evidence: `frontend/client/src/App.jsx`)
- App y sesión → Alertas de stock: muestra (evidence: `frontend/client/src/App.jsx`)
- App y sesión → Proveedores UI: muestra (evidence: `frontend/client/src/App.jsx`)
- App y sesión → Historial órdenes: muestra (evidence: `frontend/client/src/App.jsx`)
- Acceso y registro → Cliente REST JWT: solicita acceso (evidence: `frontend/client/src/pages/auth/AuthFormView.jsx`)
- App y sesión → Cliente REST JWT: carga datos (evidence: `frontend/client/src/App.jsx`)
- Inventario y CSV → Entrada de stock: abre (evidence: `frontend/client/src/pages/dashboard/ProductsTab.jsx`)
- Inventario y CSV → Exportación CSV: exporta (evidence: `frontend/client/src/pages/dashboard/ProductsTab.jsx`)
- Historial órdenes → Crear orden: abre (evidence: `frontend/client/src/pages/dashboard/OrdersTab.jsx`)
- Crear orden → Escáner cámara: abre (evidence: `frontend/client/src/components/dashboard/NewOrderModal.jsx`)
- Alta de producto → Escáner cámara: usa (evidence: `frontend/client/src/pages/dashboard/AddProductTab.jsx`)
- Inventario y CSV → Cliente REST JWT: consulta API
- Alta de producto → Cliente REST JWT: consulta API (evidence: `frontend/client/src/pages/dashboard/AddProductTab.jsx`)
- Proveedores UI → Cliente REST JWT: consulta API (evidence: `frontend/client/src/pages/dashboard/SuppliersTab.jsx`)
- Crear orden → Cliente REST JWT: registra orden (evidence: `frontend/client/src/components/dashboard/NewOrderModal.jsx`)
- Entrada de stock → Cliente REST JWT: registra entrada (evidence: `frontend/client/src/components/dashboard/StockEntryModal.jsx`)
- Cliente REST JWT → Endpoints y reglas: envía HTTP (evidence: `README.md`)
- Endpoints y reglas → Contexto EF: consulta y guarda (evidence: `backend/WarehouseAPI/Program.cs`)
- Endpoints y reglas → Usuario: gestiona usuarios (evidence: `backend/WarehouseAPI/Program.cs`)
- Endpoints y reglas → Producto e inventario: gestiona productos (evidence: `backend/WarehouseAPI/Program.cs`)
- Endpoints y reglas → Proveedor: gestiona proveedores (evidence: `backend/WarehouseAPI/Program.cs`)
- Endpoints y reglas → Orden y partidas: crea órdenes (evidence: `backend/WarehouseAPI/Program.cs`)
- Contexto EF → PostgreSQL: persiste datos (evidence: `README.md`)
- Endpoints y reglas → PostgreSQL: transacciona entradas y salidas (evidence: `README.md`)
