Skip to content
This is the code base for the UK Government's e-petitions service (https://petition.parliament.uk)
Ruby HTML CSS Cucumber Other
Latest commit 5e0e785 Apr 22, 2016 @alanth alanth Merge pull request #459 from alphagov/change-debate-wording
Change 'To be debated on' to 'Scheduled for debate on'
Failed to load latest commit information.
app Change 'To be debated on' to 'Scheduled for debate on' Apr 22, 2016
bin Fix Appsignal when used with multiple DJ workers Sep 8, 2015
config Change 'To be debated on' to 'Scheduled for debate on' Apr 22, 2016
db Remove obsolete country columns Feb 21, 2016
features Merge pull request #446 from alphagov/fix-admin-login-redirect-in-dj-web Mar 2, 2016
lib Fix migrations task for country petition journals Feb 17, 2016
public Enable Google Webmasters analytics access Oct 30, 2015
spec Change 'To be debated on' to 'Scheduled for debate on' Apr 22, 2016
vendor/assets/javascripts Modify details polyfill to make hash urls open details elements Jul 31, 2015
.env Pull site defaults from environment variables Jun 17, 2015
.env.development Use explicit env var for moderation host Jul 7, 2015
.env.test Use explicit env var for moderation host Jul 7, 2015
.gitignore [debate_outcome_image_105664380] Add support for the debate-outcome i… Jan 8, 2016
.rspec Update testing configuration Apr 28, 2015
.travis.yml Run specs on Ruby 2.2.4 Jan 13, 2016
Gemfile Merge pull request #447 from alphagov/update-to-rails-4-2-5-2 Mar 2, 2016
Gemfile.lock Merge pull request #447 from alphagov/update-to-rails-4-2-5-2 Mar 2, 2016
LICENCE.txt Correct copyright notice Feb 16, 2015
README.md document creating of user epets to setup development environment Apr 13, 2016
Rakefile Update testing configuration Apr 28, 2015
config.ru Tweak application to boot on Rails 4.2 Apr 28, 2015

README.md

Petitions

This is the code base for the UK Government's petitions service (https://petition.parliament.uk). We have open sourced the code for you to use under the terms of licence contained in this repository.

We hope you enjoy it!

A few things to know:

  • You will need ruby 2.2.2
  • You will need PostgreSQL and Memcached

Set up your development environment

  • Clone the repo to your local machine
  • Install postgres. Easiest with homebrew using brew install postgres
    • If you like you can add postgres to your LaunchAgent. Follow instructions at end of console output
  • Set up your dev and test databases
    • $ psql postgres
    • # CREATE DATABASE epets_development;
    • # CREATE DATABASE epets_test;
    • # CREATE USER epets;
    • # GRANT all privileges ON database epets_development TO epets;
    • # GRANT all privileges ON database epets_test TO epets;
    • # ALTER USER epets WITH PASSWORD 'replace_me';
    • # \q to quit
  • You will need to set up the config/database.yml. Copy what is in config/database.example.yml and add the password you used earlier for the epets postgres user
  • $ rake db:structure:load - load the sql structure into your new databases

Run the app

  • rails s

Other info

  • If you want jobs (like emails) to be run, use $ rake jobs:work
  • For setting up a sysadmin user
    • rake epets:add_sysadmin_user - to set up an admin user with email 'admin@example.com' and password 'Letmein1!'
    • go to /admin and log in. You will be asked to change your password. Remember, the password must contain a mix of upper and lower case letters, numbers and special characters.
Something went wrong with that request. Please try again.