Data Engineering · Full-stack
DriveAnalyticsLarge-Scale Traffic Safety & Geospatial Analytics Platform
Where crashes happen, when, and why, from the whole country down to a single road.
An end-to-end data engineering and geospatial analytics platform: ETL pipelines over 2.49 million historical crash records from NHTSA FARS and NYC Open Data, plus Chicago crash reports and six live incident feeds on 10-minute refresh cycles.
- Timeline
- Aug — Sep 2026
- Status
- Live
- Stack
- PythonSQLPostgreSQLFastAPIReactTypeScriptLeafletGeoJSONDockerpytestGitHub Actions

- 2.49M
- historical crash records
- 6
- live incident feeds
- 10 min
- live refresh cycle
- 281
- pytest tests
The problem
Why I built it
Public crash data exists, but it's scattered across federal files, city portals and live incident feeds, each with its own format, quirks and lag. NHTSA's national dataset is also published about 1.5 years late. There's no simple way to ask “which roads near me are deadliest, and why?”
It grew out of my Vehicle Telemetry Analytics prototype: the FastAPI/PostgreSQL backend, the YAML rule engine, the tests, CI and Docker setup carried over, and the synthetic data was replaced with real records.
How it works
From input to result
- 01
Extract
Source-specific ingestion for NHTSA FARS, NYC Open Data and Chicago crash reports, plus six live incident feeds (CHP, WSDOT, 511NJ, Austin, Seattle, San Francisco) polled every 10 minutes.
- 02
Clean
Source quirks are handled and documented: FARS's 77.7777 “unknown latitude” codes, NYC's 0/0 coordinates, cp1252-encoded files, the same road spelled several different ways.
- 03
Flag
A YAML rule engine attaches risk flags at load time: speeding, impaired driver, dark with no lighting, pedestrian injured.
- 04
Load
Batched loads into PostgreSQL. A FARS year is replaced in one transaction; NYC rows are upserted so amended records update in place.
- 05
Serve
FastAPI endpoints feed a React + Leaflet map with state → county → city → street drill-down.
- 06
Export
A static export writes everything the map needs as compact JSON, so the public site runs on GitHub Pages with no server.
Engineering
Decisions worth talking about
Idempotent, re-runnable loads
Every loader is safe to run twice. Year-level replace for FARS and keyed upserts for NYC mean a failed or repeated run never duplicates data, and `--since` re-pulls only what changed.
A rule engine that can't execute code
Risk rules live in readable YAML, but the engine only accepts whitelisted fields and operators. Analysts can add rules without anyone worrying about arbitrary code in config.
Tests that never touch the network
281 pytest tests build small source files in their real formats, including a cp1252-encoded FARS file, so CI checks parsing, encoding fallback, re-run safety and upserts without downloading anything.
Honest about what the data can't say
FARS only covers fatal crashes and neither dataset has traffic volume, so a busy interstate ranks high partly because it's busy. The UI says so instead of implying per-trip risk.
Screens
More of the product

Limits & next
What it can't do yet
- FARS covers only crashes where someone died, and city data is preliminary. Contributing factors are an officer's judgment at the scene.
- No dataset includes traffic volume, so rankings are totals, not per-trip risk.
- The static site is only as fresh as its last export, and a few portals' license terms still need confirming before wider sharing.