Skip to content

damian-lienhart/political-representation-dashboard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

65 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Political Representation Dashboard

A web dashboard visualizing the alignment between Swiss political institutions (Parliament, Bundesrat, political parties) and the Swiss public, based on data from the Swissvotes dataset.

Developed as part of a student project at Berner Fachhochschule (BFH).


Features

  • Visualizations showing agreement between institutions and public votes
  • Party and canton-based filtering
  • Choropleth map of cantonal representation
  • Multilingual UI (DE, FR, IT, EN)
  • Automated daily data fetching from Swissvotes

Technologies

Frontend (Vue 3 + Vite + D3)

  • Vue 3, Vue Router, Vue I18n
  • D3.js for data visualization
  • Tailwind CSS for styling
  • TypeScript

Backend

  • Node.js, Express
  • PostgreSQL (with Docker)
  • Axios, csv-parser, node-cron
  • TypeScript + Vitest

Setup Instructions

This deployment works on macOS, Linux, and Windows (via Git Bash or WSL).

On macOS, the script uses Colima instead of Docker Desktop. Colima is automatically installed if Docker is not already running, making the setup lightweight and M1/M2-compatible. Colima is a container runtime for macOS that replaces Docker Desktop and integrates well with the Docker CLI.

1. Download the deployment script

curl -O https://raw.githubusercontent.com/damian-lienhart/political-representation-dashboard/main/deploy-server.sh

2. Make it executable (macOS, Linux, WSL, Git Bash)

chmod +x deploy-server.sh

3. Run the deployment script

./deploy-server.sh

Windows users: Please use Git Bash or WSL (Windows Subsystem for Linux) to run the script. Do not run it in Command Prompt or PowerShell.

Frontend: http://localhost:8080
Backend API: http://localhost:3000/api


Data Synchronization

The backend automatically fetches updated vote data every 4 hours using a cron job.

To manually trigger a data update:

docker-compose exec backend npm run update-data

Backup

Database Backup

Create a snapshot of the PostgreSQL data:

docker-compose exec db pg_dump -U postgres political_dashboard > backup.sql

Data Source

This project uses data from the Swissvotes dataset, which is licensed under the Creative Commons Attribution 4.0 International (CC BY 4.0) license.
Source: Swissvotes (2024), Année Politique Suisse, University of Bern. This dataset is regularly accessed via automated fetches. For the most recent access date, refer to the backend logs.


Project Team

  • Damian Lienhart
  • Sujal Singh Basnet
  • Project supervised by Dr. Simon Kramer (BFH)

License

This project is licensed under the MIT License – see LICENSE for details.

All dependencies are open source and MIT-compatible – see package.json for exact versions.

Note: While this codebase is MIT-licensed, it integrates open government data under CC BY 4.0. If you reuse this project and include the data, please ensure you also comply with the attribution terms of the Swissvotes dataset.

About

No description, website, or topics provided.

Resources

License

Stars

2 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors