Segment Salad is a prototype project that maps Strava segments for easy color coding and filtering.
Check out the segment-salad repo along with client submodule (--recursive flag gets client submodule):
git clone --recursive git@github.com:BalinorNZ/segment-salad.git
Run npm install in the root folder and the client folder.
The Client uses Create-react-app. Run npm start in two separate terminals in each of the
root and client folders.
Create a file called strava_config in a folder called data at the project root with the following inside:
module.exports = {
"access_token" :"enter your access_token here"
, "client_id" :"enter your client id here"
, "client_secret" :"enter your client secret here"
, "redirect_uri" :"http://localhost:3000/"
};
The following database setup instructions are based on this article: install instructions here
- Download Postgres db from here
- Use the default Installation Directory
- Also, use the default Data Directory (We can always change this later)
- Input a password for the superuser (default database adminstrator account with name postgres). IMPORTANT: DO NOT FORGET THIS PASSWORD. WITHOUT IT YOU CANNOT LOG IN AND WILL NEED TO START OVER.
- Default password is 'postgres', if you use a different password, update the password in /db/index.js
- The default port is 5432, use it.
- Set the Locale to be the default.
- Click OK to begin the install.
- After install, click Allow to let the application accept incoming network requests
- Launch StackBuilder to install PostGIS (under Spatial Extensions).
If PostGIS for Postgres 10 is missing from Stack Builder download and install it from here.
- Open pgAdmin application
- Right click 'Servers' in the browser pane and select Create > Server
- Name it whatever you like.
- Hostname/address to 'localhost'
- Username: postgres
- Password: postgres (or whatever you set in db/index.js)
- Save password? yes.
- Click save.
- In pgAdmin right click the server you just made in the browser pane and Create > Database
- Set Database to 'segmentsalad' (or whatever you set database to in db/index.js)
- Click save.
- In pgAdmin Browser pane rightclick your database and select 'Query tool'.
- run this SQL "CREATE EXTENSION postgis;" (click lightning bolt to run query).
- Copy the SQL from the file create-function-update_row_modified in /schemas folder
- Run it in the pgAdmin query tool.
- Copy the SQL from each of the other files in /schemas folder into query tool to create tables.
- The tables will appear under Server > segmentsalad > Schemas > public > Tables in pgAdmin browser.
Ask Nic for a dump of his segments table to avoid having to scan for 500+ segments in Dunedin yourself!
Run npm start in both the repo root directory and the client directory (in that order).