Skip to content

Commit c0223f5

Browse files
yav02gilpeledSavioorinbararanLuckyRonny
committed
Initial public release
Knesset MK Tracking follows what Israeli Knesset members say on social media and cross-references it against how they actually vote. Released by The Public Knowledge Workshop under the MIT license. Co-authored-by: yav02 <74302639+yav02@users.noreply.github.com> Co-authored-by: gilpeled <101510239+gilpeled@users.noreply.github.com> Co-authored-by: Savioor <25704274+Savioor@users.noreply.github.com> Co-authored-by: inbararan <20068852+inbararan@users.noreply.github.com> Co-authored-by: LuckyRonny <186024602+LuckyRonny@users.noreply.github.com> Co-authored-by: danyaffe63 <226991234+danyaffe63@users.noreply.github.com>
1 parent 501f6c1 commit c0223f5

162 files changed

Lines changed: 80448 additions & 1 deletion

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.env.example

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Copy this file to .env and fill in your actual values.
2+
# IMPORTANT: Never commit .env to version control.
3+
4+
# Google Cloud Platform Project ID
5+
# This is the GCP project ID that hosts your BigQuery dataset.
6+
# Example: your-project-id
7+
GOOGLE_CLOUD_PROJECT=your-project-id
8+
9+
# Path to a Google Cloud service account JSON key file
10+
# Create a service account in GCP with BigQuery and Gemini API permissions.
11+
# Download the key as JSON and point to its location.
12+
# Example: /path/to/service-account-key.json
13+
GOOGLE_APPLICATION_CREDENTIALS=/path/to/service-account-key.json
14+
15+
# X (Twitter) API v2 Bearer Token
16+
# Obtain from https://developer.twitter.com/en/portal/dashboard
17+
# Requires Academic Research access or equivalent.
18+
# Example: AAAAABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnop
19+
X_BEARER_TOKEN=your-x-api-bearer-token
20+
21+
# Google Gemini API Key
22+
# Obtain from https://aistudio.google.com/app/apikey
23+
# Used for embeddings and text summarization.
24+
# Example: AIzaSyDxxx...
25+
GEMINI_API_KEY=your-gemini-api-key

.github/workflows/ci.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
python:
11+
name: Python
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- name: Install uv
17+
uses: astral-sh/setup-uv@v5
18+
with:
19+
enable-cache: true
20+
21+
- name: Install dependencies
22+
run: uv sync
23+
24+
# The repository currently has ~65 pre-existing ruff violations.
25+
# Lint is reported but not enforced until that backlog is cleared;
26+
# tests are the blocking gate. Contributions welcome — see CONTRIBUTING.md.
27+
- name: Lint (ruff, advisory)
28+
run: uv run ruff check .
29+
continue-on-error: true
30+
31+
# Pure-Python tests. These need no cloud credentials and no built frontend.
32+
- name: Run tests
33+
run: uv run pytest -q tests/
34+
35+
frontend:
36+
name: Frontend
37+
runs-on: ubuntu-latest
38+
steps:
39+
- uses: actions/checkout@v4
40+
41+
- name: Set up Node.js
42+
uses: actions/setup-node@v4
43+
with:
44+
node-version: 20
45+
cache: npm
46+
cache-dependency-path: ui/package-lock.json
47+
48+
- name: Install dependencies
49+
working-directory: ui
50+
run: npm ci
51+
52+
- name: Type-check and build
53+
working-directory: ui
54+
run: npm run build
55+
56+
# NOTE: ui/tests/ is deliberately not run here. Those tests need
57+
# ui/data/analysis.json — pipeline output that is gitignored and never
58+
# ships — and ui/tests/test_ui.py additionally needs Playwright browsers.
59+
# Neither is available on a fresh clone. Run them locally after a full
60+
# pipeline run: `uv run pytest ui/tests/`. Making these runnable in CI
61+
# (via committed fixtures) would be a welcome contribution.

.gitignore

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Python-generated files
2+
__pycache__/
3+
.pytest_cache/
4+
*.py[oc]
5+
build/
6+
dist/
7+
wheels/
8+
*.egg-info
9+
10+
# Virtual environments
11+
.venv
12+
13+
# Output data
14+
data/
15+
x_api_collect/data/
16+
ui/data/
17+
ui/raw/
18+
summary_creation/output/
19+
summary_creation/checkpoints/
20+
21+
# Temporary files
22+
found_mks.*
23+
scratch/
24+
25+
# Node / Frontend
26+
node_modules/
27+
*.tsbuildinfo
28+
29+
# OS / System
30+
.DS_Store
31+
32+
# Editor and agent config directories
33+
.obsidian/
34+
.gemini/
35+
.opencode/
36+
.claude/
37+
.agents/

.python-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.13

CODE_OF_CONDUCT.md

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, caste, color, religion, or sexual identity and orientation.
6+
7+
We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
8+
9+
## Our Standards
10+
11+
Examples of behavior that contributes to a positive environment for our community include:
12+
13+
- Demonstrating empathy and kindness toward other people
14+
- Being respectful of differing opinions, viewpoints, and experiences
15+
- Giving and gracefully accepting constructive feedback
16+
- Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
17+
- Focusing on what is best not just for us as individuals, but for the overall community
18+
19+
Examples of unacceptable behavior include:
20+
21+
- The use of sexualized language or imagery, and sexual attention or advances of any kind
22+
- Trolling, insulting or derogatory comments, and personal or political attacks
23+
- Public or private harassment
24+
- Publishing others' private information, such as a physical or email address, without their explicit permission
25+
- Other conduct which could reasonably be considered inappropriate in a professional setting
26+
27+
## Enforcement Responsibilities
28+
29+
Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
30+
31+
Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
32+
33+
## Scope
34+
35+
This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
36+
37+
## Enforcement
38+
39+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at [info@hasadna.org.il](mailto:info@hasadna.org.il). All complaints will be reviewed and investigated promptly and fairly.
40+
41+
All community leaders are obligated to respect the privacy and security of the reporter of any incident.
42+
43+
## Enforcement Guidelines
44+
45+
Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
46+
47+
### 1. Correction
48+
49+
**Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
50+
51+
**Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
52+
53+
### 2. Warning
54+
55+
**Community Impact**: A violation through a single incident or series of actions.
56+
57+
**Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
58+
59+
### 3. Temporary Ban
60+
61+
**Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
62+
63+
**Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
64+
65+
### 4. Permanent Ban
66+
67+
**Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
68+
69+
**Consequence**: A permanent ban from any sort of public interaction within the community.
70+
71+
## Attribution
72+
73+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.1, available at [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
74+
75+
Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder][Mozilla CoC].
76+
77+
For answers to common questions about this code of conduct, see the FAQ at [https://www.contributor-covenant.org/faq][FAQ]. Translations are available at [https://www.contributor-covenant.org/translations][translations].
78+
79+
[homepage]: https://www.contributor-covenant.org
80+
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
81+
[Mozilla CoC]: https://github.com/mozilla/diversity
82+
[FAQ]: https://www.contributor-covenant.org/faq
83+
[translations]: https://www.contributor-covenant.org/translations

CONTRIBUTING.md

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
# Contributing
2+
3+
Thanks for your interest in contributing to this project! We welcome contributions of all sizes — from bug reports and documentation improvements to feature work and code review.
4+
5+
## Getting Started
6+
7+
We follow [conventional commits](https://www.conventionalcommits.org/) in this project. Commit types include:
8+
- `feat:` — new feature
9+
- `fix:` — bug fix
10+
- `docs:` — documentation
11+
- `test:` — test additions or updates
12+
- `chore:` — dependencies, config, tooling
13+
- `refactor:` — code restructuring without behavioral change
14+
15+
Example: `feat: add voting comparison view` or `fix: handle missing profile data`.
16+
17+
## Development Setup
18+
19+
### Backend (Python)
20+
21+
Install dependencies with `uv`:
22+
23+
```bash
24+
uv sync
25+
uv run pytest -q
26+
```
27+
28+
Code quality is enforced with `ruff`:
29+
30+
```bash
31+
uv run ruff check .
32+
uv run ruff format .
33+
```
34+
35+
### Frontend (React/TypeScript)
36+
37+
Install and run the dev server:
38+
39+
```bash
40+
cd ui
41+
npm install
42+
npm run dev
43+
npm run build
44+
```
45+
46+
Frontend code is linted with ESLint and formatted with Prettier (configured via your editor or pre-commit hooks). You should see any issues when you build or start the dev server.
47+
48+
## Running Tests
49+
50+
```bash
51+
# Python
52+
uv run pytest -q
53+
54+
# Frontend (build validation)
55+
cd ui && npm run build
56+
```
57+
58+
## Important: Cloud Infrastructure Requirement
59+
60+
**This project requires a Google Cloud Platform project with BigQuery access to run the full pipeline.** The application will not function without:
61+
- A GCP project ID
62+
- A BigQuery dataset
63+
- A service account with BigQuery permissions
64+
- Google Gemini API credentials
65+
- X/Twitter API v2 bearer token
66+
67+
There is currently **no offline demo mode**. If you'd like to contribute but don't have cloud access, here are great entry points:
68+
69+
- **Frontend-only issues**: UI improvements, mobile layout fixes, new components
70+
- **Documentation**: README, API docs, architecture guides, translations
71+
- **Data/testing**: issue reporting, feature requests, UX feedback
72+
73+
See `.env.example` for all required environment variables.
74+
75+
## Submitting a Contribution
76+
77+
1. Fork the repository and create a feature branch: `git checkout -b feat/your-feature-name`
78+
2. Make your changes, following the code style guidelines above
79+
3. Write or update tests for your changes
80+
4. Commit with a conventional commit message
81+
5. Push and open a pull request against `main`
82+
83+
## Code of Conduct
84+
85+
Please review our [Code of Conduct](CODE_OF_CONDUCT.md). We're committed to providing a welcoming and inclusive environment for all contributors.
86+
87+
## Community
88+
89+
We're part of **The Public Knowledge Workshop** (hasadna), an Israeli NGO building civic tech and government transparency tools.
90+
91+
- **Weekly meetups**: Mondays at Google Campus Tel Aviv (Hebrew and English welcome)
92+
- **Email**: [info@hasadna.org.il](mailto:info@hasadna.org.il)
93+
- **Website**: [hasadna.org.il](https://hasadna.org.il)
94+
95+
Questions? Don't hesitate to reach out — we'd love to meet you and discuss ideas for the project.
96+
97+
## License
98+
99+
By contributing to this project, you agree that your contributions will be licensed under the MIT License.

CONTRIBUTORS.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Contributors
2+
3+
This project was built over 8 days (July 30 – August 7, 2026) by a focused team. The repository history was reset at open-sourcing, so this file is the authoritative record of contributions.
4+
5+
## Core Contributors
6+
7+
| Commits | Name | GitHub |
8+
|---|---|---|
9+
| 78 | Yonatan Vershkov | [@yav02](https://github.com/yav02) |
10+
| 49 | Gil Peled | [@gilpeled](https://github.com/gilpeled) |
11+
| 16 | Alexey Shapovalov | [@Savioor](https://github.com/Savioor) |
12+
| 15 | Inbar Aran | [@inbararan](https://github.com/inbararan) |
13+
| 14 | Ronny Getz | [@LuckyRonny](https://github.com/LuckyRonny) |
14+
| 1 | Dan Yaffe | [@danyaffe63](https://github.com/danyaffe63) |
15+
16+
## Acknowledgements
17+
18+
Special thanks to [@TalGetz](https://github.com/TalGetz) for contributing 12 of the project's 29 issues and shaping the roadmap. Though this represents no code commits, the work of defining scope, prioritizing features, and providing product direction was invaluable to the team's success.
19+
20+
---
21+
22+
**The Public Knowledge Workshop** (הסדנה לידע ציבורי) is an Israeli NGO advancing civic tech, government transparency, and digital rights. Learn more at [hasadna.org.il](https://hasadna.org.il).

Dockerfile

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# ---- Frontend build stage ----
2+
FROM node:20-slim AS ui-build
3+
WORKDIR /app/ui
4+
COPY ui/package.json ui/package-lock.json ./
5+
RUN npm ci
6+
COPY ui/ ./
7+
RUN npm run build
8+
9+
# ---- Backend runtime stage ----
10+
FROM python:3.11-slim
11+
12+
# Install system dependencies (curl for download_knesset_data and for uv)
13+
RUN apt-get update && apt-get install -y curl ca-certificates && rm -rf /var/lib/apt/lists/*
14+
15+
# Install uv
16+
COPY --from=ghcr.io/astral-sh/uv:0.12.0 /uv /bin/uv
17+
18+
# Set working directory
19+
WORKDIR /app
20+
21+
# Copy the entire project
22+
COPY . /app
23+
24+
# Bring in the frontend built in the ui-build stage (ui/dist is gitignored,
25+
# so it isn't present in the plain `COPY . /app` above).
26+
COPY --from=ui-build /app/ui/dist /app/ui/dist
27+
28+
# Install dependencies for the main project
29+
RUN uv sync --frozen
30+
31+
# Install dependencies for the x_api_collect sub-project
32+
RUN cd x_api_collect && uv sync --frozen
33+
34+
# Install dependencies for the bill_issues sub-project
35+
RUN cd bill_issues && uv sync --frozen
36+
37+
# Ensure scripts are executable
38+
RUN chmod +x /app/run_daily_pipeline.sh
39+
40+
# The default command will be overridden by Cloud Run (for web) and Cloud Run Jobs (for daily tasks)
41+
# But we can set a sensible default, like running the web server
42+
CMD ["uv", "run", "mkwork", "--host", "0.0.0.0", "--port", "8080"]

0 commit comments

Comments
 (0)