Skip to main content

Vehicle Fleet Management

The Vehicles page lets you manage your entire fleet. Vehicles can be added manually or imported from Turo data, and each vehicle has a detail page showing photos, status, and financial performance.

Adding Vehicles

When you import a Trip Earnings CSV, any new vehicle names that don’t match existing records are automatically created. The vehicle is linked to future trips by name matching.
Use the AddVehicleModal to enter vehicle details: year, make, model, VIN, license plate, and status. VIN decoding is supported to auto-fill make/model/year.

Vehicle Detail Page

Each vehicle has a dedicated page at /vehicles/[id] showing:
  • Photo gallery — Up to 15 photos managed via PhotoUploader
  • Vehicle info — Year, make, model, VIN, license plate, status
  • Financial summary — Earnings, expenses, profit, and margin for that vehicle
  • Trip history — All trips for the vehicle with the same filtering as the main bookings page
  • Documents — Associated documents (registration, insurance, etc.)

Photo Management

The PhotoUploader and VehiclePhotoSection components handle:
  • Upload up to 15 photos per vehicle
  • Drag-and-drop reordering
  • Set a primary photo (used as thumbnail across the app)
  • Delete individual photos
  • Photos are stored in Supabase Storage

Status Lifecycle

Vehicles follow this status progression:
active → inactive → sold → deleted (soft)
StatusMeaning
activeCurrently listed and available for rental
inactiveTemporarily unlisted (maintenance, seasonal, etc.)
soldVehicle has been sold, retained for historical reporting
deletedSoft-deleted with confirmation via DeleteVehicleDialog
Deleting a vehicle is a soft delete. The record is retained for historical trip and financial data integrity. Deleted vehicles are hidden from active views but still appear in reports.

Depreciation Tracking

The DepreciationWidget on the vehicle detail page shows estimated depreciation based on vehicle age and usage, helping hosts understand true cost of ownership.

Key Components

ComponentPurpose
AddVehicleModalForm for manually adding a vehicle
PhotoUploaderUpload and manage vehicle photos
VehiclePhotoSectionPhoto gallery display on detail page
DeleteVehicleDialogConfirmation dialog for soft delete
DepreciationWidgetDepreciation estimate display

Data Layer

Vehicle CRUD operations are in src/lib/db/index.ts. The useVehicles hook (src/hooks/useVehicles.ts) provides fetching, creation, update, and delete. Photo operations use src/hooks/useVehiclePhotos.ts backed by src/lib/db/storage.ts.