From big cities to rural communities, substance abuse has not discriminated in any fashion. Growing up in Western Pennsylvania, we saw the opioid and heroin epidemic take out individuals, families, and entire communities. In fact, nearly 44 people die to an overdose per every 100,000 in the state of Pennsylvania alone. This totals to a harrowing 44,000 overdoses in America per year. Rehab has served as a great success for many, but nearly 60% of people relapse within a year after finishing rehab. In fact, many studies find that preventing relapse plays a critical role in a person’s long-term outcome. Thus, we wanted to make a web-application that can help recovering substance abusers continue on the path to rehabilitation and prevent relapse.
What it does?
Recovery Resolutions is a web application that allows recovering substance abusers to sign-up and invite a trusted contact to monitor over their progress towards rehabilitation. Users link their social media accounts, and using artificial intelligence, we analyze changes in the user’s mental well-being in order to predict the chance of a relapse occurring. The trusted contact designated by the user has the ability to monitor the user’s progress through various metrics that contribute to the chance of a relapse. These metrics are only visible to the user’s contact and not the user themself, as it could cause a decrease in morale and inflate the already high amounts of stress these users experience. However, aside from just offering the metrics, by analyzing user’s social media posts, status changes, and trends, we also offer additional services for the user which will increase the app’s consumption. The current features include:
- Daily questionnaires on how a user is doing
- Offering daily tips based on how the user is doing emotionally, mentally, and physically
The output is shown only to the trusted contact and is quite intuitive. We display a percent risk for relapse based on both our analysis of their social media patterns and their answers to our questionnaire.
How we built it
We had three main goals when designing and creating this project: 1.Privacy for the users 2.Creating a scalable application 3.Minimize our burden on external API servers by using databases to store information 4.The distinct separation between the front-end and the back-end
To achieve these goals, we spent the first 3 hours planning our architectural design. We decided to create a Flask server back-end that is separated from what our front-end displays. We also decided to use a MySQLlite in conjunction with our front-end and back-end in order to store and retrieve user data much efficiently. We created our own log-in system and incorporated Facebook and Twitter authentication to retrieve the user’s social media data. We then used Azure’s Text Analytics to assign a sentiment score to the past 15 tweets and posts on Twitter and Facebook respectively. From this, we derived an algorithm to assign a weight to different terms that shifted the score based on the magnitude of the weight. Then, using a plethora of GET and POST requests between our Flask server, database, and front-end, we present the trusted contact the data through a seamless and crisp UI. The combination of all these independent microservices allowed us to reduce the chances of our users relapsing.
Challenges we ran into: With so many independent parts working together, there were bound to be errors. Our largest issue was our lack of experience in SQL database manipulation and OAuth authentication through Flask. However, after countless tutorials and multiple articles, we eventually got it to work. Another problem we had was that Stack Overflow was down for maintenance just as we began encountering bugs in our code.
Accomplishments we are proud of: We’re proud that after 24 hours, we made a fully functional web app that has the ability to impact peoples’ lives. In addition, we are proud that we were able to implement all the design choices we planned making a scalable project. Finally, we’re proud that we had fun, regardless of whether we win or not.
What we learned: We successfully learned how to use MySQLLite and have a fully functional back-end that operates on its own. We also learned how to use OAuth tokens in Flask and create our own functional log-in system.
What’s next for Resolution Recovery: We want to build an iOS/Android mobile app that is much more accessible and easier to use. We hope to add more features to the mobile app that will make the app a more involved part of a users’ life rather than just something to help them towards rehabilitation. We also hope to add many more metrics to predict the signs of relapse. Specifically, we hope to add a form of map tracking that can create hotspots of potentially risky areas near our users.