33Trip planner for property-carrying truck drivers that auto-generates
44FMCSA-compliant ELD daily logs and route maps from a single trip input.
55
6- ** Live Demo:** https://spotter-eld-gamma.vercel.app
6+ ** Live Demo:** https://spotter-eld-gamma.vercel.app
7+ ** Backend:** https://spotter-eld-production.up.railway.app
78
89## What It Does
910
1011Enter four fields — current location, pickup, dropoff, and cycle hours
1112used — and get back a fully planned, legally-compliant trip schedule with:
1213
13- - Interactive route map with mandatory stop markers
14- - Day-by-day timeline view with color-coded duty status
14+ - Interactive route map with click-to-set location pins
15+ - Day-by-day timeline with color-coded duty status bars
16+ - DOT 11h check per day showing driving since last 10h reset
17+ - Cross-day continuous rest pills (10h reset ✓ and 34h restart ✓)
1518- FMCSA Driver's Daily Log sheets (faithful paper form replica)
16- - Automatic HOS rule enforcement (11h limit, 14h window, 30-min break,
17- 70-hour cycle, 34-hour restart)
19+ - Hours displayed in hours and minutes (not decimal) for DOT readability
20+ - Automatic HOS rule enforcement:
21+ - 11-hour driving limit per duty window
22+ - 14-hour on-duty window
23+ - 30-minute mandatory break after 8 cumulative driving hours
24+ - 10-hour consecutive rest requirement
25+ - 70-hour/8-day cycle limit
26+ - 34-hour cycle restart
1827
1928## Stack
2029
2130- ** Backend:** Django 5 + Django REST Framework → Railway
2231- ** Frontend:** React 18 + Vite + TypeScript + Tailwind CSS → Vercel
2332- ** Maps:** Leaflet + OpenRouteService
24- - ** Testing:** pytest (26 tests, all passing)
33+ - ** Testing:** pytest (37 tests, all passing)
2534
2635## Architecture
2736
2837The HOS simulator (` backend/simulator/ ` ) is pure Python with zero Django
2938dependency. It takes a ` TripInput ` and returns a ` TripPlanResult ` —
3039Django is a thin REST wrapper around it.
3140
41+ The frontend compliance display (` TimelineView ` ) walks all events as one
42+ continuous timestamp stream using real ISO timestamps, never resetting
43+ the driving accumulator at calendar midnight. Rest runs are detected by
44+ exact timestamp contiguity so cross-midnight rest periods are correctly
45+ merged before the 10h threshold check.
46+
3247See ` docs/ ` for full specifications:
48+
3349- ` BRIEF.md ` — product vision
3450- ` HOS_RULES.md ` — FMCSA rules enforced
3551- ` ALGORITHM.md ` — simulation decisions and edge cases
3652
3753## Running Locally
3854
3955** Backend:**
56+
4057``` bash
4158cd backend
4259pip install -r requirements.txt
@@ -46,6 +63,7 @@ python manage.py runserver
4663```
4764
4865** Frontend:**
66+
4967``` bash
5068cd frontend
5169npm install
@@ -54,19 +72,35 @@ npm run dev
5472```
5573
5674** Tests:**
75+
5776``` bash
5877cd backend
5978pytest simulator/tests/ -v
6079```
6180
81+ ## Test Scenarios
82+
83+ The test suite covers eight explicit FMCSA compliance scenarios:
84+
85+ | # | Route | Cycle h | Rule exercised |
86+ | ---| -------| ---------| ----------------|
87+ | 1 | Chicago → St. Louis → Memphis | 0 | 11h driving limit, single window |
88+ | 2 | Chicago → Indianapolis → Nashville | 0 | 30-min break after 8h driving |
89+ | 3 | Dallas → Oklahoma City → Kansas City | 60 | Cross-midnight 10h rest detection |
90+ | 4 | Los Angeles → Las Vegas → Salt Lake City | 0 | 14h window before 11h driving |
91+ | 5 | Chicago → Denver → Los Angeles | 65 | 70h cycle exhaustion masks 11h limit |
92+ | 6 | Chicago → Dallas → Los Angeles | 68 | 34h restart scheduled and credited |
93+ | 7 | Atlanta → Birmingham → Nashville | 0 | Two legal windows on same calendar day |
94+ | 8 | New York → Chicago → Los Angeles | 0 | Full stress test, all rules fire |
95+
6296## Known Limitations
6397
6498- Sleeper berth 7+3 split not implemented (full 10h reset only)
6599- Cycle hours use flat balance (no rolling 8-day window falloff)
66100- Map stop positions use linear interpolation (not real highway routing)
67101- Home terminal timezone hardcoded to America/Chicago
68102
69- ## Assessment Notes
103+ ## About
70104
71- Built for Spotter AI Full Stack Developer assessment.
105+ Built for Spotter AI Full Stack Developer assessment.
72106Time spent: ~ 16 hours over 2 days.
0 commit comments