Process Street (the backend):

Install Homebrew (if Mac) or Linuxbrew (if Linux)

Go to brew.sh and follow the instructions for Mac

Go to linuxbrew.sh and follow the instructions for Linux

Install PostgreSQL

Note

brew will probably install the latest version of postgresql, but it's preferable to have the same version as on production to avoid issues with syntax incompatibility. Current version on the production server is 9.3.

Procedure for Mac/Linux

From the Terminal app:

brew install postgresql
brew services start postgresql
createdb USERNAME
psql

Troubleshooting. In some cases, there is might be an issue when starting postgresql:

sh: 1: list: not found
Error: Failure while executing:
load -w /home/user/Library/LaunchAgents/homebrew.mxcl.postgresql.plist

This is a known issue and it can be solved using this solution.

Procedure for Windows

Download and run the Windows installer.

Choose the default locations for program and data files.

Choose the default port number.

After installation is complete, open Windows Services and verify that the PostgreSQL service is running.

Use pgAdmin to connect to the database server and verify its operation.

Add process_street user to PostgreSQL

Procedure for Mac

From the Terminal app:

psql -c "create user process_street with superuser"

If you are already in psql

create user process_street with superuser;
Procedure for Linux

From the Terminal:

sudo -i -u postgres 
createuser --interactive (name same as above)
Procedure for Windows

Launch pgAdmin.

Right click on the local development server and select Connect.

Enter the password for the postgres superuser.

Right click Login Roles and select New Login Role.

Using the database credentials defined in environment variables, define a new database login.

  • Enter the user name in the Role name field of the Properties tab
  • Enter the password in the 2 Password fields on the Definition tab
  • Add the Can create databases privilege on the Role Privileges tab
  • Add the Superuser privilege on the Role Privileges tab
(Optional) For Mac: Postico 

https://eggerapps.at/postico/

Postico is a PostgreSQL client for mac. It makes it a lot easier to navigate SQL commands and see the database.

Create the process_street database

Procedure for Linux:
sudo -i -u postgres 
createdb process_street
Procedure for Mac:

To create the local database:

psql -U process_street -c "create database process_street"

or:

create database process_street;
Create extensions for clean database Mac/Linux:

You will need to add extensions if you don't do the database dump:

CREATE EXTENSION IF NOT EXISTS "ltree";
CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
CREATE EXTENSION IF NOT EXISTS "hstore";

Install Scala

Procedure for Mac/Linux

From the Terminal app:

brew install scala

Install sbt - Interactive Build Tool for Scala

brew install sbt

http://www.scala-sbt.org/index.html

Make sure Java is installed and up to date:

scala: Java 1.8+ is required to install this formula.JavaRequirement unsatisfied!

You can install with Homebrew Cask:

brew cask install java

Clone the Process Street repository from GitHub

Procedure for Windows

Ensure that the GitHub Windows Desktop app is installed on your computer.

Visit the process-street repository page in GitHub and use the Clone in Desktop button to initiate cloning.

Setup environment variables

Procedure for Mac/Linux

I add these to my .bash_profile file in my home directory.

nano .bash_profile
# App
export APP_NAME='Process Street (Development)'
export APP_SECRET='XXX'
export APP_STAGE=dev

# PostgreSQL
# ...
Procedure for Windows

The most manageable way to set the required environment variables is within a batch file that is used to launch the command window that will host compiling and running the process-street server:

REM App
SET APP_NAME='Process Street (Development)'
SET APP_SECRET='XXX'
SET APP_STAGE=dev

... define other environment variables, as above ...

CD "process-street"

cmd.exe /k

Add aliases to localhost to your /etc/hosts

Procedure for Mac/Linux
sudo nano /etc/hosts

It should look something like this:

127.0.0.1 localhost app-dev.process.st api-dev.process.st
::1 localhost app-dev.process.st api-dev.process.st
Procedure for Windows

On Windows, hosts entries are stored in the following file:

C:\Windows\System32\drivers\etc\hosts

Entries must be created on separate lines, with each IP addresses and its alias separated by at least one space character:

127.0.0.1 app-dev.process.st
127.0.0.1 api-dev.process.st
::1 app-dev.process.st
::1 api-dev.process.st

Compile and run using SBT

From within the process-street directory, start the server with this. If you just set-up your environment variables, you need to open a new terminal window and run:

sbt ~run

Then, confirm that it works by going to http://api-dev.process.st:9000.

Troubleshooting

Here are a few troubleshooting steps:

If you get this error, it's because the database structure has changed. So you will have to evolve the database at http://localhost:9000/
This is likely because your computer accidentally shut down. See below.

If your computer accidentally shuts down and you can't connect to postgres:

You need to remove the PID file

rm /usr/local/var/postgres/postmaster.pid

and then run postgres again:

brew services start postgresql

See: http://stackoverflow.com/questions/13573204/psql-could-not-connect-to-server-no-such-file-or-directory-mac-os-x

Front Street (the frontend):

Install node.js and NPM

brew install node

If you use brew, this will also install npm.

Procedure for Windows

Download and execute the Node.js Windows installer, which includes both Node.js and NPM.

Clone the Front Street repository from GitHub

Procedure for Windows

Ensure that the GitHub Windows Desktop app is installed on your computer.

Visit the front-street repository page in GitHub and use the Clone in Desktop button to initiate cloning.

Install Grunt

Procedure for Mac, Linux and Windows
npm install -g grunt
npm install -g grunt-cli

Install Bower

Procedure for Mac, Linux and Windows
npm install -g bower
bower install

Install libSaas

Procedure for Mac/Linux
brew install libsass
brew install sassc
Procedure for Windows
npm install -g grunt-sass

Run "grunt server" from the CLI

First Time in front-street: 

grunt server

If you get: Fatal error: Unable to find local grunt. Then run:

npm install

MongoDB (needed for Overview feature):

Install MongoDB

Procedure for Mac/Linux
brew install mongo
brew services start mongodb

Then following the instructions the Brew gives about how to make it auto-launch, or make sure to start it again if mongodb was closed accidentally.

Install Robomongo

This is the best GUI tool we've found so far. Get it here:

https://robomongo.org/download

Add the dev database to Robomongo

Click the create button at the top-left of the connection window.
Make it look like this on the Connection tab.
...and set the default database like so. Then save.

Create the PS Mongo database

Right-click on the connection and select "Create Database".
Name it "process_street".

Import data into Mongo

Go to the Developer Console and click over to the Mongo tab.

Click "Import Schemas" first and wait for it to complete.

Click "Import Results" next and wait for it to complete.

Presto! Overview should work now.

Your numbers will be much lower. Close to 0 if it's a brand new install.

Sign up for a FREE account and
search thousands of checklists in our library.

Sign up for a FREE account and search thousands of checklists in our library.