The Dashboard is the home screen of Corpointa, available at theDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/EricMartinez758/corpointa-frontend/llms.txt
Use this file to discover all available pages before exploring further.
/ route. It loads live data from the API on every visit and gives warehouse staff an instant pulse of the entire inventory — how many materials are registered, how much stock is on hand, which items have fallen below their minimum threshold, and how many movements have occurred this month. Two tabs let users switch between a high-level Descripción General view and a deeper Analíticas breakdown.
KPI Cards
Four summary cards are displayed in a responsive grid at the top of the Overview tab. Each card callsgetDashboardStats() on mount and shows a loading placeholder (...) while the request is in flight.
Materiales
Displays
totalMateriales — the total count of distinct material records registered in the system catalog.Unidades en Stock
Displays
totalExistencias — the sum of cantidad_actual across all stock records, representing total units currently held in inventory.Stock Bajo
Displays
stockBajo — the count of materials whose cantidad_actual is below their configured stock_minimo. Rendered in destructive red with an AlertTriangle icon to draw immediate attention.Movimientos del Mes
Displays
entradasMes + salidasMes as the headline figure. The subtitle line breaks this down as N entradas / N salidas for the current calendar month.Overview Tab
The Descripción General tab (default) shows two panels side by side below the KPI cards.Movimientos Mensuales — Pie Chart
The left panel renders a donutPieChart (via Recharts) that visualises the total entries versus exits across all months returned by the API. The chart aggregates movimientosMensuales into two segments:
| Segment | Color | Source field |
|---|---|---|
| Entradas | #2d9202 (green) | Sum of entradas across all months |
| Salidas | #FC0800 (red) | Sum of salidas across all months |
ResponsiveContainer.
Últimas Salidas — Recent Dispatches
The right panel lists the most recent dispatch records returned inultimasSalidas. Each row shows:
| Field | Display |
|---|---|
numero_salida | Dispatch reference number (bold heading) |
recibe_nombre | Recipient name, or Sin asignar if empty |
fecha | Formatted as dd/MM/yyyy using date-fns |
total_materiales | Count of material lines, shown as N mat. |
FileText icon and the message “No hay salidas registradas” are shown instead.
Analytics Tab
Selecting the Analíticas tab renders the<Analytics> component, which receives the full DashboardStats object and the loading boolean. It provides a more granular breakdown of the same data across two panels.
Summary Cards (top grid)
| Card | Icon | Value |
|---|---|---|
| Total Materiales | Package | totalMateriales |
| Entradas del Mes | ArrowDownToLine | entradasMes |
| Salidas del Mes | ArrowUpFromLine | salidasMes |
| Stock Bajo | Package | stockBajo |
SimpleBarList) renders one bar per entry in stockPorCategoria. Each bar width is proportional to the category’s share of the maximum category stock value. Values are formatted as N uds.. Skeleton loaders are shown while data is fetching.
Resumen de Existencias (right panel)
A compact key-value list displaying all five core metrics at a glance:
| Label | Value style |
|---|---|
| Total materiales | Default |
| Unidades en stock | Default |
| Stock bajo mínimo | text-destructive (red) |
| Entradas del mes | text-green-600 |
| Salidas del mes | text-red-600 |
API: Dashboard Stats
All dashboard data is fetched in a single call togetDashboardStats().
Endpoint
DashboardStats Interface
Example Response
The dashboard fetches data once on mount. Reload the page or navigate away and back to refresh the stats. There is no auto-polling interval.