Home sharing app for Hillary Clinton supporters
Ruby HTML JavaScript CSS CoffeeScript
Clone or download
Pull request Compare This branch is 181 commits ahead, 42 commits behind SandersForPresident:master.
Latest commit a839cc8 Nov 23, 2016
Failed to load latest commit information.
app HillaryBNB -> MarchBNB Nov 23, 2016
bin Started generalizing/i18n (step 1) Apr 17, 2016
config Removed default host listing date range so must be explicitly set. Oct 17, 2016
db adds sent column to contacts table Oct 17, 2016
doc Update facebook-privacy-statement.txt Nov 22, 2016
lib adds code and specs to update the contact.sent attribute when sending an Oct 17, 2016
log Create Rails project. Dec 18, 2015
public new favicon thanks @rschroed! Oct 18, 2016
spec Allow visit start_date to be one day in the past to account for Oct 17, 2016
spring-1000 Remove references to devise from project. Dec 23, 2015
vendor/assets install moment using bower Feb 24, 2016
.cane Fixed a few cane msgs Jan 1, 2016
.dockerignore set RAILS_ENV to development in development. Jun 30, 2016
.gitignore ignore DJs prod config Oct 11, 2016
.rspec fixed test to be independent of each other and changed rspec file to … Feb 2, 2016
.ruby-version getting CircleCI to work Oct 13, 2016
Bowerfile install moment using bower Feb 24, 2016
Dockerfile getting docker and heroku to play nice, work in progress Jun 29, 2016
Gemfile yay appcanary, warned us about some vulnerabilities Oct 11, 2016
Gemfile.lock yay appcanary, warned us about some vulnerabilities Oct 11, 2016
Guardfile Some devise configuration. Dec 22, 2015
LICENSE.txt remove lots of bernie. Jun 29, 2016
Procfile Added Procfile for puma setup Jan 4, 2016
README.md more setup help for new dev Oct 13, 2016
Rakefile Added i18n_spec gem and specs Apr 19, 2016
app.json getting docker and heroku to play nice, work in progress Jun 29, 2016
circle.yml goodbye travis hello circleci Oct 13, 2016
config.ru Create Rails project. Dec 18, 2015
docker-compose.yml persist dev database between restarts Oct 11, 2016
package.json Add missing comman in package.json Jul 3, 2016



We want to build an app to allow supporters to share their homes with others from out of town and to help supporters on the road find lodging.

How We're Doing It

  • Rails 4.2.5
  • Devise/ Omniauth for authentication with Facebook and google
  • Geocoder gem to search by zipcode, using Bing geocoding API.
  • Bower for front end asset management


Please e-mail dsjoerg@gmail.com. We would love your help.

Setting up development

  • install Docker Toolbox
  • fork HillaryBNB on github: git clone git@github.com:<your github username>/HillaryBNB.git && cd HillaryBNB
  • cp config/application.yml.example config/application.yml
  • export RAILS_ENV=development
  • docker-machine create -d virtualbox default
  • eval $(docker-machine env default)
  • docker-compose build
  • docker-compose up -d web
  • open "http://$(docker-machine ip default):8080"
  • git remote add upstream https://github.com/DevProgress/HillaryBNB so you can keep in sync with original project by running git pull upstream master.
  • Run tests: RAILS_ENV=test docker-compose run --rm shell bash -c 'bin/rake db:migrate && bin/rake'
  • Populate test data: docker-compose run --rm shell bash -c 'bundle exec rake db:reset'
  • Rebuild and restart (not always required; DJ unclear on which kind of changes require it): export RAILS_ENV=development; docker-compose down && docker-compose build && docker-compose up -d web

Updating gem versions

  • docker-compose run --rm shell bundle update [gemname]

Modifying schema

  • EXAMPLE: docker-compose run --rm shell rails generate migration AddAccomodationTypeToHosting accomodation_type:integer

Connecting to dev DB

  • docker-compose exec herokuPostgresql psql -U postgres

Deploying to Heroku

  • install Heroku Toolbelt
  • heroku plugins:install heroku-container-tools
  • get application.yml from DJ and put it in config/
  • heroku container:release --app hillarybnb NOTE that this deploys whatever you have locally in your dev environment, not what is committed to git or pushed to github

If there are database migrations to be deployed:

  • heroku run rake db:migrate

  • heroku restart

  • heroku open --app hillarybnb

Sending daily emails

You should set up the following to run periodically (daily was what BernieBNB did):

  • heroku run rake clear_past_dated_visits
  • heroku run rake send_new_contacts_digest
  • heroku run rake send_new_hosts_digest WARNING do not run heroku run rake, it will happily delete the entire database! <---- TODO fix this so it cant happen in production

Setup local hostname

Google OAuth only allows hostnames for its OAuth URLs. Setup a local hostname that points to your docker machine


  • Run docker-machine ip default to find your docker machine IP
  • Copy that into /etc/hosts and give it whatever hostname you want (ex. hbnb.com)
  • Visit hbnb.com:8080 to verify it works

Setting up Facebook/Google/Bing connections

Configure values for the variables below in config/application.yml:

Setting up Mailgun

A mailgun account is required to send the confirmation email when signing up.

  • Go to Mailgun and sign up for an account
  • You will start with a sandbox account with up to 300 emails per day, or you can create a real one with 10k free emails per month.
  • Go to your sandbox domain page to fill out all the MAILGUN_* variables in config/application.yml
    • In config/application.yml, set MAILER_URL to the result of echo $(docker-machine ip default):8080
    • Go to the main page and search for API Keys to find your public key.
  • Restart docker-compose restart web
  • If you see a 400 error from Mailgun, check your logs. Mailgun may disable your account pending business verification; you'll need to contact support to have them enable it or borrow someone else's sandbox credentials if they don't respond.

When does HillaryBNB send emails?

As of 20161010, HillaryBNB.com sends emails nightly. Every night at 3:30/4am Eastern time we do the following:

For each Hosting Offer registered in the system, if there are any visitors who clicked the "SEND MY CONTACT INFO" button within the past 24 hours, we gather their contact information and email them to the the host. (Note that this means a host may receive multiple emails from us if they have multiple Hosting Offers). (This logic is in https://github.com/DevProgress/HillaryBNB/blob/master/lib/tasks/send_new_contacts_digest.rake)

For each Visit registered in the system, if there are any new Hosting Offers created within the past 24 hours that are within 20 miles of the Visit's zip code, we email them to the visitor. (Note that this means a visitor may receive multiple emails from us if they have multiple pending Visits). (This logic is in https://github.com/DevProgress/HillaryBNB/blob/master/lib/tasks/send_new_hosts_digest.rake)