Skip to content

ebezzam/codevscovid19

Repository files navigation

CodeVsCovid19 project

Setup

  1. Add following environment variables to use Twilio. E.g. on macOS, open your bash profile:
vim ~/.bash_profile 

And add the following lines with your values:

export TWILIO_SID=[YOUR_SID]
export TWILIO_TOKEN=[YOUR_TOKEN]

Enact changes:

source ~/.bash_profile
  1. Get an API key from LocationIQ: https://locationiq.com/

Add it to your environment variables:

vim ~/.bash_profile 

And add the following lines with your values:

export LOCATIONIQ_TOKEN=[YOUR_KEY]

Enact changes:

source ~/.bash_profile
  1. Create virtual / Conda environment:
virtualenv -p python3 venv 
  1. Install in your environment:
source venv/bin/activate
pip install -e .
  1. Install ngrok to setup light webserver. Follow steps here: https://ngrok.com/download

Running webserver for webhook

Largely following this tutorial: https://www.twilio.com/docs/sms/quickstart/python-msg-svc

  1. Start local server
python run_server.py
  1. ngrok magic
ngrok http 5000
  1. Copy ngrok URL (with the `/whatsapp) in the "WHEN A MESSAGE COMES IN" box: https://www.twilio.com/console/sms/whatsapp/sandbox

Setup landing page for signup

Taking ideas from this tutorial: https://medium.com/@dushan14/create-a-web-application-with-python-flask-postgresql-and-deploy-on-heroku-243d548335cc

  1. Install PostGres: https://thecodersblog.com/PostgreSQL-PostGIS-installation/
brew install postgres
brew install postgis

Create databases:

createdb covid19
createdb clients

Enter:

psql -d covid19
  1. Install Heroku: https://devcenter.heroku.com/articles/heroku-cli#download-and-install
brew tap heroku/brew && brew install heroku

Make and account and login:

heroku login

Docs for Flask SQL: https://flask-sqlalchemy.palletsprojects.com/en/2.x/queries/ Docs for Bootstrap (framework for website): https://getbootstrap.com/docs/4.4/components/forms/#checkboxes-and-radios

Get entries from dataset

sqlite3 volunteers.db   # .exit to quit
sqlite3 clients.db      # .exit to quit

To delete

rm *.db

launch:

python manage.py runserver

Get entries from dataset

Add password to environment variable COVID19_TOKEN.

Get it from Eric.

Endpoint:

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors