Real-time voting application.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
app
bin
config
db
lib
log
public
spec
vendor/assets
.gitignore
.rspec
Gemfile
Gemfile.lock
Guardfile
LICENSE
README.md
Rakefile
config.ru

README.md

Voteline

Voteline is a real-time voting application that shows voting history as a function of time.

Dependencies

Voteline was developed on Ruby v2.1 and Rails v4.1. Several gems were utilized to make development easier:

gem 'devise'
gem 'draper'
gem 'lazy_high_charts'
gem 'bootstrap-sass'
gem 'font-awesome-rails'

Installation

  1. Clone the repository.

  2. Create a /config/secrets.yml file with with your private keys for development and test. Make sure your private keys for your production environment are stored in environment variables.

    development:
      secret_key_base: 3acf07
      devise_secret_key: 3ef655
    
    test:
      secret_key_base: 6035fd
      devise_sceret_key: 8701cb
    
    production:
      secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
      devise_secret_key: <%= ENV["DEVISE_SECRET_KEY"] %>
  3. If deploying to Heroku, add your production keys to your environment variables: $ heroku config:set SECRET_KEY_BASE=1234abcd

  4. If deploying to Heroku, pick an email provider. Sendgrid is easy: $ heroku addons:add sendgrid:starter

  5. Copy the following mailer settings to your config/environment.rb file:

    ActionMailer::Base.smtp_settings = {
      :address        => 'smtp.sendgrid.net',
      :port           => '587',
      :authentication => :plain,
      :user_name      => ENV['SENDGRID_USERNAME'],
      :password       => ENV['SENDGRID_PASSWORD'],
      :domain         => 'heroku.com',
      :enable_starttls_auto => true
    }
  6. Add the sendgrid username/password details in environment variables:

    $ heroku config:set SENDGRID_USERNAME=<sendgrid_username>
    $ heroku config:set SENDGRID_PASSWORD=<sendgrid_password>
  7. Deploy. $ git push heroku master.

TODO

  • Poll admins
  • Realtime updating (websockets perhaps?)

Credits

Voteline is the product of Ryan Ringler. It was developed largerly as a pet project to continue to learn and better understand rails.

License

Voteline is licensed under the MIT License. Please see the LICENSE file for additional details.