# motis-project/motis architecture

> Architecture diagram of the GitHub repository motis-project/motis, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/motis-project/motis
- Repository: https://github.com/motis-project/motis

## Overview

MOTIS is a multimodal transport-routing platform with a C++ service and a Svelte web interface. Its documented operational path is configuration from OSM and timetable inputs, preprocessing into runtime data, then serving HTTP requests. The principal journey path resolves places and combines transit routing with street and shared-mobility routing; geocoding, map tiles, real-time updates, flexible transit, and elevator data are additional capabilities. The README documents product features and command flow; source excerpts show routing interfaces, loaded data, and server startup, but not all endpoint registrations or import internals.

Main entry points: [`src/endpoints/routing.cc`](https://github.com/motis-project/motis/blob/master/src/endpoints/routing.cc) (Journey endpoint), [`src/server.cc`](https://github.com/motis-project/motis/blob/master/src/server.cc) (HTTP server), [`include/motis/data.h`](https://github.com/motis-project/motis/blob/master/include/motis/data.h) (Loaded data), [`include/motis/config.h`](https://github.com/motis-project/motis/blob/master/include/motis/config.h) (Configuration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_operations["Data and service"]
  node_config["Configuration<br/>[config.h]"]
  node_import["Data import<br/>[import.cc]"]
  node_runtime_data["Loaded data<br/>[data.h]"]
  node_server["HTTP server<br/>[server.cc]"]
end

subgraph group_routing["Journey routing"]
  node_places["Place resolution<br/>[place.cc]"]
  node_transit["Transit routing<br/>[routing.h]"]
  node_street["Street routing<br/>[street_routing.cc]"]
  node_match_platforms["Platform matching<br/>[match_platforms.h]"]
end

subgraph group_mobility["Mobility extensions"]
  node_flex["Flexible transit<br/>[flex.cc]"]
  node_gbfs["Shared mobility<br/>[routing_data.cc]"]
  node_realtime["Real-time updates<br/>[rt_update.cc]"]
  node_elevators["Elevator data"]
end

subgraph group_experience["API and map"]
  node_routing_endpoint["Journey endpoint<br/>[routing.cc]"]
  node_geocoding["Geocoding<br/>[geocode.cc]"]
  node_tiles["Map tiles<br/>[tiles.cc]"]
  node_web_ui["Web interface<br/>[+page.svelte]"]
end

node_operator(("Operator"))
node_input_feeds["OSM and feeds"]
node_api_client(("API client"))

node_operator -->|"configures"| node_config
node_input_feeds -->|"supplies files"| node_config
node_config -->|"prepares import"| node_import
node_input_feeds -->|"preprocessed"| node_import
node_operator -->|"starts service"| node_server
node_server -->|"loads data"| node_runtime_data
node_api_client -.->|"sends requests"| node_server
node_server -.->|"routes requests"| node_routing_endpoint
node_routing_endpoint -->|"resolves places"| node_places
node_routing_endpoint -->|"plans journeys"| node_transit
node_routing_endpoint -->|"routes streets"| node_street
node_routing_endpoint -->|"uses flex"| node_flex
node_routing_endpoint -->|"uses rentals"| node_gbfs
node_routing_endpoint -->|"uses matches"| node_match_platforms
node_runtime_data -->|"holds updates"| node_realtime
node_runtime_data -->|"holds elevator state"| node_elevators
node_api_client -.->|"geocodes places"| node_geocoding
node_api_client -.->|"requests tiles"| node_tiles
node_web_ui -.->|"uses API"| node_api_client

click node_config "https://github.com/motis-project/motis/blob/master/include/motis/config.h"
click node_import "https://github.com/motis-project/motis/blob/master/src/import.cc"
click node_runtime_data "https://github.com/motis-project/motis/blob/master/include/motis/data.h"
click node_server "https://github.com/motis-project/motis/blob/master/src/server.cc"
click node_routing_endpoint "https://github.com/motis-project/motis/blob/master/src/endpoints/routing.cc"
click node_places "https://github.com/motis-project/motis/blob/master/src/place.cc"
click node_transit "https://github.com/motis-project/motis/blob/master/include/motis/endpoints/routing.h"
click node_street "https://github.com/motis-project/motis/blob/master/src/osr/street_routing.cc"
click node_match_platforms "https://github.com/motis-project/motis/blob/master/include/motis/match_platforms.h"
click node_flex "https://github.com/motis-project/motis/blob/master/src/flex/flex.cc"
click node_gbfs "https://github.com/motis-project/motis/blob/master/src/gbfs/routing_data.cc"
click node_realtime "https://github.com/motis-project/motis/blob/master/src/rt_update.cc"
click node_elevators "https://github.com/motis-project/motis/blob/master/src/elevators/update_elevators.cc"
click node_geocoding "https://github.com/motis-project/motis/blob/master/src/endpoints/adr/geocode.cc"
click node_tiles "https://github.com/motis-project/motis/blob/master/src/endpoints/tiles.cc"
click node_web_ui "https://github.com/motis-project/motis/blob/master/ui/src/routes/%2Bpage.svelte"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_config,node_import,node_runtime_data,node_server,node_api_client toneBlue
class node_places,node_transit,node_street,node_match_platforms toneAmber
class node_flex,node_gbfs,node_realtime,node_elevators toneMint
class node_routing_endpoint,node_geocoding,node_tiles,node_web_ui toneRose
class node_operator,node_input_feeds toneIndigo
```

## Components

### Data and service

- [Configuration](https://github.com/motis-project/motis/blob/master/include/motis/config.h): `include/motis/config.h`
- [Data import](https://github.com/motis-project/motis/blob/master/src/import.cc): `src/import.cc`
- [Loaded data](https://github.com/motis-project/motis/blob/master/include/motis/data.h): `include/motis/data.h`
- [HTTP server](https://github.com/motis-project/motis/blob/master/src/server.cc): `src/server.cc`

### Journey routing

- [Place resolution](https://github.com/motis-project/motis/blob/master/src/place.cc): `src/place.cc`
- [Transit routing](https://github.com/motis-project/motis/blob/master/include/motis/endpoints/routing.h): `include/motis/endpoints/routing.h`
- [Street routing](https://github.com/motis-project/motis/blob/master/src/osr/street_routing.cc): `src/osr/street_routing.cc`
- [Platform matching](https://github.com/motis-project/motis/blob/master/include/motis/match_platforms.h): `include/motis/match_platforms.h`

### Mobility extensions

- [Flexible transit](https://github.com/motis-project/motis/blob/master/src/flex/flex.cc): `src/flex/flex.cc`
- [Shared mobility](https://github.com/motis-project/motis/blob/master/src/gbfs/routing_data.cc): `src/gbfs/routing_data.cc`
- [Real-time updates](https://github.com/motis-project/motis/blob/master/src/rt_update.cc): `src/rt_update.cc`
- [Elevator data](https://github.com/motis-project/motis/blob/master/src/elevators/update_elevators.cc): `src/elevators/update_elevators.cc`

### API and map

- [Journey endpoint](https://github.com/motis-project/motis/blob/master/src/endpoints/routing.cc): `src/endpoints/routing.cc`
- [Geocoding](https://github.com/motis-project/motis/blob/master/src/endpoints/adr/geocode.cc): `src/endpoints/adr/geocode.cc`
- [Map tiles](https://github.com/motis-project/motis/blob/master/src/endpoints/tiles.cc): `src/endpoints/tiles.cc`
- [Web interface](https://github.com/motis-project/motis/blob/master/ui/src/routes/%2Bpage.svelte): `ui/src/routes/+page.svelte`

### Other components

- **Operator**
- **OSM and feeds**
- **API client**

## Connections

- Operator → Configuration: configures (evidence: `README.md`)
- OSM and feeds → Configuration: supplies files (evidence: `README.md`)
- Configuration → Data import: prepares import (evidence: `README.md`)
- OSM and feeds → Data import: preprocessed (evidence: `README.md`)
- Operator → HTTP server: starts service (evidence: `README.md`)
- HTTP server → Loaded data: loads data (evidence: `src/server.cc`)
- API client → HTTP server: sends requests
- HTTP server → Journey endpoint: routes requests
- Journey endpoint → Place resolution: resolves places (evidence: `src/endpoints/routing.cc`)
- Journey endpoint → Transit routing: plans journeys (evidence: `src/endpoints/routing.cc`)
- Journey endpoint → Street routing: routes streets (evidence: `src/endpoints/routing.cc`)
- Journey endpoint → Flexible transit: uses flex (evidence: `src/endpoints/routing.cc`)
- Journey endpoint → Shared mobility: uses rentals (evidence: `src/endpoints/routing.cc`)
- Journey endpoint → Platform matching: uses matches (evidence: `src/endpoints/routing.cc`)
- Loaded data → Real-time updates: holds updates (evidence: `include/motis/data.h`)
- Loaded data → Elevator data: holds elevator state (evidence: `include/motis/data.h`)
- API client → Geocoding: geocodes places
- API client → Map tiles: requests tiles
- Web interface → API client: uses API
