From c3f76fad7b6cedba3cb165b4a51bba7c3d112aed Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Thu, 24 Feb 2022 10:59:58 +0000 Subject: [PATCH] minor edits --- docs/setup-dev-environment.md | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/docs/setup-dev-environment.md b/docs/setup-dev-environment.md index f0e6faa4..47e84f83 100644 --- a/docs/setup-dev-environment.md +++ b/docs/setup-dev-environment.md @@ -50,6 +50,7 @@ ssh @localhost -p 4022 - [:arrow_forward: Configuring Node.js](#arrow_forward-configuring-nodejs) - [:house: Loading the building data](#house-loading-the-building-data) - [:computer: Running the application](#computer-running-the-application) + - [:eyes: Viewing the application](#eyes-viewing-the-application) ## :tulip: Installing the tools and components @@ -60,7 +61,7 @@ sudo apt-get update -y sudo apt-get upgrade -y ``` -Now we install some essential tools. +Now install some essential tools. ```bash sudo apt-get install -y build-essential git vim-nox wget curl @@ -76,6 +77,9 @@ sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs) ```bash sudo wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add - +``` + +```bash sudo apt-get update ``` @@ -93,12 +97,14 @@ sudo apt-get install -y gdal-bin libspatialindex-dev libgeos-dev libproj-dev ### :rainbow: Installing Colouring London -Now clone the `colouring-london` codebase. +Now clone the `colouring-london` codebase. ```bash git clone https://github.com/colouring-london/colouring-london.git ``` +**Note:** We assume here that you will clone the repo into the home directory of your Ubuntu installation. Watch out for later commands in this guide that assume the repo is located at `~/colouring-london` and modify the path if appropriate. + ### :arrow_down: Installing Node.js Now install Node. It is helpful to define some local variables. @@ -234,7 +240,7 @@ Now install the required Node packages. This needs to done from the `app` direct local repository, so that it can read from the `package.json` file. ```bash -cd ./colouring-london/app +cd ~/colouring-london/app npm install ``` @@ -259,7 +265,7 @@ In your Ubuntu installation where you have been running these setup steps (e.g. psql -d < ``` -Run migrations. +#### Run migrations Now run all 'up' migrations to create tables, data types, indexes etc. The `.sql` scripts to do this are located in the `migrations` folder of your local repository. @@ -273,7 +279,7 @@ ls ~/colouring-london/migrations/*.up.sql 2>/dev/null | while read -r migration;
With test data

-Run the following two sections if you wish to load test buildings into the application from OpenStreetMaps (OSM). +This section shows how to load test buildings into the application from OpenStreetMaps (OSM). #### Set up Python: @@ -332,7 +338,7 @@ rm: cannot remove 'test_buildings.geojson': No such file or directory rm: cannot remove 'test_buildings.3857.csv': No such file or directory ``` -Run migrations. +#### Run migrations Now run all 'up' migrations to create tables, data types, indexes etc. The `.sql` scripts to do this are located in the `migrations` folder of your local repository. @@ -341,6 +347,8 @@ do this are located in the `migrations` folder of your local repository. ls ~/colouring-london/migrations/*.up.sql 2>/dev/null | while read -r migration; do psql -d < $migration; done; ``` +#### Load buildings + Load all building outlines. ```bash @@ -373,7 +381,6 @@ mkdir tilecache Create some additional variables for running the application (the `APP_COOKIE_SECRET` is arbitrary). ```bash -export PGHOST=localhost export PGPORT=5432 export APP_COOKIE_SECRET=123456 export TILECACHE_PATH=~/colouring-london/app/tilecache @@ -385,9 +392,10 @@ Finally, simply run the application with npm. npm start ``` +**Note:** You can also specify the variables for `npm start` like so:
-... or specify the variables for the application like so: +Specify variables ```bash @@ -396,6 +404,8 @@ PGPASSWORD= PGDATABASE= PGUSER= PGHOST=

+### :eyes: Viewing the application + The site can then be viewed on http://localhost:8080. Finally to quit the application type `Ctrl-C`.