DriverLog Pro is a specialized logistics application designed to automate trip planning and Hours of Service (HOS) compliance for truck drivers. It calculates safe, legal driving schedules based on FMCSA regulations (including the 70-hour/8-day rule) and generates fully compliant, printable daily log sheets.
- Smart Trip Scheduling: Automatically inserts mandatory breaks (30-min), sleeper berth splits (10-hr), and cycle restarts (34-hr) into the itinerary.
- FMCSA Compliance Engine: Enforces strict adherence to US Department of Transportation rules, preventing violations before they happen.
- Interactive Route Map: Visualizes the route with dynamic markers for Start, Pickup, and Dropoff locations using real-world routing geometry.
- Automated Log Generation: Produces a standardized, government-compliant PDF logbook (multi-page) populated with:
- 24-hour Grid Graph.
- Calculated Duty Totals (Off/Sleeper/Driving/On).
- Auto-filled Remarks (Location, Activity, State).
- Header Details (Carrier, Mileage, Dates).
- PDF Export: One-click download of the complete trip logbook.
- Backend: Python 3, Django, Django REST Framework.
- Frontend: React 19, Vite, Leaflet (Maps).
- Compliance Logic: Custom Python engine implementing FMCSA Part 395 regulations.
- PDF Engine:
Pillow(PIL) for high-fidelity grid rendering andReportLab/PyPDFlogic for document assembly. - Routing: Integration with OSRM (Open Source Routing Machine) and Nominatim (Geocoding).
- Python 3.10+
- Node.js & npm
The backend manages the compliance logic and API.
-
Activate Virtual Environment:
.\venv\Scripts\Activate
(Or just run using the venv python directly:
.\venv\Scripts\python) -
Install Dependencies (if needed):
pip install -r requirements.txt -
Run the Server:
python backend\manage.py runserver
Server will start at:
http://127.0.0.1:8000/
The frontend provides the interactive planner interface.
-
Navigate to Frontend Directory:
cd frontend
-
Install Dependencies:
npm install
-
Start Development Server:
npm run dev
App will be accessible at:
http://localhost:5173/
- Enter Trip Details: Input your "Start Location", "Pickup", and "Dropoff" cities (e.g., "Chicago, IL" to "Miami, FL").
- Set Current Status: Input your "Cycle Used" hours to test compliance logic (e.g., enter
65to force a cycle restart). - Generate Plan: Click the button to calculate the legal itinerary.
- View Results:
- Itinerary: Step-by-step compliant schedule.
- Map: Visual route with markers.
- Logs: Preview of the generated daily logs.
- Export: Click "Download Full Logs (PDF)" to save the official record.
The project includes an automated test suite to verify HOS rules:
.\venv\Scripts\python test_api.py(Confirms API connectivity, PDF generation, and itinerary logic)
Educational / Assessment Project. Uses OpenStreetMap data under ODbL.