- Install Postgres
- Install the dependencies and setup the databases
git clone https://github.com/tchu88/whats-happ.git
cd whats-happ
bundle install
rake db:create
rake db:migrate
rake db:test:prepare
- Setup up local environment variables in .env (see https://github.com/bkeepers/dotenv)
cp .env.sample .env
Sign up for Twilio and set your TWILIO_ACCOUNT_SID, TWILIO_AUTH_TOKEN, and TWILIO_FROM_NUMBER.
Run the test suite with the default rake task.
rake
- Create an application
You must upgrade to a production level database to run the PostGIS extension. NOTE: this is not free.
heroku create your-app-name
heroku addons:add heroku-postgresql:premium-yanari
- Set environment variables
heroku config:set SECRET_TOKEN=`bundle exec rake secret` \
TWILIO_ACCOUNT_SID=youraccountsid \
TWILIO_AUTH_TOKEN=yourauthtoken \
TWILIO_FROM_NUMBER=yourphonenumber \
TWILIO_MESSAGES_NAME=nameofyourchoosing \
TWILIO_MESSAGES_PASSWORD=yourchoiceofsecurepassword
- Set your Twilio messages request url
The /messages
route is protected by HTTP Basic Authentication. The values of TWILIO_MESSAGES_NAME and TWILIO_MESSAGES_PASSWORD can be passed from Twilio in the url you control.
https://nameofyourchoosing:[email protected]/messages
- Push the code base
Sign up for Heroku and install the Toolbelt if you haven't already.
git push heroku master
heroku run rake db:migrate
- Add publishers
Drop into the heroku console (heroku run console
) and add publisher records.
- Add the Heroku Scheduler addon
Once the addon is setup, visit the scheduler dashboard and schedule rake update_streams
to run every 10 minutes or an interval of your choosing.
heroku addons:add scheduler