/vehicle-stats/[alias]) gives you a complete financial and operational picture of a single vehicle. It aggregates data from routes, refuels, maintenance records, and expenses into one dashboard.
Metrics overview
Activity counts
Total number of routes, refuels, maintenance records, and expense entries logged for the vehicle.
Cost breakdown
Fuel costs, maintenance costs, other expenses, total cost, and cost per kilometer.
Efficiency metrics
Kilometers per liter, kilometers per gallon, and average distance per route.
Total cost of ownership
The cumulative amount spent on the vehicle since its first recorded entry.
Activity counts
The statistics page shows four activity counters pulled fromVehicleStats.statistics:
| Metric | Field | Description |
|---|---|---|
| Total routes | totalRoutes | Number of trip records logged |
| Total refuels | totalRefuels | Number of fuel refill records |
| Total maintenance | totalMaintenances | Number of maintenance service records |
| Total expenses | totalExpenses | Number of expense entries |
| Total distance | totalDistancia | Sum of all route distances in kilometers |
Cost breakdown
Costs are categorized into three buckets, each with a distinct color to help you scan the dashboard quickly.| Category | Field | Color |
|---|---|---|
| Fuel costs | combustible | Blue (info) |
| Maintenance costs | mantenimiento | Amber (warning) |
| Other expenses | gastosOtros | Purple |
| Total cost | total | Amber (warning) |
costoPorKm) divides the total cost by the total distance traveled, giving you a single number that represents the true running cost of the vehicle.
Efficiency metrics
Fuel efficiency metrics are calculated from refuel records and route data:| Metric | Field | Description |
|---|---|---|
| km per liter | kmPorLitro | Distance traveled per liter of fuel consumed |
| km per gallon | kmPorGalon | Distance traveled per gallon of fuel consumed |
| Average distance per route | promedioDistanciaPorRuta | Mean trip length across all logged routes |
VehicleStats.efficiency object returned by GET /api/vehicles/[alias]/stats.
Total cost of ownership
The total cost of ownership (totalCostOfOwnership on EnhancedVehicleStats) sums every recorded cost — fuel, maintenance, and other expenses — from the vehicle’s first entry to the present. Use this figure to compare vehicles in your fleet or evaluate whether it is more economical to replace a vehicle.
The total distance traveled (totalDistance) is the cumulative kilometers logged across all routes.
StatCard color coding
The statistics dashboard uses color-coded stat cards to help you identify cost categories at a glance:| Color | Accent | Used for |
|---|---|---|
| Blue | info | Fuel costs (combustible) |
| Amber | warning | Maintenance costs, total cost |
| Purple | purple | Other expenses (gastosOtros) |
| Green | success | Active status indicators |
globals.css (--color-cat-fuel, --color-cat-maintenance, --color-cat-expenses) and is consistent across all pages in KilomeTracker.
TypeScript interfaces
The stats page is powered by two interfaces fromsrc/Types.ts:
GET /api/vehicles/[alias]/stats.
Related pages
Managing vehicles
Add, edit, and deactivate vehicles in your fleet.
Tracking fuel
Log refuels to keep efficiency metrics accurate.
Tracking maintenance
Record service events that contribute to maintenance costs.
Expenses
Track insurance, taxes, and other costs included in total cost of ownership.