Full-stack · Python · FastAPI · JavaScript · SQLite · Render

Event Travel Intelligence (Python, FastAPI and Leaflet)

A full-stack decision-support tool for journeys to major UK events. A user enters a starting location and picks an event, and the system returns the normal driving route, an event-adjusted journey estimate, crowd risk, configured disruptions, Park & Ride access times and return-journey timing, while keeping modelled estimates clearly separate from measured live data.

BackendPython · FastAPI · SQLite (Redis optional), hosted on Render
FrontendHTML · CSS · JavaScript · Leaflet, hosted on GitHub Pages
Data servicesNominatim geocoding · OSRM routing · OpenStreetMap tiles
TestsTest modules in tests/ for API, events, journey, live transport, parking and platform
Event Travel Intelligence home screen showing the selected event, venue, date, capacity, traffic-management window and an event search box
Event selection screen of the live application, captured on 11 November 2026.

Problem

Large events create travel conditions that ordinary route planners do not model well: traffic-management windows, extra delay near the venue, crowd pressure, road restrictions and uncertain Park & Ride access. People travelling from different UK towns need one place to see the normal route, how the event changes it, and whether any live data is actually available.

Architecture

User
  ↓
GitHub Pages frontend (HTML/CSS/JS + Leaflet)
  ↓
FastAPI API on Render
  ↓
JSON event catalogue + SQLite operational store
  ↓
Geocoding / routing / optional transport and parking providers
  ↓
Journey intelligence engine
  ↓
Analysis response
Main backend modules
LayerLocation
Event schemabackend/event_model.py
Event storebackend/event_store.py
Travel enginebackend/travel_engine.py
Live transportbackend/live_transport.py
Parkingbackend/parking_intelligence.py
Cache / SQLitebackend/cache.py, backend/db.py
APIbackend/main.py
Event Travel Intelligence journey summary for a trip from Hull to Old Trafford: 106.1 miles, 123 minutes outbound, return estimate 244 minutes arriving 00:34 the next day
Journey summary returned by the live application for a Hull start on 11 November 2026. Live traffic was reported as unavailable, so these are event-adjusted estimates.

Key technical decisions

  • Events are data, not code. A versioned JSON catalogue (data/events/*.json) is the source of truth, so adding an event means adding data rather than rewriting the engine.
  • Modelled vs measured is never blurred. The estimate is round(normal_OSRM_minutes × event_factor + extra_event_delay); live traffic minutes are added only when a real feed returns them. Without a key, live traffic shows as “Unavailable”.
  • No invented occupancy. Park & Ride shows drive, transfer and total access time; occupancy appears only from an official feed, otherwise “Unknown / No live occupancy feed”.
  • Graceful degradation. If the API is unavailable, the static frontend can load local catalogue files and still compute an event-adjusted route with Nominatim and OSRM.
  • Operational hygiene. Memory + SQLite cache, Nominatim 429 retry, per-IP rate limiting, structured JSON request logs, and health/readiness endpoints. Cached live data older than 15 minutes is treated as stale.

Data and external services

What each source provides on the public deployment
ServiceUseLive measured data?
NominatimUK-biased geocodingNo, locations only
OSRMNormal driving route, duration, geometryNo, routing estimate
Leaflet / OpenStreetMapMap displayNo
National Highways closures APIStructured closuresOnly with an API key
TfGM alerts / car parks APIsAlerts and occupancyOnly with an API key
TomTom routingMeasured delay vs no-traffic routeOnly with an API key

Limits

  • This is a rules- and model-based decision engine, not a machine-learning model.
  • On the public deployment no live traffic or parking-occupancy keys are configured, so those layers report “Unavailable” or “Unknown” rather than estimates.
  • The fictional test-event-manchester record exists only to prove the engine reads configuration dynamically; it is not a real event.

What this project demonstrates

  • API development: a FastAPI service with health and readiness endpoints, rate limiting and structured logs, deployed on Render.
  • Data-driven design: a versioned JSON event catalogue with SQLite as the operational store and cache.
  • Integration with external services: Nominatim, OSRM and optional keyed providers, with graceful fallback.
  • Honest product behaviour: modelled estimates are never presented as measured live data.
  • Testing: automated test modules covering the API, events, journeys, transport and parking.

Written by Emmanuel Abolade, Data Analyst, Business Intelligence Developer and Full-Stack Software Developer based in Hull, UK. Every figure on this page comes from the linked public repository or live demo.