Skip to content

Repository files navigation

Canadian Elections

Description:

The Canadian Elections project is a full-stack web application that displays highly detailed, interactive maps of Canadian elections.

View the website here: https://canadianelections.net

Users can search for a candidate or district in an election, and click on the search results to automatically zoom to the district (or district of the candidate).

All districts, candidates, parties, and elections are stored in a PostgreSQL database, and are displayed via API calls to a FastAPI service.

The database, the API, and the front-end are all running on a k3s cluster on a Linux virtual machine.

Will add previous and future elections to this project.

April 2026 UPDATE:

  • Built a PostgreSQL database to store all of the districts, candidates, parties, and elections.
  • Built an API using FastAPI to allow users to search for a candidate or district.
  • Added a "zoom to district" feature. If a user clicks on a candidate or district search result, they are automatically brought to the district.
  • All candidates in every riding are displayed in a clean table.
  • Simplified the Dockerfile, deleted unnecessary files from the repo.
  • Upgraded the Canadian Elections project from a strictly front-end website, to a full-stack web application
  • Added a Party legend (replaced previous folium legend)
  • Added a simple loading screen until the districts render
  • Added button to close the voting results table
  • Made the legend collapsable and transparent

February 2026 UPDATE:

  • Added the 1979 election to the project!

January 2026 UPDATE:

  • Added the 1965, 1968, 1972 and 1974 elections to the project!
  • Added a GitHub Action that scans for vulnerabilites in the Dockerfile.
  • Added a GitHub Action that builds the Dockerfile and pushes it to Dockerhub after merging a Pull Request to main

December 2025 UPDATE:

  • Optimized the website for search engines; every election now has its own individual web page.
  • Added the 1962 and 1963 elections to the project!

November 2025 UPDATE:

  • Added the 1935, 1940, 1945, 1949, 1953, 1957 and 1958 elections to the project!
  • Fully automated pull_voting_data.py, archived the old version of the script.

October 2025 UPDATE:

  • Added parliament charts for each currently available election! Just click the > button to see the seat makeup in parliament.
  • Added the 1900, 1904, 1908, 1911, 1917, 1921, 1925, 1926, and 1930 elections to the project!
  • Added favicons, so a maple leaf will appear for this tab in all browsers.

September 2025 UPDATE:

  • Added the 1872, 1874, 1878, 1882, 1887, 1891 AND 1896 elections to the project! You can view them under the NEW dropdown menu. Just hover your mouse over the "More" button and select an election.
  • Minified elections_style.css in the Dockerfile to decrease loading times (improve performance).

August 2025 UPDATE:

  • canadianelections.net is now LIVE! Head over to canadianelections.net to view this entire project!
  • Made the elections.html page mobile friendly. The webpage now looks great on both PC and mobile.
  • Updated Dockerfile and python scripts. They now function better.

July 2025 UPDATE:

  • Performance has been significantly improved. Loading times have decreased by 98%
  • The 1867 election has been added to the project. Huge thanks to Dr. Jack Lucas, Dr. Zach Taylor, and their team for creating and publishing the shapefiles for every federal district of every election in Canadian history.
  • A landing page was created, so now you can click a button to view any of the elections available
  • The Dockerfile was redone, so now you can host this entire project inside of a conatiner

About

The Canadian Elections project is a full-stack web application that displays highly detailed, interactive maps of Canadian elections.

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages