Skip to content

van-sprundel/partijgedrag

Repository files navigation

Partijgedrag

Partijgedrag is a web application that provides insight into the voting behavior of political parties in the Dutch parliament. It was originally created by Elwin Oost and later rebuilt in TypeScript.

Project Structure

This repository is a monorepo containing three main components:

  • app/: The web application, split into a frontend and a backend.
    • frontend/: A React/TypeScript frontend built with Vite.
    • backend/: A Node.js/TypeScript backend using Express, node-pg and SafeQL.
  • etl/: A Go application responsible for extracting, transforming, and loading the voting data into the database.
  • docker-compose.yml: Defines the services for the application, which for now is only the PostgreSQL database.

Screenshots

Details image image image image

Development Setup

Prerequisites

  • Docker and Docker Compose
  • Go (version 1.21 or higher)
  • Node.js (version 18 or higher)

1. Start the Database

The application requires a PostgreSQL database. You can start one using Docker Compose:

docker compose up -d

or Podman

podman compose up -d

This will start a PostgreSQL server and expose it on port 5432.

2. Load the Data (ETL)

The etl service fetches and processes parliamentary data.

  1. Navigate to the ETL directory:
    cd etl
  2. On the first run, seed the database:
    go run cmd/manage_categories/main.go --action=seed
  3. Run the ETL process:
    go run cmd/etl/main.go

3. Run the Application

The app is split into a backend and a frontend, which are separately for development.

App

  1. Navigate to the app directory:
    cd app
  2. Install dependencies:
    npm install
  3. Set up your environment variables:
    cd backend; cp .env.example .env; cd ../frontend; cp .env.example .env; cd ..

Ensure the DATABASE_URL in the new .env file is correctly configured for your environment.

  1. Start the app server:

    cd -; npm run dev

    The backend will be running on http://localhost:3001.

    The frontend will be accessible at http://localhost:3000.

Acknowledgements

This project uses open data provided by the Tweede Kamer der Staten-Generaal (Dutch House of Representatives). For more information about the data sources and API documentation, visit https://opendata.tweedekamer.nl.

About

Partijgedrag 2.0

Topics

Resources

License

Stars

Watchers

Forks

Contributors 3

  •  
  •  
  •  

Languages