Tested on Ubuntu 20.04 LTS (Focal Fossa)
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-upgrade
sudo 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 cargo
- yarn
curl -sS 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 update && sudo apt install yarn
cd ~
mkdir sources
Optional, 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]"
ssh-add -K ~/.ssh/id_rsa
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://[email protected]/Project-OSRM/osrm-backend
git clone ssh://[email protected]/chairemobilite/trRouting
git clone ssh://[email protected]/chairemobilite/transition
sudo -u postgres psql
- Choose a password:
\password
- Quit psql:
\q
- Build and install: checkout a specific version tag. Latest tested version is v5.26.0.
cd ~/sources/osrm-backend
git checkout tags/v5.26.0
git switch -c 5.26.0
mkdir -p build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
cmake --build .
sudo cmake --build . --target install
cd ~/sources/trRouting
autoreconf -i
./configure
make
sudo make install
curl -sL https://deb.nodesource.com/setup_13.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 yarn
cd ~/sources/transition
yarn install
cp .env.example .env
- Change
PG_CONNECTION_STRING_PREFIX=postgres://postgres:@localhost:5432/
toPG_CONNECTION_STRING_PREFIX=postgres://postgres:YOUR_POSTGRES_PASSWORD@localhost:5432/
- Change
EXPRESS_SESSION_SECRET_KEY
to a random string with no space - Change
PROJECT_CONFIG
to point to your project's configuration file. The default is an example configuration file that can be copied and configured for your own need.
- Go to Mapbox and sign up
- Go to your account dashboard, then generate a new access token
- Open the
.env
file - Copy this access token to
.env
file:MAPBOX_ACCESS_TOKEN=YOUR_TOKEN
- If you have a custom mapbox style, put your username and style id in
MAPBOX_USER_ID
andMAPBOX_STYLE_ID
yarn setup
yarn migrate
yarn compile
yarn create-user
- In a new shell:
yarn start
- In a new shell:
yarn compile:dev
oryarn compile
- In a new shell:
yarn build:dev
oryarn build:prod
- In a new shell:
yarn start:json2capnp -- 2000 /absolute/path/to/cache/file