Petitions is a web app for viewing UK Parliament petition data.
The UK's Parliamentary Petitions website is like change.org for political issues affecting the UK. Any UK resident can create a petition and, providing they get enough signatures, have their issue debated in Parliament. This app shows signatures broken out by country and by parliamentary constituency. Try it out here.
Petitions is made with Elm and Sass. The easiest way to build it is with the provided NPM scripts (also compatible with Yarn). But if you don't have NPM/Yarn, it's easy enough to build the project manually.
Start by cloning/downloading the repo. Then do one of the following:
- Run
npm install
(oryarn
) in the root directory to install Elm, Sass and other build dependencies - Run
npm start
(oryarn start
) to build the project and serve it from localhost:8080 - For development, run
npm run watch
(oryarn run watch
) which is the same as the start command but with live reloading whenever the Sass/Elm source files change
- Make sure you have Elm and Sass installed
- Create a build folder for the project
- Copy the contents of
static
to your build folder - From the project root, compile the Elm code with
elm-make --output=path/to/build/folder/assets/js/elm.js src/elm/Main.elm
- Compile the Sass files with
sass src/scss/styles.scss:path/to/build/folder/assets/css/styles.css
- You can now serve the project from your build folder (or navigate to the files directly with file:https:///path/to/build/folder/index.html)
- Petition search
- Indicate closed/rejected status in the petition title
- Indicate totals mismatches on the summary page
- Indicate government/parliament response status on the details page
- Browser history and titles (see Elm's Navigation package, History API, document.title)
- Transitions between screens
- Provide a "Try again" link if a petition fails to load
- Handle edge cases sensibly (e.g. no signatures, one signature, all signatures in one country)
- Warn user if localStorage is unavailable
- Add remove/clear links to petition lists
- Tests
- Uglify Elm JS
- Make sure the build scripts work on Windows
Petitions is provided under an MIT License. See the LICENSE file for details.