Skip to main content

Dashboard & KPIs

The main dashboard provides a real-time snapshot of your fleet’s financial health, trip performance, and revenue composition. All metrics update based on the selected date range.

KPI Categories

The dashboard organizes metrics into four groups: Financial, Trip, Fleet, and Revenue Streams.

Financial KPIs

Trip KPIs

Fleet KPIs

Fleet utilization is calculated per-vehicle from first trip date to today, then aggregated. See Utilization Calculation for details.

Revenue Streams

Each completed trip’s earnings are decomposed into these streams: Zero-value streams are automatically hidden from the chart. The dashboard includes a monthly chart showing earnings, projected earnings (from upcoming bookings), expenses, and profit over time. Upcoming and in-progress trips appear as projected values for their end-date month.

Architecture

All KPI calculations are pure functions with no side effects, located in src/lib/kpi/calculations.ts. Data fetching is separated in src/lib/kpi/queries.ts. The useKPIs hook in src/hooks/useKPIs.ts orchestrates fetching and calculation.
The main entry point is calculateDashboardKPIs(), which calls each sub-calculator and returns a single DashboardKPIs object containing all metric groups, monthly data, and recent trips.