A simple sample app for the Messaging App project at branch.co
We assume you have the following installed already:
- Python 3 (we tested with 3.7, the latest major version as of April 2019), including the virtualenv tool. Installation instructions here
- Postgres (we used Postgres 10.4, but newer or older versions should also work). Installation instructions for all platforms can be found here. Alternatively, a simple SQLite database could also work.
- Clone the repo and navigate into the top-level directory.
- Create a virtual environment (venv) for installing Python packages, then activate it and install all required packages:
virtualenv venv
source venv/bin/activate
pip install -r requirements.txt
- Make sure that Postgres is running:
ps x | grep /bin/postgres
should return something along the lines of/usr/local/opt/postgresql/bin/postgres -D /usr/local/var/postgres
. If it isn't, follow installation and troubleshooting instructions above. - Create the database:
createdb customer-service-messaging
(depending on how you installed Postgres, thecreatedb
tool may not be in your PATH. If you installed Postgres.app, you can point directly at/Applications/Postgres.app/Contents/Versions/latest/bin/createdb
) - Run the setup script:
python init_db_and_populate_with_testdata.py
- Start the server:
FLASK_APP=app.py FLASK_DEBUG=1 ./venv/bin/flask run
- Navigate to http://localhost:5000/admin/customers to see the agent interface.
- Navigate to http://localhost:5000/customer_test to submit customer messages.