Skip to main content
Documentation In ProgressThis section is currently being developed.

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

MethodEndpointDescription
GET/locations/currentFetch all vehicle/tractor locations
GET/api/tractors/mapping-statsGet tractor-vehicle mapping statistics
POST/tractors/sync-mappingSync tractor-vehicle mappings
GET/api/tractors/fault-codes?vehicle_id=...Get fault codes for a vehicle
GET/api/movements?limit=500Fetch movements for tractor associations

SSE Streams (Real-time)

EndpointEvent TypeDescription
/stream/locationslocation_updateReal-time vehicle location updates
All endpoints are prefixed with the Tracking Backend URL (NEXT_PUBLIC_TRACKING_BACKEND_URL).

Files

  • pages/fleet/tractors.tsx - Tractor management page
  • components/TractorManagement.tsx - Main tractor management component
  • components/AddTractorModal.tsx - Add tractor modal
  • components/TractorMappingStats.tsx - Tractor-vehicle mapping statistics
  • components/LiveVehicleMap.tsx - Vehicle location map
  • components/fleet/VehicleStatusBadge.tsx - Vehicle status badge
  • components/fleet/FuelLevelIndicator.tsx - Fuel level indicator
  • components/fleet/HeadingIndicator.tsx - Vehicle heading indicator
  • components/hooks/useUnifiedFleetData.ts - Unified fleet data
  • components/hooks/useVehicleLocations.ts - Vehicle location data
  • components/hooks/useTractorMapping.ts - Tractor-vehicle mapping
  • components/hooks/useFleetUrlSync.ts - URL synchronization
  • types/vehicle-locations.ts - Vehicle location types

Full documentation with component details, props, and usage examples coming soon.