Skip to main content

Document Management

The Documents page provides centralized storage for all fleet-related paperwork. Track registrations, insurance policies, inspections, and 40+ other document types with expiry alerts and health scoring.

Uploading Documents

Use DocumentUploadDialog to upload a document with:
  • File — PDF, image, or other document file (stored in Supabase Storage)
  • Document type — Selected from 40+ predefined types
  • Vehicle — Associate with a specific vehicle (optional)
  • Expiry date — When the document expires (optional but recommended)
  • Notes — Free-text description

Document Types

Documents are organized into categories:
CategoryExample Types
RegistrationVehicle registration, title, temporary plates
InsuranceLiability policy, comprehensive, gap insurance
InspectionState inspection, emissions test, safety check
MaintenanceService records, repair receipts, warranty docs
LegalLease agreement, lien release, power of attorney
Tax1099 forms, depreciation schedules, business license
RentalTuro listing agreement, guest damage claims
OtherMiscellaneous documentation
Over 40 specific document types are available across these categories.

Document Health Score

The FleetHealthBar component calculates a health score as a percentage:
Health Score = (Current Required Documents / Total Required Documents) * 100
A document is considered “current” if it exists and has not expired. Required document types (registration, insurance, inspection) are checked per vehicle.
Documents approaching their expiry date trigger alerts in the notification center. Keep your fleet health score high by uploading renewals before expiry.

Expiry Tracking

Each document can have an expiry date. The system provides:
  • Visual indicators — Color-coded badges showing valid, expiring soon, or expired status
  • Notification alerts — Upcoming expirations appear in the notification center
  • Health impact — Expired documents lower the fleet health score

Document Cards

DocumentCard displays each document with:
  • Document type icon and label
  • Associated vehicle name
  • Upload date and expiry date
  • Quick actions: download, view, delete
  • Expiry status badge (valid / expiring / expired)

Key Components

ComponentPurpose
DocumentUploadDialogUpload form with type selection and expiry
FleetHealthBarFleet-wide document health percentage
DocumentCardIndividual document display with actions

Data Layer

Documents are stored in the documents table with files in Supabase Storage. Operations are in src/lib/db/documents.ts. The useDocuments hook (src/hooks/useDocuments.ts) handles fetching and CRUD.