Overview
Tractor Management (/fleet/tractors) provides comprehensive tracking and management for the tractor fleet including real-time location, telematics data, and driver assignments.
Key Features
- Tractor Table - Searchable list with status, fuel level, location, and driver info
- Detail Panel - Comprehensive tractor information with tabs for specs, telematics, maintenance
- Interactive Map - Real-time tractor locations with filtering by dispatcher
- Tractor-Vehicle Mapping - Links McLeod tractor IDs to Terminal vehicle data
- Telematics Data - Fuel levels, engine hours, speed, heading
API Endpoints
REST Endpoints
| Method | Endpoint | Description |
|---|---|---|
GET | /locations/current | Fetch all vehicle/tractor locations |
GET | /api/tractors/mapping-stats | Get tractor-vehicle mapping statistics |
POST | /tractors/sync-mapping | Sync tractor-vehicle mappings |
GET | /api/tractors/fault-codes?vehicle_id=... | Get fault codes for a vehicle |
GET | /api/movements?limit=500 | Fetch movements for tractor associations |
SSE Streams (Real-time)
| Endpoint | Event Type | Description |
|---|---|---|
/stream/locations | location_update | Real-time vehicle location updates |
All endpoints are prefixed with the Tracking Backend URL (
NEXT_PUBLIC_TRACKING_BACKEND_URL).Files
Pages
Pages
pages/fleet/tractors.tsx- Tractor management page
Components
Components
components/TractorManagement.tsx- Main tractor management componentcomponents/AddTractorModal.tsx- Add tractor modalcomponents/TractorMappingStats.tsx- Tractor-vehicle mapping statisticscomponents/LiveVehicleMap.tsx- Vehicle location mapcomponents/fleet/VehicleStatusBadge.tsx- Vehicle status badgecomponents/fleet/FuelLevelIndicator.tsx- Fuel level indicatorcomponents/fleet/HeadingIndicator.tsx- Vehicle heading indicator
Hooks
Hooks
components/hooks/useUnifiedFleetData.ts- Unified fleet datacomponents/hooks/useVehicleLocations.ts- Vehicle location datacomponents/hooks/useTractorMapping.ts- Tractor-vehicle mappingcomponents/hooks/useFleetUrlSync.ts- URL synchronization
Types
Types
types/vehicle-locations.ts- Vehicle location types
Full documentation with component details, props, and usage examples coming soon.

