Architecture Overview

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

High-Level Architecture

Frontend (React) Leaflet Map · MUI Sidebar · i18n HTTP / JSON Actix-web Server CORS · Rate Limiting · Metrics Middleware /journeys /walk /bike /car /places /status /gtfs/* /metrics /tiles cache proxy RAPTOR Index ArcSwap · Lock-free BAN Index Addresses GTFS Data CSV files Valhalla Docker · Walk / Bike / Car

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 maneuvers=true is requested.

Navitia API Compatibility

The API mirrors Navitia query parameters and response structure, making Glove a potential drop-in replacement for Navitia-based applications.

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