Use Twilio to send SMS reminders to your customers about upcoming appointments. Learn how appointment reminders help other companies in these Twilio customer stories.
The easiest way to run this app is by deploying it to Heroku. You can run this app for free in minutes:
After your app deploys, you must go to the Heroku dashboard and enable your worker dyno to start the Celery worker:
This project is built using the Flask web framework. It runs on Python 2.7+ and Python 3.4+.
To run the app locally, first clone this repository and cd
into its directory. Then:
-
Create a new virtual environment:
-
If using vanilla virtualenv:
virtualenv venv source venv/bin/activate
-
If using virtualenvwrapper:
mkvirtualenv appointment-reminders
-
-
Install the requirements:
pip install -r requirements.txt
-
Start a local PostgreSQL database and create a database called
appointments
:- If on a Mac, we recommend Postgres.app. After install, open psql and run
CREATE DATABASE appointments;
- If Postgres is already installed locally, you can just run
createdb appointments
from a terminal
- If on a Mac, we recommend Postgres.app. After install, open psql and run
-
Copy the
.env_example
file to.env
, and edit it to include your credentials for the Twilio API (found at https://www.twilio.com/user/account/voice) and your local Postgres database -
Run
source .env
to apply the environment variables (or even better, use autoenv) -
Run the migrations with:
alembic upgrade +1
-
Start a redis server to be our Celery broker. If on a Mac, we recommend installing redis through homebrew
-
Start the development server:
python runapp.py
You can now access the application at http://localhost:5000. To send any reminders, however, you must also start a separate Celery worker process.
-
Start a new terminal session,
cd
into the repository, and active yourappointment-reminders
virtualenv -
Start the Celery worker:
celery -A reminders.celery worker -l info
Celery will now send SMS reminders for any new appointments you create through the web app.
You can run the tests locally through pytest.
Follow the instructions in the Local Development section above, and then run:
py.test --cov
You can then view the results with coverage report
or build an HTML report with coverage html
.