Architecture Overview

Glove is a monorepo with a Rust backend and React frontend.

High-Level Architecture

Portal · React + MUI + Leaflet Vite dev / nginx · proxies /api → :8080 REST / OpenAPI clients /api-docs/openapi.json HTTP · JSON · /api/* Actix-web Server · :8080 CORS · rate limiting · metrics middleware /journeys/* public_transport · walk · bike · car /places autocomplete · stops + BAN /tiles cached map proxy /status health · map defaults /gtfs/* status · validate · reload /metrics Prometheus RAPTOR Index ArcSwap · lock-free hot-reload · ~10k patterns BAN Index address geocoding GTFS data — CSV, in-memory (no DB) stops · trips · stop_times · transfers · pathways Tile cache data/tiles/ on disk routing + indoor transfers Valhalla · Docker · :8002 walk · bike · car · indoor transfer enrichment

Design Principles

All In-Memory

There is no database. All GTFS data is loaded from CSV files at startup and held in memory. This gives extremely fast query times at the cost of startup time (10-30 seconds for index building).

Lock-Free Hot-Reload

The RAPTOR index is wrapped in ArcSwap, which allows atomic pointer swaps. When new GTFS data is loaded via POST /api/gtfs/reload, the entire index is rebuilt in a background thread and swapped in atomically. No request is ever blocked or sees partial data.

Pattern Grouping

Trips with identical stop sequences are grouped into patterns. This dramatically reduces memory usage and speeds up the RAPTOR scan phase, because the algorithm only needs to evaluate one entry per pattern instead of one per trip.

Indoor Routing

Valhalla supports indoor maneuvers such as elevators, stairs, escalators, and building enter/exit transitions. Transfers are classified by parent_station: outdoor transfers (different parent_station) always get a Valhalla walking route for the map polyline, while indoor transfers (same parent_station) are only enriched when indoor maneuvers exist in OSM. Transfer polylines use the Valhalla shape (actual walking route) when available, falling back to a straight line otherwise. This enrichment only runs when routing.maneuvers is enabled in config.yaml.

Technology Stack

ComponentTechnology
BackendRust, Actix-web 4
RoutingRAPTOR algorithm (custom implementation)
Walk/Bike/CarValhalla (Docker, with indoor routing support)
FrontendReact 19, Vite, MUI 7, Leaflet
Data formatGTFS (General Transit Feed Specification)
Address searchBAN (Base Adresse Nationale)
Serializationserde (JSON + YAML + CSV)
API docsutoipa (OpenAPI auto-generation)
MonitoringCustom Prometheus metrics
Loggingtracing + tracing-subscriber