Skip to content

CodeForFoco/CERP-webview

Repository files navigation

CERP-webview

Build Status Coverage Status

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

Community Elections Resources and Polling Tool

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

For a detailed explanation on how things work, check out the guide and docs for vue-loader.

Initial Steps

These steps only need to be performed once.

Verify Required Applications

This project is confirmed to work with a minimum of node 6.11.3 and npm@3.10.10. If you do not wish to install the minimum version of Node system-wide, you have a couple of options:

  • nvm (Node Version Manager) (recommended) allows you to use multiple versions of Node and npm on the same machine. Once you have followed the installation instructions, run:
    nvm install
    ...to automatically set the appropriate versions for this project.
  • Docker is a more complex alternative that will not be covered here, but feel free to use it or any other method you want.

Dependencies/Packages

Install npm dependencies:

npm install

Set the API Source

In src/config.js, uncomment the applicable option (and comment the other two) for API_LOCATION:

Option Scenario
http://localhost:5000 Front AND back end development (be sure to start the Python server first)
https://cerp-code-foco.herokuapp.com Front end development
'' Building for production. DON'T FORGET TO CHANGE CONFIG TO THIS IF BUILDING FOR PRODUCTION.

Developing

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

Start the Server

To start a local web server with hot reload (browser will refresh automatically when files are changed) at localhost:8080:

npm run dev

Running Tests

Several commands exist for periodically running various tests on the code:

  • Unit: npm run unit
  • e2e: npm run e2e
  • All: npm test

Building and Testing

Building the project is a step for individuals responsible for updating the production environment. Before running these steps, please be sure you have cloned CERP-backend as the build expects the directory.

To periodically build the project for production with minification:

npm run build

Or, to build for production and view the bundle analyzer report:

npm run build --report

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.