All Projects
Full StackShipped

ELD Trip Planner

HOS-Compliant Truck Trip Planning & ELD Logs

React 18ViteLeafletDjango 5Django REST FrameworkOpenRouteService APIPostgreSQL

Overview

A full-stack web app that helps truck drivers plan trips in compliance with FMCSA Hours of Service (HOS) regulations. Enter current location, pickup, and dropoff — get a complete route map, day-by-day schedule, and ELD daily log sheets automatically generated.

8

HOS Rules Implemented (rules)

Unlimited

Route Distance Supported (miles)

The Problem

Truck drivers must comply with complex FMCSA HOS rules (11hr driving, 14hr window, 10hr rest, 30min break after 8hrs, 70hr/8day cycle, 34hr restart). Manual planning is error-prone and existing tools are either too simple or too expensive.

What I Built

A React + Vite frontend with Leaflet maps and a Django REST backend. The HOS engine simulates trips mile-by-mile at 55mph, automatically inserting rest breaks, fuel stops, and 34-hour restarts while splitting all segments across midnight boundaries so every calendar day equals exactly 24 hours. ELD logs are rendered as canvas 24-hour grids matching FMCSA paper format.

Architecture

Frontend (Vercel) calls /api/plan-trip/ on the Django backend (Render). Backend geocodes locations via OpenRouteService, fetches route geometry, runs the HOS simulation engine, and returns a complete schedule with day-by-day segments and ELD log data. Frontend renders interactive map with polylines, day cards, and canvas ELD log sheets.

Technical Decisions

  • Simulated trip mile-by-mile at 55mph average speed for precise HOS compliance.
  • Split all rest segments across midnight boundaries so every log day is exactly 24 hours.
  • Used OpenRouteService for both geocoding and routing to avoid multiple API dependencies.
  • Canvas rendering for ELD logs to match real FMCSA paper log format precisely.
  • 34-hour restart automatically triggered and split correctly when 70hr/8day cycle is exhausted.

HOS rule complexity

Interlocking rules (11/14/10/8/30/70/34) with midnight boundary splits required a careful state machine that processes mile-by-mile.

Midnight boundary splitting

Every calendar day must equal exactly 24 hours in ELD logs. Rest periods spanning midnight had to be split into two segments with correct day assignment.

Canvas ELD log rendering

Drawing the 24-hour grid with proper scaling, labels, and status segments (off-duty, sleeper, driving, on-duty) to match FMCSA format.

My Contribution

  • Designed and built the full-stack application.
  • Implemented the HOS simulation engine with all FMCSA rules.
  • Built the React frontend with Leaflet maps, autocomplete, and canvas ELD logs.
  • Deployed backend to Render and frontend to Vercel with CI/CD.

Have a similar project in mind?

Let’s discuss how we can build something great together.