MCPcopy Index your code
hub / github.com/OpenRailAssociation/osrd

github.com/OpenRailAssociation/osrd @v1.2.19

Chat with this repo
repository ↗ · DeepWiki ↗ · release v1.2.19 ↗ · + Follow
12,722 symbols 50,741 edges 2,315 files 2,076 documented · 16%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

  <img width="340px" style="max-width: 100%;" src="https://github.com/OpenRailAssociation/osrd/raw/v1.2.19/assets/branding/osrd_small.svg" alt="OSRD Logo" alt="OSRD logo">

   Public Money Public Code

Contributors badge LGPL License badge Build Status REUSE status Openrail Incubation Stage

What is OSRD?

OSRD (Open Source Railway Designer) is an open source web application for railway infrastructure design, capacity analysis, timetabling and simulation and short term path request.

It's free and open-source forever!

Learn more about the project on osrd.fr.

Demo

Access the demo at demo.osrd.fr.

[!IMPORTANT] This environment is not intended for use in production. It is refreshed daily, and the data entered is accessible to everyone.

⚠️ Development status

OSRD is still in active development. User and programming interfaces are not entirely stable and are still occasionally modified. If you rely on OSRD, be prepared to deal with regular changes.

Languages

OSRD support multiple languages. Here is the translation status for the different languages. Integrated means that users can actually activate the language in the application. If you want to contribute to the translation, you can do so easily with Weblate.

Language Status Integrated
🇬🇧 English Translation status
🇫🇷 French Translation status
🇩🇪 German Translation status
🇵🇹 Portuguese Translation status
🇪🇸 Spanish Translation status

Getting Started

To compile and run the application with an example infrastructure:

# build and run the entire stack
docker compose up -d --build

# import an small example infrastructure ("small_infra")
./scripts/load-railjson-infra.sh small_infra tests/data/infras/small_infra/infra.json

# import rolling stocks with realistic characterics, representative of the industry
./scripts/load-railjson-rolling-stock.sh tests/data/rolling_stocks/realistic/*.json --force

# import more rolling stocks
./scripts/load-railjson-rolling-stock.sh tests/data/rolling_stocks/*.json

# open the web app
xdg-open http://localhost:4000/

Linux or WSL users can use ./osrd-compose host instead of docker compose to enable host networking: it can be useful to launch services in a debugger.

macOS users on Apple Silicon should make sure to set an arm64 image name for Postgres/PostGIS (to prevent slow amd64 emulation). This image name can be set by running export OSRD_POSTGIS_IMAGE='nickblah/postgis:16-postgis-3' before the first docker compose command.

The last-minute train (STDCM) module needs additional setup: start by creating a scenario, copy its ID from its URL, then run:

docker compose exec editoast editoast stdcm-search-env set-from-scenario <id>

If you need to use speed limits tags and loading gauge, run this:

echo '{ "LG1": [], "LG2": [] }' > /tmp/allowed_tracks.json
docker cp /tmp/allowed_tracks.json osrd-editoast:/tmp/
docker compose exec editoast editoast stdcm-search-env set-from-scenario <id> --speed-limit-tags "CC100|100" "CC90|90" "CC200|200" --default-speed-limit-tag "CC100" /tmp/allowed_tracks.json

Alternative with nix and process-compose (experimental)

The project also attempts to maintain a flake.nix to have a full development environment. If you are a user of nix package manager, you can nix shell to enter a shell where all the necessary components to develop are available. First, you need to set up 2 things: - export OSRD_PATH="$(pwd)"

Then, you can start the stack with the two following commands.

# Launch all the external services, still relies on Docker
./osrd-compose up --detach postgres rabbitmq valkey openfga jaeger s3
# Launch the OSRD stack
process-compose

[!WARNING] Most scripts in the scripts/ folder depends on using the Docker stack. So use them with precaution if you start the stack with process-compose: they may work, or crash, or produce weird behaviors.

Working on a single component

Each component has a justfile to run usual development tasks. Install just and run it to see available recipes. All the components include:

  • run
  • install
  • test
  • format
  • lint
  • fix-lint

Deployment

To deploy the application on a server, check out the deployment guide.

Get in touch

Send an email at contact@osrd.fr, open an issue, or join the #public-general:osrd.fr matrix channel.

Sponsors

Ministère de l'Aménagement du Territoire et de la Décentralisation European Union SNCF Réseau

License

OSRD is licensed under the GNU Lesser General Public License v3.0, see LICENSE.

Copyright © 2022 The OSRD Contributors

Extension points exported contracts — how you extend this code

Type (Interface)
Trait that should be implemented by all DSL specifiers types to provide the required compile-time information to the [Qu [9 …
editoast/search/src/dsl.rs
EditoastError (Interface)
Trait for all errors that can be returned by editoast [15 implementers]
editoast/src/error.rs
AsCoreRequest (Interface)
A struct implementing this trait represents a Core request payload For example: ``` # use core_client::AsCoreRequest; # [8 …
editoast/core_client/src/lib.rs
OSRDTyped (Interface)
This trait should be implemented by all struct that represents an OSRD type. [19 implementers]
editoast/schemas/src/primitives.rs
Authorizer (Interface)
An entity capable of authorizing a [Protected] operation, yielding an [Access] The authorization logic is up to the imp [5 …
editoast/authz/src/v2.rs
EnvelopePartConstraint (Interface)
(no doc) [6 implementers]
core/envelope-sim/src/main/java/fr/sncf/osrd/envelope/part/constraints/EnvelopePartConstraint.java
CliCommand (Interface)
(no doc) [11 implementers]
core/src/main/java/fr/sncf/osrd/cli/CliCommand.java
Type (Interface)
Representation of an OpenFGA `type` In order to be used with the [`trait Relation`], the implementer type must also imp [3 …
editoast/fga/src/model.rs

Core symbols most depended-on inside this repo

map
called by 1524
editoast/authz/src/v2.rs
clone
called by 1242
editoast/editoast_models/src/infra.rs
get_ok
called by 672
editoast/database/src/db_connection_pool.rs
json
called by 515
editoast/core_client/src/mocking.rs
push
called by 503
editoast/fga/src/client/tuples.rs
filter
called by 483
editoast/editoast_models/src/prelude/list.rs
iter
called by 468
editoast/core_task/src/envs/simulation/inputs.rs
add
called by 426
core/kt-osrd-utils/src/main/kotlin/fr/sncf/osrd/utils/indexing/StaticIdx.kt

Shape

Function 4,860
Method 4,778
Class 2,601
Enum 287
Interface 194
Route 2

Languages

Rust32%
TypeScript27%
Kotlin27%
Python11%
Java4%
C1%

Modules by API surface

osrd_schemas_auto/osrd_schemas_auto/models.py657 symbols
editoast/src/infra_cache/mod.rs102 symbols
core/src/test/kotlin/fr/sncf/osrd/utils/DummyInfra.kt98 symbols
core/kt-osrd-sim-infra/src/main/kotlin/fr/sncf/osrd/sim_infra/impl/RawInfraImpl.kt97 symbols
front/tests/pages/operational-studies/times-stops-table-page.ts83 symbols
core/kt-osrd-sim-infra/src/main/kotlin/fr/sncf/osrd/sim_infra/impl/RawInfraBuilder.kt78 symbols
editoast/src/views/timetable/train_schedule.rs73 symbols
python/osrd_schemas/osrd_schemas/infra.py63 symbols
osrd_schemas_auto/osrd_schemas_auto/infra.py62 symbols
core/src/main/kotlin/fr/sncf/osrd/stdcm/infra_exploration/InfraExplorer.kt62 symbols
editoast/src/views/rolling_stock.rs58 symbols
editoast/src/views/infra/mod.rs55 symbols

Datastores touched

osrdDatabase · 1 repos

For agents

$ claude mcp add osrd \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact