- Ruby 1.8+ (tested on Ruby 1.8.7)
- RubyGems 1.3.6+ (tested on RubyGems 1.3.6)
- Bundler 0.9.26
Get the Bundler:
$ sudo gem install bundler --version=0.9.26
Get the sources:
$ git clone git://github.com/trustthevote/DCdigitalVBMdist.git
Install gem requirements:
$ cd DCdigitalVBMdist
$ bundle install
Configure the database (change your username / password):
$ cp config/database.yml{.sample,}
$ rake db:setup
Configure the application:
$ cp config/config.yml{.sample,}
Start the application:
$ script/server
If you want to try it with Sqlite3 instead of MySQL, follow these steps:
Change Gemfile to contain:
gem 'sqlite3-ruby'
... instead of:
gem 'mysql'
Install gems:
$ bundle install --relock
Change database.yml to:
development:
adapter: sqlite3
database: db/development.sqlite3
pool: 5
timeout: 5000
Initialize database with:
$ rake db:setup
Start the application:
$ script/server
Before you start, make sure that you have:
- Server IP or domain name you are going to deploy to
- User account on that server
- Empty database and username / password to use
- Apache with Passenger installed on the server
Install Capistrano and Capistrano Ext gems (tested with versions 2.5.19 and 1.2.1):
$ sudo gem install capistrano capistrano-ext
Create the app folder by SSH'ing into the server and creating the directory in your deployment user home (we'll assume it's dc_digital_vbm).
Depending on whether it's your Staging or Production environment, open the config/deploy/staging.rb or production.rb and put in your domain, user and runner info (user and runner are likely to be the same). Next, open config/deploy.rb and change application to the name of the folder that you created under your home.
In the commands below replace with whatever environment (production or staging) you chose to deploy to.
Initialize your application:
$ cap <env> deploy:setup
$ cap <env> deploy:config:db -s dbname=<db> -s username=<dbu> -s password=<dbp>
$ cap <env> deploy:config:app -s email=<email> -s domain=<domain>
... where:
- db, dbu, dbp -- your database name, username and password
- email -- support email address that will appear in From fields of letters from the app
- domain -- domain name the app will be accessible from (i.e. dcdvbm.com)
Perform a cold install:
$ cap <env> deploy:cold
Finally, create a VirtualHost entry in your Apache config and point the DocumentRoot to the public folder of your app.
During the normal operation the application records different milestones in user activity, such as:
- Checking in and confirming identity
- Finishing the workflow by entering the Thanks page
- Uploading ballot
At any moment, you can request live statistics by invoking a command-line task:
$ rake vbm:stats
The sample output is:
$ rake vbm:stats
Total number of voters : 3201
Inactive : 3200 ( 99.97%)
Used the system but not finished : 0 ( 0.00%)
Used the system and finished : 1 ( 0.03%)