Tested on Ubuntu 24.04
These instructions will setup a complete development environment for Transition on a new installation of Ubuntu (like a virtual machine). Some of these instructions are not necessary to simply run the application.
sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgradesudo apt-get install git ssh curl wget gcc g++ cmake \
libstxxl-dev libxml2-dev libsparsehash-dev libbz2-dev zlib1g-dev libzip-dev libgomp1 \
pkg-config libgdal-dev libtbb-dev psmisc build-essential postgresql postgis \
clang libboost-all-dev libexpat1-dev libjsoncpp-dev libncurses5-dev lua5.3 liblua5.3-dev \
powerline fonts-powerline zsh capnproto libcapnp-dev postgresql-postgis \
postgresql-postgis-scripts rustc cargocd ~
mkdir sourcesOptional, only for contributing remote patches
ssh-keygen -t rsa -b 4096 -C "YOUR_EMAIL"- Press Enter to use the default
- Press Enter again twice to use no passphrase
eval "$(ssh-agent -s)"- Make sure you get "Agent pid [SOME_NUMBER]"
Add your SSH key to the agent:
# On Linux:
ssh-add ~/.ssh/id_rsa
# On macOS:
ssh-add --apple-load-keychain ~/.ssh/id_rsaView your public key to copy to GitHub:
nano ~/.ssh/id_rsa.pub- Copy this key to GitHub (In GitHub: User icon->Settings->SSH and GPG keys->New SSH key)
cd ~/sources
git clone ssh://git@github.com/Project-OSRM/osrm-backend
git clone ssh://git@github.com/chairemobilite/trRouting
git clone ssh://git@github.com/chairemobilite/transitionsudo service postgresql start
sudo -u postgres psql- Choose a password:
\password - Quit psql:
\q
cd ~/sources/osrm-backend
git log
git checkout mainmkdir -p build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
cmake --build .
sudo cmake --build . --target installResolving the "Intel TBB NOT found" Compilation Error If you encounter the Intel TBB NOT found (CMake Error at cmake/FindTBB.cmake) error during compilation, you can refer to Issue #6704 in the Project-OSRM/osrm-backend repository. This issue explains a workaround for the problem.
sudo apt-get install clang libboost-all-dev libexpat1-dev libjsoncpp-dev libspdlog-dev nlohmann-json3-devcd ~/sources/trRouting
autoreconf -i
./configure
make
sudo make installcurl -sL https://deb.nodesource.com/setup_24.x | sudo bash -
sudo apt-get install -y nodejs
curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt-get update && sudo apt-get install yarncd ~/sources/transition
yarn install
cp .env.example .env
cp examples/config.js config.js
mkdir runtime- Change
PG_CONNECTION_STRING_PREFIX=postgres://postgres:@localhost:5432/toPG_CONNECTION_STRING_PREFIX=postgres://postgres:YOUR_POSTGRES_PASSWORD@localhost:5432/ - Change
EXPRESS_SESSION_SECRET_KEYto a random string with no space - Change
PROJECT_CONFIGto point to your project's configuration file. The default is an example configuration file that can be copied and configured for your own need.
The default map uses OpenStreetMap tiles which don't require any API keys. If you want to add custom raster tiles (such as aerial imagery), you can optionally configure:
CUSTOM_RASTER_TILES_XYZ_URL=https://your-tile-server/{z}/{x}/{y}- URL template for your custom tile serverCUSTOM_RASTER_TILES_MIN_ZOOM=10- Minimum zoom level at which custom tiles are available (default: 0)CUSTOM_RASTER_TILES_MAX_ZOOM=18- Maximum zoom level at which custom tiles are available (default: 22)
Users can switch between OSM and custom tiles using the layer switcher button in the application. The custom tiles option will only be enabled when the current zoom level is within the configured min/max range.
yarn compile
yarn setup
yarn migrate
yarn create-userWhen creating a user, you may provide an email address as a backup in case of a login failure.
yarn node --max-old-space-size=4096 packages/chaire-lib-backend/lib/scripts/osrm/downloadOsmNetworkData.task.js --polygon-file examples/polygon_rtl_area.geojson
yarn node --max-old-space-size=4096 packages/chaire-lib-backend/lib/scripts/osrm/prepareOsmNetworkData.task.jsFor the transport mode, choose walk, driving, bus-urban.
- In a new shell:
yarn compile:devoryarn compile - In a new shell:
yarn build:devoryarn build:prod - In a new shell:
yarn start:json2capnp -- 2000 /absolute/path/to/cache/demo_transition - In a new shell:
yarn start