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
US map shaded by traffic deaths per state, 2020 to 2024
National view: states shaded by traffic deaths, 2020–2024.
2.49M
historical crash records
6
live incident feeds
10 min
live refresh cycle
281
pytest tests

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.

From input to result

  1. 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.

  2. 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.

  3. 03

    Flag

    A YAML rule engine attaches risk flags at load time: speeding, impaired driver, dark with no lighting, pedestrian injured.

  4. 04

    Load

    Batched loads into PostgreSQL. A FARS year is replaced in one transaction; NYC rows are upserted so amended records update in place.

  5. 05

    Serve

    FastAPI endpoints feed a React + Leaflet map with state → county → city → street drill-down.

  6. 06

    Export

    A static export writes everything the map needs as compact JSON, so the public site runs on GitHub Pages with no server.

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.

More of the product

Wayne County, Michigan, with fatal crashes on I-94 highlighted
Drill-down: Wayne County, MI, with fatal crashes on I-94 highlighted.

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.

Hiring for a data or AI internship? Let's talk.

The fastest way to reach me is a message on LinkedIn. All my code is on GitHub.