Monkeybrains is an api server for the Monkeys app
- Clone this repo
git clone git@github.com:janet/monkeybrains.git
- Run nginx @ localhost:8080 (instructions below)
- Run api server @ localhost:5000 (instructions below)
- Create and seed database (instructions below)
- Run frontend server (instructions @ Monkeys app)
- Monkeys frontend app connected to Monkeybrains api server @ localhost:8080
-
Install nginx Coderwall link for more info on nginx
$ brew install nginx
-
Use nginx config from this repo
$ rm /usr/local/etc/nginx/nginx.conf $ ln -s `pwd`/nginx.conf /usr/local/etc/nginx/nginx.conf
-
Start nginx proxy server @ localhost:8080
$ sudo nginx
First time only, create python 3 virtualenv and install requirements and app
$ virtualenv -p python3 monkeybrains_env
$ source monkeybrains_env/bin/activate
$ (monkeybrains_env) pip install -r requirements.txt
$ (monkeybrains_env) pip install --editable .
Run server @ http://localhost:5000/
$ source monkeybrains_env/bin/activate
$ (monkeybrains_env) python api/runserver.py
Run tests
$ (monkeybrains_env) cd api
$ (monkeybrains_env) pytest
Create local postgres database @ postgresql://localhost/monkeys (first time only)
$ createdb monkeys
Add dummy data to database - can be re-run to reset database
$ (monkeybrains_env) python seed_database.py
example call: https://sbg-monkeybrains.herokuapp.com/