No description
  • PHP 84.9%
  • JavaScript 10.3%
  • CSS 4.8%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-10-15 15:21:44 +02:00
docs Initial publication 2026-10-15 (rev2) 2026-10-15 15:21:44 +02:00
web Initial publication 2026-10-15 (rev2) 2026-10-15 15:21:44 +02:00
.gitignore Initial publication 2026-10-15 (rev2) 2026-10-15 15:21:44 +02:00
config.example.php Initial publication 2026-10-15 (rev2) 2026-10-15 15:21:44 +02:00
LICENSE Initial publication 2026-10-15 (rev2) 2026-10-15 15:21:44 +02:00
README.md Initial publication 2026-10-15 (rev2) 2026-10-15 15:21:44 +02:00

electioninfo

Open-Source transparency website for all Swiss parliamentary votes (Nationalrat & Ständerat), current legislative period and beyond.

Features

  • Vote lists, detail pages with official texts and committee recommendations
  • Politician profiles with voting records and party affiliations
  • Interactive comparison tool: match your own answers to vote questions
  • Full-text search across business descriptions and rationales
  • Privacy-first: no cookies, no sessions, no tracking, no IP logging

Stack

PHP 8 + SQLite + vanilla CSS/JS. No framework, no build step, no external dependencies.

Architecture

web/          Document root (nginx/apache/php-fpm or `php -S`)
bin/          CLI scripts (sync, migrations, schema)
data/         SQLite DB (excluded from git)
docs/         Design decisions and protocols

Sync pipeline: bin/sync.php pulls OData API (ws.parlament.ch) → data/electioninfo.db. The web tree reads the DB only, never calls the API.

Privacy model: comparison state lives in browser localStorage; POST payload discarded after render. No access logs in production.

Development

cp config.example.php config.php   # fill real values
php bin/schema.php                  # init DB
php bin/sync.php --stage=all       # fetch data
php -S localhost:8010 -t web        # dev server

Visit http://localhost:8010

Sync stages

Stage Description
people All council members (active + retired since 2019)
votes Vote index for the cycle
rollcalls Individual roll-call votes per vote (~0.3 s each)
kinds Classification subject_kind (final/entry/other)

License

AGPL-3.0 — see LICENSE file.