No description, website, or topics provided.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
sms_swap
.gitignore
Dockerfile
README.md
application.py
requirements.txt

README.md

self care SMS

a playful project to crowdsource self-care among strangers. built using cathy deng's original sms bot project in the buzzfeed open lab repo.

About

This is a flask app that handles text message exchanges with strangers. It uses Twilio to send/receive SMS.

In a nutshell, the app:

  • texts a prompt
  • stores responses
  • texts randomly selected responses from strangers
  • texts notifications when responses have been seen
  • allows admins to moderate responses

Try it out: 1 (530) 212-6073

Setup

1. Make sure you have OS level dependencies

  • Python 3
  • MySQL

2. Clone this repo

3. Install required python libraries

(Optional but recommended: do this within a python virtual environment)

Install requirements:

pip install -r requirements.txt

4. create a MySQL database

mysql -u root

& then

create database sms_self_care;

If you're working locally, you're good to go. But if you're going to host this on a shared server you probably want to create a new user for this database instead of using root.

5. Configure the app

There are two ways to do this: (a) making a config file or (b) setting environment variables.

You will need the credentials from your Twilio account & number to configure the app. You can find your Twilio keys on https://www.twilio.com/console

Option A
Copy the example secret config file

cp sms_swap/config_vars_secret.py.example sms_swap/config_vars_secret.py

Then, edit sms_swap/config_vars_secret.py.

Option B
see sms_swap/config_vars_secret.py.example for the names of environment variables to set & descriptions of what the values should look like.

6. Run the app locally

python application.py

7. Initialize the database

Visit the /initialize route (e.g. localhost:5000/intialize) & enter admin credentials (ADMIN_USER & ADMIN_PASS). This will create the table for storing responses.