Champaign is an open source digital campaigning platform built by SumOfUs. It's designed to streamline campaigner workflows creating and iterating on pages, while also providing tools for deep customization of layouts and functionality, all through the web interface. At it's core, Champaign is a CMS to easily create petitions, fundraisers, social-media shares, and surveys, and to record member responses to these action pages. It is also designed to be extensible, allowing developers to contribute new page functionality.
Champaign is also designed with a focus on performance, reliability, maintainability.
- Performance: In the SumOfUs production deployment, 95th percentile response times for member-facing pages are 120ms, +/- 20ms.
- Reliability: The test suite covers 92% of the ruby code with more than 2300 unit and integration specs.
- Maintainability: Champaign code has been guided strongly by the single responsibility principle and consequently has skinny controllers, skinny models, and many service classes. The continuous integration also runs code analyzers, including the Rubocop and CodeClimate style checkers.
This is the second digital campaigning CMS developed under direction SumOfUs. The previous system, ActionSweet, still powers several other digital campaigning organizations. Champaign was designed to specifically alleviate issues present in ActionSweet and manifests the lessons learned over 5 years of running online campaigns.
If you're interested in collaborating on the project with us, or have ideas or recommendations, please get in touch!
- Install gem dependencies by running
gem install bundlerand then
- Install node dependencies by running
- Setup your db connection by running
cp config/env.template.yml config/env.ymland edit
config/env.ymlwith your development database information.
- Create the development databases:
bundle exec rake db:create
- Run migrations:
bundle exec rake db:schema:load
- Run the seed task:
bundle exec rake db:seed
- Run the test suite to make sure everything's setup correctly:
bundle exec rake spec
Configuration files are under
config/settings directory. There's one
config file per environment: production, test and development. All keys
defined in these YAML files will be accessible via
You can override configuration variables during development by creating
Champaign integrates seamlessly with ActionKit. The integration works via events that are triggered from Champaign and are then captured by a separate service: champaign-ak-processor, which in turn updates ActionKit via its API. Champaign events are delivered using AWS SNS/SQS.
Despite having this external service to communicate with ActionKit,
Champaign still needs to access ActionKit's API directly in a couple of
cases, that's why you'll need to configure AK credentials in order to
run Champaign. You'll be able to do this using environment variables
in production, or overriding the proper keys in
Braintree & GoCardless integration
Champaign accepts donations by integrating with Braintree for credit card, debit card, and Paypal payments, and GoCardless for direct debit. To get these integrations working you'll have to setup the proper credentials by setting environment variables on your production environment.
If you use a separate endpoint to fetch your Braintree tokens, you can point to it by updating
the env.yml with your
BRAINTREE_TOKEN_URL. By default, Champaign will use its own token
endpoint which could degrade performance, so it's recommended that you use a separate service where
Development Setup using Docker
- Install Docker - for detailed instructions, go here.
- If you're using OS X, install Docker and Boot2Docker together via homebrew:
brew install boot2docker
- If you're using a Linux system, you can install Docker natively via:
sudo apt-get install dockeror similar for RH-based systems.
- to check if you already have it, you can type
VBoxManageat the command line.
Clone the project to your local system using git
Set up the docker VM
boot2docker up. Add the bash variables output by
boot2docker upto your
~/.bash_rcand reload the terminal.
- create a file to hold the web enviroment by running
- Setup and start Rails
docker-compose buildThis will take a few minutes to download the relevant containers and install ruby gems.
cp config/env.yml.template config/env.yml.
env.ymlwith valid keys.
- Create the database by issuing
docker-compose run web rake db:createand load the tables by issuing
docker-compose run web rake db:schema:load
- Seed db with liquid templates:
docker-compose run web rake champaign:seed_liquid
docker-compose upThis will start the application running in the docker container.
- Check that it's running
- If you are on Linux, you can check that the application is running by visiting localhost with the specified port (at this time,
- If you are on OS X, you will need to retrieve the IP of your Docker vm by running
boot2docker ipon the command line. (On most machines, this seems to be
- On OS X, visit
http://boot2docker_ip:port(or the equivalent result of
boot2docker ipwith port 3000) in your browser to see the application running.
- Run the tests
docker-compose run web rspec spec