Coder Social home page Coder Social logo

crush2020's Introduction

Crush2020

When we crushed the midterms two years ago, we figured the formula would be easily replicated for the 2020 election. Little did we know that a pandemic would bring political organizing as we know it to a grinding halt, making many of the typical means of volunteering and supporting campaigns nearly impossible.

It’s because of this deadly serious wrench that we need democracy-supporting tools more than ever, which is why we've built Crush2020.

Much like Crush the Midterms, Crush2020 asks users a series of questions to determine their geography, their availability leading up to Election Day, the skills they can lend to campaigns, and how much money they can budget to donate to competitive races. But with the myriad challenges facing voters this year, it also helps them request absentee/mail-in ballots, keep track of important voting deadlines, and suggests alternative forms of volunteering that suit our socially-distanced world.

Development

This site is built with Gatsby.js and the US Web Design System React components

yarn install
yarn develop
go to http://localhost:8000

Data

The matching system uses data from the following sources:

  • FEC: House and Senate candidate names and reported funds raised
  • FollowTheMoney.org: Statewide and state legislative candidate names and funds raised
  • CookPolitical: House, Senate, Governor and Electoral College ratings
  • BallotPedia: State legislature seats up and current party margin
  • Mobilze.us: Volunteer links
  • ActBlue: Donation links
  • MovementVoterProject: Organization issue areas, descriptions and links
  • VoteAmerica: Voter registration forms, deadlines, and vote-by-mail information

No ownership over this data is claimed and it is included in the respository merely as a development convenience. Data from FollowTheMoney.org is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License by the National Institute on Money in State Politics.

Deployment

Crush2020.org is hosted on Netlify. Push to master and it'll go live in a few minutes.

To work on the backend functions locally, install netlify-cli

yarn start
go to http://localhost:8888

Submitted form data is stored in FaunaDB, and can be queried using their unique IDs. User contact data is stored in ActionNetwork, along with issue and interests as tags.

crush2020's People

Contributors

camdenlee avatar jlev avatar

Watchers

 avatar  avatar  avatar

crush2020's Issues

Let users scroll through organizations

We have lots more organizations that might match with a user's location and interests than can be displayed. Right now we pick a random one, but we could also have a simple horizontal scroll instead.

Reported slow loading

This is a gatsby site hosted on Netlify, but we've received reports of slow loading (up to 85 sec)

5fOqdOt4 png-large

We have Sentry performance monitoring installed, but it's not working due to getsentry/sentry-javascript#2935
Checking google analytics shows an average page load time of 2.2 sec, but doesn't report percentiles.

Add endorsements

Improve map on mobile

Currently has distinct behaviors for hover/select, which don't translate well to mobile. Also, the aspect ratio of the map works for landscape, but for portrait we should investigate alternatives (list the states alphabetically with their outlines from the SVG?)

Keep global state?

Currently using component-level state and hooks for the form, and getting weird effects if someone goes back/forward or clicks to internal links and then back to form. Consider Redux

Move candidate data to server

When we get state-leg candidates in #2, we'll have more than we want to send over the pipe for each user.
Move the data to fauna, and create a Graphql query for it in the Plan component.

Source url parameter

So we can track partner traffic and conversions. Make sure to send it all the way through to Action Network, so we can segment list later.

Tests!

The plan creation is entirely frontend based, and uses a reducer pattern to modify the react state. A decent testing framework would improve our confidence in this code.

Get state-level data

Currently using FEC download for federal candidates. Find a source (hopefully free) for state-level candidates. FollowTheMoney.org has them, but will cost $1000 for the data download. Applied for fee waiver for this open source project.

Race narratives

To give some context about why each race is interesting and winnable. We did this for Crush18, and it was very useful (but a ton of work).

TypeError: undefined is not a function

Sentry Issue: CRUSH2020-2

./src/pages/index.js in c at line 16:24
const IndexPage = () => {
  // check for source param and forward to form
  let source = undefined
  if (exists(window) && window.location.search) {
    let urlParams = new URLSearchParams(window.location.search)
    source = urlParams.get('source')
  }

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.