With the midterm elections coming up we wanted to build a tool to help voters be aware of their representation within the government and that all begins with knowing your congressional district.

The application help the user find their valid US address, reverse-geocode said address then find intersections in an indexed collection of MongoDB 2dsphere MultiPolygons in order to find the user's congressional district.

We began with a simple Vue SPA that utilized Here's address completion api, then moved on to creating an Express.js backend server that upon opening our DBInstance rams all 435 congressional districts into a district collection and creates a 2dspere index. After doing that it was fairly easy to accept url queried GET requests with the geocoded longitude and latitudes of the user. Then came the deployment of the application on gcp with their VPS instance.

We at first had a steep learning curve for the iOS application and forgot how node.JS concurrency wroked, but after that it only got harder because Mongoose is very particular with representing MultiPolygon boundaries as [[[[Number]]]] not [[[Number]]]... (took over four hours to get it to agree with us). Then apparently mutilated the DNS records by deleting the NS records and GCP's VPSs were a unfamiliar technology. Additionally, we query a github repo for ever US district GeoJSON and while first writing this up node was making over 1000 requests every time it ran and we hit rate limits.

We are proud to have to have battled through an entire night of phantom bugs both on the web side and mobile side. But most importantly we are glad we were even able to get beyond the halfway mark of the project's goals by provide a pretty smooth UX.

We learned Swift, HTTP requests on iOS, how to configure nginx to bypass_proxy localhost servers, utilize Vuex for web application state management and how to bypass github rate limits by switching networks like a madman.

A long team nap and providing information about users' district representatives rather than having them search it up after finding out their district.

Built With

Share this project:
×

Updates