/open-disclosure

A web app to track campaign finances for the General Election (November 3, 2020) in San Jose & South Bay California

Primary LanguageJavaScriptGNU General Public License v3.0GPL-3.0

Open Disclosure

A web app to track campaign finances for the California Primary Election (March 3, 2020), and the General Election (November 3, 2020). The goal of Open Disclosure is to help voters understand who/what Political Action Committees (PACs) are donating money to the candidates/measures. Are the donors from the same jurisdiction (city/county/state) as the candidate's intended office or outside of the jurisdiction? Are the donors individuals, or Political Action Committees (PACs)? What is the donor history of the PAC(s)?

View the currently deployed version of our web app: https://open-disclosure.codeforsanjose.org/

We are inspired by Open Oakland's Open Disclosure: https://www.opendisclosure.io

Initially this project will cover City of San Jose elections and later will broaden to cover elections more widely.

Resources

California Election Information:

San Jose voters will vote on November 3, 2020 for 5 Councilmembers in Districts 2, 4, 6, 8 and 10. More information can be found here. This project aims to cover the finances for these candidates in Version 2, from January 2020.

The Presidential Primary Election is on March 3, 2020 in the state of California. There will be elections for:

  • President of the United States
  • United States Representative in Congress
  • California State Senator and Member of the State Assembly

After the primary, the general election will be on November 3, 2020. More information here

Frontend Development setup

  1. Install Docker Desktop

  2. Open and start Docker.

  3. Clone the project to your local machine.

$ git clone https://github.com/codeforsanjose/open-disclosure.git
  1. Go into the project folder.
$ cd open-disclosure/
  1. Build Docker images.
$ docker compose build ui
  1. Run Docker images to start local development
$ docker compose up ui
  1. Open webpage in http://localhost:8000.

How to Launch the Scraper

MacOS:

Install Python3.8 for MacOS

% cd data_pipeline/scraper
% virtualenv env
% source env/bin/activate

(env) % python3 -m pip install -r requirements.txt

(env) % python ./scraper.py

Windows:

Install Python3.8 for Windows

% cd data_pipeline/scraper
% virtualenv --system-site-packages -p python3 ./venv
% .\venv\Scripts\activate

(env) % python3 -m pip install -r requirements.txt
(env) % python3 scraper.py

The example above uses virtualenv to help create a clean working environment and help you not pollute the spaces of other python applications you may use.

How to Launch Scraper Post-Processor

Install Python3.8 for MacOS

% cd data_pipeline/data_processing
% virtualenv env
% source env/bin/activate

(env) % python3 -m pip install -r requirements.txt

(env) % python3 aggregatedcsvtoredis.py

Deploy to Prod

First, gain access to the CFSJ AWS account. You will also want to configure the CLI at this point. You can contact Darren P. or Ryan W. for help with this.

Once you have the desired code changes, use the Dockerfile to build a new image:

docker build --platform=linux/amd64 .

Then, follow This Guide to push the image to ECS.

Finally, stop any currently active tasks associated with the service (found here). This will cause new tasks to be automatically started using the newly deployed docker image.

You can access container logs if you run into any issues here.

How to Contribute

Find an issue and assign yourself

Inspired by Open Oakland's Open Disclosure
Made with <3 by Code for San José