Repository for shehacks project: a chatbot that can help diagnose mental health issues made using React and Dialogflow
This webapp allows you to interact with Joy, a chatbot designed to help you go through moments of depression and anxiety. You can converse with Joy through text messages and let out how you feel; Joy will listen and recommend what you can do in the moment to feel better. You can also access calming exercises, diagnostic tests, and other helpful resources easily through our website. We also have a music player that recommends songs based on the mood of the conversation. Users are fully anonymous. None of their data is collected, so everyone can feel safe while using Joy.
Devpost: https://devpost.com/software/the-joy-bot
- We used agents on
Dialogflow
- Google's NLP platform - We collected data from Reddit (r/depression, r/depressed, r/anxiety, r/adhd) and Quora to train subagents for Joy so the bot could detect sentiments accurately. To see how the bot should respond, we used highest voted responses on Reddit and read some research papers.
- We connected an endpoint in our
Express
backend to the Dialogflow API so the frontend didn't need our API credentials - The frontend
React
application has components for the chatbot, music player, accordians and navbar. It makes requests to the Express backend when a user sends a message to get a response. The backend forwards this request to the Dialogflow API
-
Clone the repository
-
Add an
.env
file to the root directory with values forDIALOGFLOW_PROJECT_ID
andDIALOGFLOW_LANGUAGE_CODE
. It will look something like this:
DIALOGFLOW_PROJECT_ID = 'project-id-xxxx'
DIALOGFLOW_LANGUAGE_CODE = 'en'
-
Add the JSON file with service account credentials to the
api
directory (cd api
from the root directory). Name this fileprivate.json
Note: I accidentally pushed this file to our repo, but you shouldn't. I have regenerated our credentials now :) -
npm install
andnpm start
in the root directory and in theapi
directory. The directory structure is a little messed up right now - theroot
directory is the frontend directory, but theapi
(backend) directory is inside it. I will fix this (soon)
- React Scripts: if you get an issue due to this, use
yarn add react-scripts
. This seems to fix this issue on macOS.