{"id":24166060,"url":"https://github.com/jonathanvdc/res-publica","last_synced_at":"2026-03-06T12:31:41.771Z","repository":{"id":38988027,"uuid":"274706413","full_name":"jonathanvdc/res-publica","owner":"jonathanvdc","description":"An election website for online democracies (like SimDemocracy).","archived":false,"fork":false,"pushed_at":"2023-09-23T18:40:14.000Z","size":1464,"stargazers_count":3,"open_issues_count":20,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-03T06:23:47.501Z","etag":null,"topics":["python","typescript"],"latest_commit_sha":null,"homepage":"https://simdemocracy.org","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jonathanvdc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2020-06-24T15:40:18.000Z","updated_at":"2024-10-07T13:57:40.000Z","dependencies_parsed_at":"2023-02-06T09:32:22.009Z","dependency_job_id":"fec0043e-b2bf-423d-a140-cf187a5fd960","html_url":"https://github.com/jonathanvdc/res-publica","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jonathanvdc/res-publica","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonathanvdc%2Fres-publica","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonathanvdc%2Fres-publica/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonathanvdc%2Fres-publica/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonathanvdc%2Fres-publica/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jonathanvdc","download_url":"https://codeload.github.com/jonathanvdc/res-publica/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonathanvdc%2Fres-publica/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30176171,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-06T11:48:51.886Z","status":"ssl_error","status_checked_at":"2026-03-06T11:48:51.460Z","response_time":250,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["python","typescript"],"created_at":"2025-01-12T20:14:24.460Z","updated_at":"2026-03-06T12:31:41.752Z","avatar_url":"https://github.com/jonathanvdc.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Res Publica (the SimDem election website)\n\n[SimDemocracy](https://www.reddit.com/r/SimDemocracy/) is an online community where citizens can participate in a simulated democracy, passing laws to change its nature. A key part of SimDemocracy is elections: We elect members of parliament and a president, and we also vote on referendums. Res Publica (this project) is SimDemocracy's election website. It supports the following scenarios:\n  * Registered voters can cast their ballots in elections and see past election results.\n  * Admins can set up elections, register voters and unregister voters.\n\n## Build Instructions\n\n### Dependencies\n\nTo build Res Publica, you will need a recent version of `npm` (e.g., 6.14.4) and a recent version of Python 3 (e.g., 3.8.5). Make sure you also have pip3. Res Publica's server is designed to run on Linux systems but may run on other operating systems too.\n\n### Change the homepage URL (Optional)\n\nIf you intend to host Res Publica at a non-root URL, go to the `front-end` directory. Change the `\"homepage\": \"/\"` field in `package.json` to the URL at which you mean to host the website. For instance, if you want to host at `/sdvote/` instead of at `/`, put `\"homepage\": \"/sdvote/\"`.\n\n### Configure Res Publica\n\nNavigate to the `back-end` directory. Create a file called `config.json` that contains your credentials for hosting the site. The contents of a `config.json` should look like the example below, with real web app credentials and bot credentials.\n\n```json\n{\n    \"webapp-credentials\": {\n        \"client_id\": \"client ID\",\n        \"client_secret\": \"client secret\",\n        \"redirect_uri\": \"https://www.your-web-page.com/reddit-auth\",\n        \"user_agent\": \"simdem-voting-booth-v0.0.1\"\n    },\n    \"bot-credentials\": {\n        \"client_id\": \"client ID\",\n        \"client_secret\": \"client secret\",\n        \"username\": \"your-bot-for-scraping-CFCs\",\n        \"password\": \"password\",\n        \"user_agent\": \"simdem-voting-booth-bot-v0.0.1\"\n    },\n    \"host\": {\n        \"debug\": false,\n        \"port\": 5000\n    },\n    \"voter-requirements\": [\n        {\n            \"operator\": \"\u003e=\",\n            \"lhs\": \"redditor.age\",\n            \"rhs\": 60\n        },\n        {\n            \"operator\": \"\u003e=\",\n            \"lhs\": \"redditor.total_karma\",\n            \"rhs\": 25\n        }\n    ],\n    \"default-permissions\": {\n        \"authenticated\": {\n            \"vote\": [\"view\", \"cast\"],\n            \"usermanagement\": [\"view\"]\n        },\n        \"authenticated-admin\": {\n            \"vote\": [\"view\", \"cast\"],\n            \"election\": [\"create\", \"edit\", \"cancel\"],\n            \"usermanagement\": [\"view\", \"add\", \"remove\"]\n        },\n        \"authenticated-developer\": {\n            \"vote\": [\"view\", \"cast\"],\n            \"election\": [\"create\", \"edit\", \"cancel\", \"view-suspicious-ballots\"],\n            \"usermanagement\": [\"view\", \"add\", \"remove\"],\n            \"administration\": [\"edit-permissions\", \"upgrade-server\"]\n        }\n    },\n    \"login_expiry\": 2592000,\n    \"flask-logs\": false\n}\n```\n\nWith the server configured, the only thing left for us to do is to appoint an admin (that's us!). Create a directory called `data` and in that directory create a file called `device-index.json` containing the following text, where `your-reddit-account` is your Reddit account name. If your Reddit account is, e.g., u/spez, then the Reddit account name you should enter is just \"spez\".\n\n```json\n{\n    \"devices\": {},\n    \"permissions\": {\n        \"vote\": {\n            \"view\": [\"another-users-account\"]\n            }\n    },\n    \"admins\": [\n        \"your-reddit-account\"\n    ],\n    \"developers\": [\n        \"your-reddit-account\"\n    ],\n    \"registered-voters\": [\n        \"your-reddit-account\"\n    ]\n}\n```\n\n### Run the server\n\nWith the `config.json` in place, run the server like so:\n```\npython3 ./server-manager.py config.json\n```\n\nCongratulations! If all went well, you should now have your very own instance of Res Publica.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonathanvdc%2Fres-publica","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjonathanvdc%2Fres-publica","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonathanvdc%2Fres-publica/lists"}