Skip to content

Instantly share code, notes, and snippets.

What would you like to do?

1. Open your mac...

2. Install some software

  • Chrome / Chromium
  • Git
  • Slack
  • Brew

3. Install Scoir back-end dependencies

$ mkdir ~/opt
$ mkdir ~/dev && cd ~/dev

These instructions presume you have git set up and you have your keys in github

$ brew install redis@4.0
$ echo 'export PATH="/usr/local/opt/redis@4.0/bin:$PATH"' >> ~/.bash_profile
$ . ~/.bash_profile
$ brew services start redis@4.0

Do a brew search first, you want a ~6.x version

$ brew install elasticsearch

Mac's suck generally, and add the hidden .DS_store files everywhere for no good reason, as a result elasticsearch won't start, as the data dir created by the install isn't empty

$ rm -rf /usr/local/var/lib/elasticsearch/elasticsearch_`whoami`
$ brew services start elasticsearch

A nice to have, you do not need it to run scoir

$ brew install kibana
$ brew services start kibana
$ brew install mongodb@3.6
$ echo 'export PATH="/usr/local/opt/mongodb@3.6/bin:$PATH"' >> ~/.bash_profile
$ . ~/.bash_profile
$ brew services start mongodb@3.6
$ brew install gnatsd
$ brew services start gnatsd
$ brew install nats-streaming-server

Edit the nats-streaming-server launch config to use a different port, otherwise it will clash with gnatsd

vi /usr/local/Cellar/nats-streaming-server/x.x.x/hombrew.mxcl.nats-streaming-server.plist




$ brew services start nats-streaming-server
$ brew install postgresql@9.6
$ echo 'export PATH="/usr/local/opt/postgresql@9.6/bin:$PATH"' >> /.bash_profile
$ brew services start postgresql@9.6
$ . ~/.bash_profile
$ createdb `whoami`
$ psql
# CREATE USER kong; CREATE DATABASE kong OWNER kong; ALTER USER kong WITH password 'kong';
# \q

Make sure your xcode is up to date first (App Store)

 $ brew tap kong/kong
 $ brew install kong
 $ kong migrations bootstrap

add kong to launchctl

Create a file /Library/LaunchAgents/scoir.mxcl.kong.plist with the contents

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "">
<plist version="1.0">


$ sudo chown root:wheel /Library/LaunchAgents/scoir.mxcl.kong.plist
$ sudo launchctl load /Library/LaunchAgents/scoir.mxcl.kong.plist
configure kong with the frontend configs
$ cd ~/dev && git clone && cd -
$ sudo mkdir /etc/kong
$ sudo mkdir /etc/shared
$ sudo cp -r ~/dev/frontend/k8s/config/shared/ /etc/shared/
$ sudo cp -r ~/dev/frontend/k8s/config/local/ /etc/kong/

Check to see if everything is OK

$ sudo kong start -c /etc/kong/kong.conf --nginx-conf /etc/kong/scoir-nginx.template

If you restart, all services including kong should come back, verify with brew services list should look like

Name                  Status  User Plist
elasticsearch         started dev  /Users/dev/Library/LaunchAgents/homebrew.mxcl.elasticsearch.plist
gnatsd                started dev  /Users/dev/Library/LaunchAgents/homebrew.mxcl.gnatsd.plist
kibana                started dev  /Users/dev/Library/LaunchAgents/homebrew.mxcl.kibana.plist
mongodb@3.6           started dev  /Users/dev/Library/LaunchAgents/homebrew.mxcl.mongodb@3.6.plist
nats-streaming-server started dev  /Users/dev/Library/LaunchAgents/homebrew.mxcl.nats-streaming-server.plist
postgresql@9.6        started dev  /Users/dev/Library/LaunchAgents/homebrew.mxcl.postgresql@9.6.plist
redis@4.0             started dev  /Users/dev/Library/LaunchAgents/homebrew.mxcl.redis@4.0.plist

4. Download and install latest version of Go 1.10 to ~/opt

Go 1.10

$ cp ~/Downloads/go1.10.8.darwin-amd64.tar.gz ~/opt
$ cd ~/opt
$ tar -xf go1.10.8.darwin-amd64.tar.gz
$ mv go go1.10
$ ln -s go1.10 go

to install multiple go's you can just switch your symlink.

Set $GOBIN, $GOROOT, update $PATH environment vars in .bash_profile:

export GOBIN="$HOME/opt/gobin"
export GOROOT="$HOME/opt/go"

Create the ~/opt/gobin

mkdir ~/opt/gobin


 $ source .bashrc

5. Install Scoir API specification

install node version manager (nvm)
$ curl -o- | bash
$ nvm install v8.9.3
$ nvm use v8.9.3
run the api spec "seed" to register routes with scoir
$ git clone
$ cd api-spec
$ .
$ make bin/registrar
$ npm i -g multi-file-swagger
$ npm i -g swagger-cli
$ ./

If I haven't fixed the script get, open paths/paths.yml and search for occurrences of "Generated code. DO NOT EDIT." There should be one at the top of the file, and one around ~970 remove the block that looks like

Generated code. DO NOT EDIT.
    $ref: /paths.yml
$ ./bin/registrar public/api-spec.json

6. Install Scoir and its dependencies

Install Go Dep dependency management tool via curl:

$ curl | sh

Clone main scoir repo into ~/dev

$ cd ~/dev
$ git clone
$ cd ~/dev/scoir/src/
$ .
$ .
$ dep ensure
$ cd ~/dev/scoir

Install additional libs

Install Rice (for email templates)

$ go get
$ go get

Clean up after rice

$ rm -rf src/
$ rm -rf src/
$ rm -rf src/
$ rm -rf src/
$ rm -rf src/
$ rm -rf src/

Install Mockery

$ go get

Clean up after mockery

$ rm -rf src/
$ rm -rf src/
$ rm -rf src/


$ make run

7. Run the frontend

Clone repos:

$ cd ~/dev
$ git clone
$ git clone
$ git clone
$ git clone
$ git clone
$ git clone

Now clone slartibartfast as it contains helper scripts

$ git clone

Copy helper scripts

$ cp ~/dev

Install tmux

$ brew install tmux
$ tmux

Login to npm

export NPM_TOKEN=71f34c2f-d6c0-4480-bfad-6828710d75e5 
npm login


$ cd ~/dev
$ ./ develop
$ ./

To kill all fe windows hit ctrl+b then shift+7 then at the prompt hit y

Rinse and repeat to run a different branch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment