Skip to content

CodeForFoco/CERP-backend

Repository files navigation

Community Elections Resources and Polling Tool (CERP)

Build Status Coverage Status

The backend for the CERP project. See CERP-webview for the frontend.

Provide information on local elections, politicians, issues, and political outcomes. Visualize and share results.

Election information should be available to citizens in an easy to understand, fun to explore, and overall interesting way so that our community can better understand itself and its political past, present, and future.

Election Information

Larimer County provides information about elections at a precinct level, but the information is provided as a table of statistics. We are striving to improve the explorability of the data by building a website that lets Larimer County citizens view results on a map, compare precincts, and discover ways to reach out to elected officials.

Detailed Project Requirements

  1. Show election information on a heat map of precincts in Larimer County.
  2. Display all election outcomes for a precinct on the same page.
  3. Allow different "views" of the data to be shared via hyperlinks.

Getting Started

This project has two parts:

Initial Steps

These steps only need to be performed once.

Verify Required Applications

Although the manage application is OS-agnostic, it assumes that the current version of Python (~3.6) and all packages for the application are installed correctly and exist in your current $PATH.

Dependencies/Packages

To get started on a Linux or Linux-like environment (e.g. OS X), create a Python virtual environment and install the project's requirements:

python3  -m venv venv
. venv/bin/activate
pip install --upgrade pip
pip install -r requirements.txt

You can read about virtualenv here.

Developing

Once you have completed the initial setup steps above, follow these instructions to start developing.

Start the Server

Whenever you want to view or develop the application, activate the Python virtual environment then start the Flask server:

. venv/bin/activate
python manage.py run

# OR alternate shorthand/alias
python manage.py r

Tests and Coverage Report (as needed)

To periodically run Python tests:

python manage.py test

# OR alternate shorthand/alias
python manage.py t

To generate a coverage report:

python manage.py coverage

# OR alternate shorthand/alias
python manage.py c 

Contributing

We welcome new contributors. Be sure to check out guide on contributing, which includes instructions on how to fork, clone, branch, commit, pull request and sync your fork.

Not sure where to start? Look for open issues on GitHub, or message the team on our Slack site. If you aren't on our Slack, click here for an invite.

TL;DR Contribution Workflow:

  1. Fork this repository and Clone your fork locally.
  2. Checkout a new branch on which to make your changes.
  3. Make edits. Try to match existing coding style.
  4. Test your changes.
  5. Commit your changes. Push your changes to your fork on GitHub.
  6. Submit a new pull request and your changes will be reviewed and merged.

Bugs / Feedback / Suggestions

We encourage you to open up an issue if you have any feedback, suggestions or bugs.

License

MIT, see LICENSE for full license.