Jamaica Votes: What I Learnt Building an Election Results Website
One of my absolute favorite things about an election is seeing the varying maps and graphics that are created to give meaning to the results. Particularly, in the US elections, you will see these interactive maps of the country, broken down by state, and states further segmented into districts, showcasing the results of past elections and even as they roll in on election night. They are usually supported with insights on voters, voting patterns and so much rich data. My creative itch made me want to replicate it for a Jamaican General Election. And whilst I admit, the execution could be improved upon, here is what I learnt building Jamaica Votes: An Election Results Website.
The Data Challenge
Quite early into the execution of this project, I realized that the success of this undertaking would heavily depend on the availability and accessibility of election data. The Electoral Commission of Jamaica (ECJ) established in the year 2006 has responsibility for the safeguarding of the country’s independent electoral process, thereby placing the access to required data under their purview.
At a minimum, I needed to understand what election data existed and in what formats. Were there any public facing APIs to ease the process? A thorough search of their website concluded with the fact that the commission posted election results strictly in PDF formats, and there were no public facing APIs or a Developer suite of tools to foster citizen innovation. My efforts to make contact with the commission via email and phone yielded no positive result.
Intent vs What was Actually Possible
In the past couple months, I have been attempting to slowly shift my approach as a developer from purely coding towards a more holistic product-focused approach. As opposed to planning my projects as I write the code, I put more thought into the effort required of the project and added greater clarity to ideas. Jamaica Votes provided a chance to execute on this approach.
Miro, the Visual Workspace Software was my choice of tool to detail a mockup for Jamaica Votes and draft a User Story Map, from which I could envision what an ideal version of the Product would be from Minimum Viable Product (MVP) to final release.
As seen in the User Story Map at the bare minimum Jamaica Votes, the user would be allowed to view past election results on a map of Jamaica, color coded by party and allow a constituency (district) on the map to be clickable allowing a breakdown of the result. And in its ideal state, would allow a user to use the map as an election simulator and view live election results as they rolled in on election night.
However due to the challenges highlighted earlier and the heavy lifting that would be required to transform the data into value, the scope of Jamaica Votes was limited. Jamaica Votes currently allows users to explore the 2020 general election results through an interactive and responsive constituency map, showing winning parties, candidate names, and vote shares for each district. Each constituency on the map is clickable to highlight its results and closest races are summarised.
Design Decisions
Jamaica Votes was designed with NextJs, Typescript with Prisma ORM handling the connection for the Postgresql database. Prisma is an Object Relational Mapper open source alternative that I would recommend for type-safe interactions with your database. It was the first time using Prisma and configuration was smooth for this light project.
Ultimately, my biggest challenge design wise was figuring out how I would render an accurate political map of Jamaica, with individually interactive districts, without having a resource intensive plugin or file format. Fortunately, I stumbled across a blog post from Jake Robbins that highlighted how I could transform an existing SVG file of a map into a similar use case like intended with Jamaica Votes. So, a shout out is due to DrRandomFactor and Furfur - Wikipedia for providing a starting point SVG file of a map of Jamaica from which I could then use Inkscape; a vector editor to tweak to my liking.
The Future of Jamaica Votes
Jamaica Votes’ future improvements and addition of other features from User Story Map rests largely on whether data from the respective agency becomes more accessible in the near future. Whilst I was able to transform the data for one general election year, it is simply not sustainable to replicate that for all the other election years. Access to data and information is one of the most fundamental drivers of innovation. I hope Jamaica continues to make strides to remove barriers to said innovation.
Projects like Jamaica Votes matter. It matters on both a civic and transparent level, especially when many democratic countries continue to struggle with voter turnout and engagement. It is my hope that this project can serve as a starting point for an initiative with a similar end goal.
If you have any questions about Jamaica Votes, feel free to send me a message on Linkedin.