The Leo Counter dashboard is the first screen you land on after logging in (Documentation Index
Fetch the complete documentation index at: https://mintlify.com/juanVillamilEchavarria/Leo_Counter-app/llms.txt
Use this file to discover all available pages before exploring further.
/home). It gives you an at-a-glance picture of your household finances by pulling the last 30 days of movement data and assembling it into KPI cards and a trend chart — all without any manual configuration. When no movements have been recorded yet, the dashboard renders an empty-state prompt that guides you to create your first transaction.
How the Dashboard Works
The dashboard uses a React front-end rendered via Inertia.js. On page load, theuseHome hook calls GET /api/home (served by HomeApiController), which delegates to GenerateHomeReportHandler. That handler constructs a GenerateFinancialReportQuery spanning the previous month to today and runs two statistics: KPIS and INGRESOS_VS_GASTOS.
HomeStatisticsType::statistics() are:
KPI Cards
TheKPIAssembler transforms raw query results into a PeriodKPIDTO that contains two nested objects:
TotalsKPIDTO
Current-period absolute values:
- ingresos — total income (float)
- gastos — total expenses (float)
- balance_neto — net balance (float)
- movimientos — total movement count (int)
VariationsKPIDTO
Percentage change vs. the prior equivalent period:
- ingresos — income variation (nullable float)
- gastos — expense variation (nullable float)
- balance_neto — net balance variation (nullable float)
- movimientos — movement count variation (nullable float)
null when there is no previous period to compare against (e.g. the very first month of data).
Income vs. Expense Trend Chart
Below the KPI cards the dashboard renders anIngresoAndGastoLineChart component. This chart is driven by the tendencia.ingresos_vs_gastos data field, which comes from IngresosVsGastosAssembler. It plots income and expense totals over time, letting you spot seasonal patterns and sudden spikes at a glance.
Real-Time Updates via Laravel Reverb
Leo Counter integrates Laravel Reverb (WebSockets) so that the dashboard reflects financial changes in real time. Whenever a movement is created, updated, or deleted, the back-end broadcasts an event over a private channel. The React front-end subscribes to that channel through theuseHome hook, triggering an automatic data refresh without a full page reload.
Real-time updates require the Reverb server and the Laravel queue worker to be running. In the Docker Compose development setup both services are started automatically.
Empty State
Whendata?.data is null — meaning no movements have been recorded yet — the dashboard renders an EmptyDataMessage component instead of the KPI and chart sections.
Dashboard at a Glance
Data loads
The
useHome hook fetches the last-30-days report. Loading and error states are handled with <Loading> and <ErrorResponse> components respectively.KPIs render
Four KPI cards display total income, total expenses, net balance, and movement count — each with a percentage change badge compared to the prior period.