How project-osrm/osrm-backend works
Project type and purpose
• This is OSRM-backend, a high-performance C++ routing engine on OpenStreetMap data.
• It provides both batch preprocessing tools (extract, partition, customize) and a runtime HTTP server (osrm-routed), plus C++ and Node.js library interfaces.
File structure
• Top-level “src” and “include” house the C++ modules:
• src/extractor + include/extractor → OSM data parsing & graph building
• src/contractor, src/partitioner, src/customize → CH/MLD pipelines
• src/engine + include/engine → core routing, map-matching, guidance
• src/server + include/server → HTTP parsing, services (route, nearest, match, table, trip, tile)
• src/updater → timezone/GPS data updaters
• lib/binding* & src/nodejs → Node.js bindings
• “docker/” contains Dockerfiles packaging backend & frontend
• “profiles/” stores Lua profiles customizing routing behaviors
• “tests/”, “features/”, “unit_tests/” cover BDD, unit, fuzz tests
• “third_party/” has FlatBuffers, fmt, RapidJSON, libosmium, protozero, vtzero, etc.
README for additional insights
• Services: Nearest, Route, Table, Match, Trip, Tile – each backed by a plugin in engine/plugins
• Two preprocessing pipelines: Contraction Hierarchies (CH) vs Multi-Level Dijkstra (MLD)
• Three interfaces: HTTP API (osrm-routed), C++ libosrm, Node.js package
• Build system: CMake + optional Conan; Node.js via npm; Docker images provided.
Elements
• Clear labels per component (e.g., “osrm-extract”, “DataFacade”, “route_service”)
• Batch tools (grey rectangles)
• Server layer (green cloud)
• Library bindings (purple)
• External clients (yellow)
Be very detailed—capture all essential elements
• Storage formats (.osrm files, shared memory) explicitly
• Lua profiles as input to extract/customize
• CI/test layer off to the side (scripts/, features/, unit_tests/) to show coverage and validation