Skip to content

Latest commit

 

History

History
77 lines (38 loc) · 1.94 KB

README.md

File metadata and controls

77 lines (38 loc) · 1.94 KB

SolveBio + Dash Example App

This is an example Dash application that uses the SolveBio API to pull data.

To run it locally, you'll need Python 3.6+ installed. You can deploy it to Heroku or to a SolveBio App Server.

The base application code can be found in app.py.

This application generates a few charts based on a single gene symbol input.

Local Development

Install Requirements

pip install -r requirements.txt

Run the App

If you have a SolveBio OAuth2 client ID, set the environment variable:

export CLIENT_ID=<your client ID>

If you do not have a client ID or would like to test the app with your personal SolveBio API key, set the following environment variable:

export SOLVEBIO_API_KEY=<your API key>

Run the app in local development mode:

python app.py

Deploy the App

Deploy to SolveBio

If you have access to a SolveBio App Server, contact SolveBio support for instructions.

Deploy to Heroku

Deploy

You will need to set the following environment variables:

  • SECRET_KEY: A secret key generated specifically for your app.
  • CLIENT_ID: Your SolveBio app's client ID
  • APP_URL: The public URL of your app (e.g. https://<APP NAME>.herokuapp.com)

If you want to deploy manually with the Heroku CLI, first create a new Heroku app:

# Create the Heroku app
heroku create

# Set the SECRET_KEY to random characters
heroku config:set SECRET_KEY=somesecretkey123

# Set your SolveBio OAuth2 client ID
heroku config:set CLIENT_ID=<your client id>

# Set your app's public URL
heroku config:set APP_URL=https://<your app>.herokuapp.com

git push heroku master

Generating your SECRET_KEY

Run this one-liner from your command line to get a secret key:

python -c "import binascii, os; print(binascii.hexlify(os.urandom(24)))"