NationBuilder is a radical and fun new way to run your country, state, city, neighborhood, corporation or non-profit completely democratically with thousands of people over the internet.
NationBuilder is coded with Ruby on Rails 2.3.2, and released under the MIT License, the same as Ruby on Rails.
Installation instructions for Heroku
Heroku is a unique and very easy to use hosting platform designed specifically for Ruby applications. This is the easiest way to get started.
Create a Heroku account: http://heroku.com/signup
Install the Heroku gem:
sudo gem install heroku
Clone a copy of NationBuilder on your local machine.
git clone git://github.com/jgilliam/nationbuilder.git cd nationbuilder
Decide the URL you want. At first, your site will live at SITE_NAME.heroku.com. So just decide what you want your SITE_NAME to be and replace that throughout these install instructions. If you have your own domain you want to use, that comes soon.
heroku create SITE_NAME git push heroku master
You should get an error now from heroku “App crashed during startup, see the crashlog.” This just means we need to load the database.
heroku rake db:schema:load
If you don’t have your own domain yet, you can skip this step. For your own domain, create a CNAME in your DNS settings that points to “proxy.heroku.com”. Once that’s in, run this:
heroku addons:add custom_domains heroku domains:add YOUR_DOMAIN_NAME heroku config:add DOMAIN='YOUR_DOMAIN_NAME'
If you AREN’T using your own domain, then just run this:
heroku config:add DOMAIN='SITE_NAME.heroku.com'
Now add a few addons. Memcached provides caching, and Sendgrid is a third party email service that allows you to send emails from a cloud computing service like Heroku.
heroku addons:add memcached heroku addons:add cron:daily heroku addons:add sendgrid
You need an Amazon S3 account to store graphics, get that here.
heroku config:add S3_ACCESS_KEY_ID='YOUR ACCESS KEY' heroku config:add S3_SECRET_ACCESS_KEY='YOUR SECRET ACCESS KEY'
NationBuilder makes extensive use of the DelayedJob plugin, which costs $15/mo from heroku. You can still get up and running and play around without installing DelayedJob, but the rankings will never update and a few features will not work. To install DelayedJob just do this:
heroku addons:add dj heroku rake jobs:enqueue
Now go to http://SITE_NAME.heroku.com
The first screen will ask you for a few basic things about your nation, and help you create an admin account. Once you’re through with that, you’ll be ready to go. There are a lot more settings under Settings > Nation Settings. Colors, email templates, etc.
To enable Facebook integration:
Go to the Facebook developer application and create a new application. Under “Connect” options, be sure to put the domain you are using. Get the API key and secret key and add it to heroku like this:
heroku config:add FACEBOOK_API_KEY='YOUR API KEY' heroku config:add FACEBOOK_SECRET_KEY='YOUR SECRET KEY' heroku rake facebook:register_templates
To enable Twitter integration, you need to get your API keys here.
heroku config:add TWITTER_KEY='YOUR API KEY' heroku config:add TWITTER_SECRET_KEY='YOUR SECRET KEY'
For Yahoo mail and Windows Live contact importing, you set the API keys under Settings > Nation Settings > API Keys
To enable search:
heroku config:add WEBSOLR_URL='http://urlofyoursolrserver/solr' heroku restart heroku rake solr:reindex
Heroku is planning to have a better way of using Solr soon.