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
UseDocumentUploadDialog 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:
Over 40 specific document types are available across these categories.
Document Health Score
TheFleetHealthBar component calculates a health score as a percentage:
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
Data Layer
Documents are stored in thedocuments 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.