anyways-open / itinero-transit-server

Wrapper around itinero-transit to make it available as HTTP-service
MIT License
2 stars 0 forks source link
routing-engine transit

itinero-transit-server

Build status

The Itinero-Transit-Server is a wrapper around the core library itinero-transit. The core library offers routing over a public transport network, this small wrapper makes that available via HTTPS.

A demo is deployed here. The full documentation (as swagger file) can be found there as well.

If the server is offline, a backup swagger file is available in the repo too. To load this interactively:

Getting started

This project assumes that you have a working dotnet environment on your Linux device. If you don't have dotnet, follow this guide

    # Clone the project
    git clone git@github.com:anyways-open/itinero-transit-server.git
    cd itinero-transit-server
    # Start the server
    cd src/Itinero.Transit.Api/
    dotnet run

The program will now load a bunch of data for the Belgian Public Transport agencies.

Have a look at the status page how your server is doing. The loaded time windows indicate what dataset has been loaded already. In the loaded parts, planning is possible. There is no need to wait until every PT-operator has been completely loaded.

With the server running, visit the API-documentation page to see what is possible.

Project overview

First, a small overview of the directories in the git repo:

Source overview

The project itself is a pretty straightforward C#/ASP.net project. Requests come in via HTTP and are delegated to a controller-class in Controllers/. They return an appropriate Model as JSON.

The controllers themselfs do not contain the algoirthms themselves. These are contained in Logic/. One important class in Logic/ is State.cs. The State contains the global variables, namely a pointer to the transitdbs which the logic and controllers use.

As State is a central piece in the app, go read it now. Every field is documented.

The next important class is Startup where the State is constructed.

Overview of other Logic: classes: