Skip to content
View poli-track-os's full-sized avatar

Block or report poli-track-os

Block user

Prevent this user from interacting with your repositories and sending you notifications. Learn more about blocking users.

You must be logged in to block users.

Maximum 250 characters. Please don’t include any personal information such as legal names or email addresses. Markdown is supported. This note will only be visible to you.
Report abuse

Contact GitHub support about this user’s behavior. Learn more about reporting abuse.

Report abuse
poli-track-os/README.md

Poli-Track

CI License: MIT

Poli-Track header

Poli-Track is an open-source explorer for European political data — members of parliament, parties, proposals, finances, and the relationships between them. It pairs a React single-page frontend with a Supabase backend and a small ingestion stack that pulls from the European Parliament, official national parliament rosters, Wikipedia, the UN Digital Library, and EU institutional press feeds.

It is built for people who want to look up how a country voted on something, what a politician's public record actually says, or which proposals are moving through which parliament — without scrolling through press releases.

Features

  • Search across every tracked politician, party, proposal, and country.
  • Politician profiles with Wikipedia-enriched biographies, committee memberships, finances, investments, and a git-log-style event timeline.
  • Proposal tracking with status, policy area, jurisdiction, and affected laws.
  • Country pages aggregating parliament composition, recent proposals, and stats.
  • Relationship graphs showing party alliances and shared committee memberships.
  • Comparative dashboards on the Data page — proposals by country, status, and policy area; politicians by country and party family.
  • Political compass and policy-radar visualizations per politician.
  • Public read-only HTTP API with one endpoint per SPA route (docs/api.md).
  • MCP server — every page and tool is callable from Claude Desktop, Cursor, and any other MCP client. 11 tools, 4 investigative prompt templates.

Screenshots

Home Explore
Actors Proposals
Relationships Data

Quick start

git clone https://github.com/poli-track-os/poli-track-os.git
cd poli-track
npm install
cp .env.example .env
npm run dev

Then open http://localhost:5173.

The app reads from Supabase and needs VITE_SUPABASE_URL and VITE_SUPABASE_PUBLISHABLE_KEY in .env. The defaults in .env.example point at the hosted Poli-Track project; swap them for your own Supabase project if you want an isolated backend.

Tech stack

Repository layout

poli-track/
├── src/
│   ├── App.tsx                     # Router + providers
│   ├── main.tsx                    # Entry point
│   ├── pages/                      # Route-level screens
│   │   ├── Index.tsx               # Home
│   │   ├── Explore.tsx             # Country coverage
│   │   ├── CountryDetail.tsx
│   │   ├── Actors.tsx
│   │   ├── ActorDetail.tsx
│   │   ├── Proposals.tsx
│   │   ├── ProposalDetail.tsx
│   │   ├── Relationships.tsx
│   │   ├── Data.tsx                # Comparative dashboards
│   │   └── About.tsx               # Methodology
│   ├── components/                 # Shared UI
│   │   ├── SiteHeader.tsx
│   │   ├── ActorCharts.tsx
│   │   ├── ActorTimeline.tsx
│   │   ├── PoliticalCompass.tsx
│   │   ├── PolicyRadar.tsx
│   │   ├── SearchBar.tsx
│   │   └── ...
│   ├── hooks/
│   │   ├── use-politicians.ts      # Politician/event/finance/position queries
│   │   └── use-proposals.ts        # Proposal queries and stats
│   ├── data/domain.ts              # Shared types and label maps
│   ├── integrations/supabase/
│   │   ├── client.ts               # Supabase client + env guard
│   │   └── types.ts                # Generated DB types
│   └── test/                       # Vitest smoke tests
│
├── supabase/
│   ├── migrations/                 # Postgres schema history
│   └── functions/                  # Deno edge ingesters
│       ├── scrape-eu-parliament/   # europarl.europa.eu MEP directory
│       ├── scrape-national-parliament/  # Wikipedia parliament categories
│       ├── enrich-wikipedia/       # Wikipedia bio + infobox harvest
│       ├── scrape-twitter/         # EU press release RSS
│       ├── scrape-un-votes/        # UN General Assembly voting records
│       ├── seed-positions/         # Party → political compass seeder
│       └── seed-associations/      # Party + committee relationship seeder
│
├── scripts/
│   ├── sync-official-rosters.ts    # Official national roster sync with field provenance
│   └── backfill-politician-positions.ts
│
├── docs/screenshots/               # Images used by README + wiki
├── .github/workflows/              # CI + ingestion scheduler
├── ARCHITECTURE.md                 # System overview
└── INGESTION.md                    # Data pipeline deep-dive

Data pipeline

Every piece of politician, event, and proposal data visible in the UI comes from the edge functions under supabase/functions/ plus the official-roster sync in scripts/sync-official-rosters.ts. The weekly Ingest workflow runs the official national roster sync before Wikipedia enrichment and position seeding so party and role corrections propagate into downstream views.

See INGESTION.md for an exhaustive breakdown of every source, transform, table, and consumer.

Running locally

npm run dev         # Vite dev server with HMR
npm run build       # Production bundle into dist/
npm run preview     # Serve the built bundle
npm run test        # Unit tests (Vitest)
npm run lint        # ESLint
npm run typecheck   # tsc --noEmit

Public website

The frontend is now set up for GitHub Pages deployment from main after successful CI via .github/workflows/deploy-pages.yml.

Public URL after the workflow succeeds:

https://poli-track-os.github.io/poli-track-os/

This is separate from the Supabase deploy workflow. GitHub Pages publishes the static frontend; Supabase continues to serve the database and edge-function backend.

Deploying Supabase

The repo is already linked to Supabase project zygnkwyogazhwxfeatfc. To update the hosted database schema and edge functions manually:

bash scripts/deploy-supabase.sh

GitHub also supports automatic Supabase deployment after successful CI on main via .github/workflows/deploy-supabase.yml. For that workflow to work, set these repository secrets:

  • SUPABASE_ACCESS_TOKEN
  • SUPABASE_DB_PASSWORD

This deploy path updates the Supabase project only. The frontend is still a separate hosting concern.

API & MCP

Every piece of data the website shows is also exposed through two machine-readable surfaces:

  • HTTP API — one endpoint per SPA route, plus lower-level canonical graph endpoints. Stable JSON envelope, ETag-cacheable, public. See docs/api.md and the spec at openapi.yaml.
  • MCP server — Model Context Protocol server so Claude Desktop, Cursor, and other LLM clients can query Poli-Track as a first-class tool. 11 tools + 4 prompts. See docs/mcp.md. Source under mcp-server/.

Smoke-test the stdio binary locally:

cd mcp-server && npm install && npm run build
POLI_TRACK_API_BASE=https://zygnkwyogazhwxfeatfc.supabase.co/functions/v1 \
  npx @modelcontextprotocol/inspector node dist/stdio.js

Contributing

Contributions welcome. Start with CONTRIBUTING.md. The repository wiki has walkthroughs for each page of the app and deeper notes on the data model.

License

MIT.

Popular repositories Loading

  1. poli-track-os poli-track-os Public

    Open-source European political data explorer for tracking actors, parties, proposals, voting behavior, and institutional power structures.

    TypeScript