Skip to content

janet/monkeybrains

Repository files navigation

About

Monkeybrains is an api server for the Monkeys app

To start development locally

  1. Clone this repo git clone git@github.com:janet/monkeybrains.git
  2. Run nginx @ localhost:8080 (instructions below)
  3. Run api server @ localhost:5000 (instructions below)
  4. Create and seed database (instructions below)
  5. Run frontend server (instructions @ Monkeys app)
  6. Monkeys frontend app connected to Monkeybrains api server @ localhost:8080

Nginx (osx)

  1. Install nginx Coderwall link for more info on nginx

     $ brew install nginx
    
  2. Use nginx config from this repo

     $ rm /usr/local/etc/nginx/nginx.conf
     $ ln -s `pwd`/nginx.conf /usr/local/etc/nginx/nginx.conf
    
  3. Start nginx proxy server @ localhost:8080

     $ sudo nginx
    

Api Server

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

Database

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

Deployed Versions

Heroku

example call: https://sbg-monkeybrains.herokuapp.com/

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published