Political engagement is one of the few truly nonpartisan issues in our country. Since this weekend was inauguration weekend, we thought it made sense to make a website that helps voters stay informed while also allowing them to keep in touch with their elected officials.

What it does

Ballot Builder is a website that allows users to find out how who their U.S. Senators and Representatives are and get their contact information. Currently, the app only allows users to view their federal representatives, but the framework is in place to add state and local representatives, as well as information about upcoming elections and polling locations.

How I built it

The HTML code for our website is based on a template from Free CSS that we then edited to add our own content and color palette. Our website uses cookies to determine if a user has been to our website before so that we can redirect them to the address page if necessary. The address page allows the user to input their zip code so that we can determine what congressional district they live in and thereby who their representatives are. If the user has visited the page before, they just go straight to the index page to view their representatives.

We also wrote a Python script that parses the U.S. Congress website and extracts information about all the representatives. The script gathers information about all 541 members of Congress and outputs it into a database. While convenient, it is also quite time-consuming to run, so the website is only meant to run it when it needs to - so whenever that data changes after an election.

We wrote another script that parses HTML, but this time, in JavaScript. This script was used to get information from a Congress API that determined district from either latitude/longitude coordinates or a zip code.

Challenges I ran into

We have limited experience with JavaScript, so getting familiar with that language was a struggle for us when we were parsing HTML with it. We also had a hard time getting our website and our server set up and communicating with each other properly. We unfortunately lost a lot of time just trying to get our website active, which set us back more than we would have liked.

Accomplishments that I'm proud of

Our Python script that parses HTML code took a great deal of time and effort to get running properly, so that's definitely something we feel deserves recognition. Although it certainly has room for improvement, we're proud that we were able to get it done in such a short time frame.

What I learned

Aside from the fact that there are 6 non-voting members of the US Congress and Senators don't have districts, we learned how parsing html works in both Python and JavaScript. It's interesting to know how the same processes work across different languages. We also learned that Ubuntu's documentation is not nearly as thorough as ArchLinux. This often made our work more frustrating as we were trying to set up our website. We enjoyed working with Amazon Lightsail, as it was a lot easier to set up than we thought it would be and comes with a wide variety of apps that are supported out of the box. Managing it was really simple, and it integrated well with all of Amazon's other web services.

What's next for Ballot Builder

In the future, we would like to add state and local representatives to the app, as well as information about upcoming elections and polling locations.

Built With

Share this project: