An app for South London and Maudsley NHS Trust's award winning DISCOVER programme.
- Clone the repo and navigate to it:
git clone https://github.com/InFact-coop/discover.git
cd discover
- Create a .env file in the root of the project with the following variables:
SHEETS_API_KEY:xx_yourstringhere_xx
SHEET_ID:xx_yourstringhere_xx
GCS_KEYFILE:xx_yourjsonkeyhere_xx
The SHEETS_API_KEY should be linked to a Google API console account with a sheet in it containing daily quotes, according to the following format:
You can get the SHEET_ID from the url of your Google Sheet - the url has the format https://docs.google.com/spreadsheets/d/${SHEET_ID}/edit
The GCS_KEYFILE env variable is for accessing Dialogflow and once you have set up an agent on Dialogflow you can access the keyfile following the instructions here. Make sure to download the key as JSON and enter this as your env variable. It should be formatted something like this:
{
"type":"service_account",
"project_id":"",
"private_key_id":"",
"private_key":"-----BEGIN PRIVATE KEY-----\n\n-----END PRIVATE KEY-----\n",
"client_email":"",
"client_id":"",
"auth_uri":"",
"token_uri":"",
"auth_provider_x509_cert_url":"",
"client_x509_cert_url":""
}
-
Run
yarn installto install dependencies. -
To start the app locally, run
yarn serverandyarn neutrino-start- the app will then be accessible on http://localhost:5000 -
In development, you may wish to increase the speed of the bot messages and skip the onboarding phase. To do so:
- navigate to src/views/Bot.js and replace
Math.floor(Math.random() * 2000) + 500with0 - navigate to src/state/reducers/profile.js and replace in the initial state the following
welcomeFlow: false, startQuery: "Hey I'm back",
- navigate to src/views/Bot.js and replace
-
If you wish to debug the production build run
yarn buildandyarn serverand then go tolocalhost:4000
