{"id":13411672,"url":"https://github.com/weg-li/weg-li","last_synced_at":"2025-03-14T17:31:05.320Z","repository":{"id":37734288,"uuid":"200227768","full_name":"weg-li/weg-li","owner":"weg-li","description":"📸 📝 ✊ weg.li: 1, 2, 3 - Macht die Bahn frei!","archived":false,"fork":false,"pushed_at":"2024-10-25T06:13:02.000Z","size":43717,"stargazers_count":251,"open_issues_count":15,"forks_count":28,"subscribers_count":19,"default_branch":"master","last_synced_at":"2024-10-30T00:47:36.700Z","etag":null,"topics":["rails","ruby","verkehrswende"],"latest_commit_sha":null,"homepage":"https://www.weg.li","language":"Ruby","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/weg-li.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["phoet"],"patreon":null,"open_collective":"weg-li","ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2019-08-02T12:04:40.000Z","updated_at":"2024-10-25T06:13:05.000Z","dependencies_parsed_at":"2023-12-19T10:02:22.440Z","dependency_job_id":"2b601ec6-9e25-41b0-8c5d-d166a405e251","html_url":"https://github.com/weg-li/weg-li","commit_stats":{"total_commits":2478,"total_committers":32,"mean_commits":77.4375,"dds":0.341000807102502,"last_synced_commit":"470cabc8ad99924efa00abe65823dd9c0c75ec16"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/weg-li%2Fweg-li","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/weg-li%2Fweg-li/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/weg-li%2Fweg-li/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/weg-li%2Fweg-li/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/weg-li","download_url":"https://codeload.github.com/weg-li/weg-li/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243366716,"owners_count":20279410,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["rails","ruby","verkehrswende"],"created_at":"2024-07-30T20:01:15.628Z","updated_at":"2025-03-14T17:31:00.305Z","avatar_url":"https://github.com/weg-li.png","language":"Ruby","funding_links":["https://github.com/sponsors/phoet","https://opencollective.com/weg-li","https://opencollective.com/weg-li/contribute","https://opencollective.com/weg-li/organization/0/website"],"categories":["Projects","Ruby"],"sub_categories":[],"readme":"![Build Status](https://github.com/weg-li/weg-li/workflows/build/badge.svg)\n[![Financial Contributors on Open Collective](https://opencollective.com/weg-li/all/badge.svg?label=financial+contributors)](https://opencollective.com/weg-li)\n\n# 📸 📝 ✊ weg.li: 1, 2, 3 - Macht die Bahn frei!\n\nhttps://www.weg.li/\n\n![weg.li: 1, 2, 3 - Macht die Bahn frei!](https://user-images.githubusercontent.com/48745/62852900-12304300-bceb-11e9-8ba4-3303c83c7dfc.png)\n\n## Installation\n\nYou can either run the application locally or via Docker.\n\n### Local setup\n\nTo run weg.li locally, you'll need:\n\n- Ruby\n- PostgreSQL with postgis\n- NodeJS \u0026 Yarn\n- Redis\n\n#### Quick setup for Linux (Ubuntu)\n\nSee [this guide](https://gorails.com/setup/ubuntu/20.10) which guides you through installing Ruby, Rails and PostgreSQL.\n\nComplete the setup by installing the Redis server at the end.\n\n```bash\napt install redis\n```\n\n#### Quick setup for Mac OS\n\nPlease follow [this guide](https://guides.railsgirls.com/install) if you have not ever installed Ruby on your computer.\n\n```bash\n# global setup\nbrew install rbenv # ruby environemnt\n\nbrew install yarn # yarn\n\nbrew install postgresql # database\nbrew install postgis # GIS extension for Postgresql\ncreateuser -s postgres # create general purpose postgres user\n\nbrew install imagemagick # image-processing\n\n# project setup\nbin/setup\n```\n\n```bash\n# install ruby runtime\nrbenv install\n\n# run this to start the rails process\nscript/server\n```\n\n### Docker setup\n\n```bash\n# build the app\ndocker-compose build\n# start services\ndocker-compose up\n# setup database\ndocker-compose exec app bundle exec rails db:setup\n# generate test data\ndocker-compose exec app bundle exec rake dev:data\n```\n\n## Contributing\n\n### Create admin user\n\nAfter installing the dependencies and running the server, you should be able to log in via “email” by visiting [http://localhost:3000/sessions/email](http://localhost:3000/sessions/email) and following the prompts. No email will be sent - the generated email is opened in your browser.\n\nOnce you have successfully authenticated, make your user an admin: Start the rails console (run `rails c` in your project directory), then enter `User.last.update(access: 'admin')`, which should result in `=\u003e true`. Now you should be able to access the admin interface at [/admin](http://localhost:3000/admin/).\n\n### Importing base data\n\nFor proper functionality, you need to populate your database with _districts_.\n\nTo fabricate random districts, run `rake dev:data`. This will synthesize all the kinds of data you need to get dashboards, stats, etc. working right.\n\nIf you want to get as close as possible to a “production” system, the easiest way is to import data from the production instance. Download an export format from `https://www.weg.li/districts.csv` (or `.json`) and import it into your local database. Example using the rails console (`rails c`):\n\n```ruby\n\u003e districts = JSON.parse(URI.open('https://www.weg.li/districts.json').read); districts.count\n=\u003e 3377\n\u003e District.insert_all!(districts.map{ |x| x.except('personal_email').merge({'flags': x['personal_email'] ? 1 : 0}) }); District.count\n=\u003e 3377\n```\n\n### Secrets and keys\n\nYou need to set the following environment variables to enable full functionality for weg.li:\n\n```bash\nGITHUB_CONSUMER_KEY=github-key\nGITHUB_CONSUMER_SECRET=github-secret\n\nTWITTER_CONSUMER_KEY=twitter-key\nTWITTER_CONSUMER_SECRET=twitter-secret\n\nGOOGLE_CONSUMER_KEY=google-key\nGOOGLE_CONSUMER_SECRET=google-secret\n```\n\nThese are used to let users authenticate with the different providers. Learn how to create your own keys: [GitHub](https://docs.github.com/en/free-pro-team@latest/developers/apps/creating-an-oauth-app), [Twitter](https://developer.twitter.com/en/docs/apps/overview), [Google](https://developers.google.com/identity/sign-in/web/sign-in).\n\nIn addition, weg.li uses Google Cloud Storage for storing uploaded data and Google Cloud Vision to read license plates and determine car makes and colors. You will need to [create a Google Cloud Project](https://cloud.google.com/resource-manager/docs/creating-managing-projects) and set up the required API access for _Google Cloud Storage_ and _Google Cloud Vision_. Be aware that you might be billed for Google Cloud usage. Please refer to the Google Cloud documentation, and set the following environment variables accordingly:\n\n```bash\nGOOGLE_CLOUD_PROJECT=google-cloud-project-id\nGOOGLE_CLOUD_KEYFILE=path/to/project/keyfile/gcloud.json\n```\n\nFor local use, you can put these variables into a `.env` file in the project directory, and the `dotenv` gem will automatically make them available to your rails app. (See `.env-example`.)\n\n## Contributors\n\n### Code Contributors\n\nDieses Projekt existiert dank aller Menschen, die dazu beitragen.\n\n\u003ca href=\"https://github.com/weg-li/weg-li/graphs/contributors\"\u003e\u003cimg src=\"https://opencollective.com/weg-li/contributors.svg?width=890\u0026button=false\" /\u003e\u003c/a\u003e\n\n### Financial Contributors\n\nWerden Sie ein finanzieller Spender und helfen Sie uns, unsere Gemeinschaft zu erhalten. [[Beitragen](https://opencollective.com/weg-li/contribute)]\n\n#### Individuals\n\n\u003ca href=\"https://opencollective.com/weg-li\"\u003e\u003cimg src=\"https://opencollective.com/weg-li/individuals.svg?width=890\"\u003e\u003c/a\u003e\n\n#### Organizations\n\nUnterstützen Sie dieses Projekt mit Ihrer Organisation. Ihr Logo wird hier mit einem Link zu Ihrer Website angezeigt.[[Beitragen](https://opencollective.com/weg-li/contribute)]\n\n\u003ca href=\"https://opencollective.com/weg-li/organization/0/website\"\u003e\u003cimg src=\"https://opencollective.com/weg-li/organization/0/avatar.svg\"\u003e\u003c/a\u003e\n\n## License\n\n\"THE (extended) BEER-WARE LICENSE\" (Revision 42.0815): [phoet](mailto:ps@nofail.de) contributed to this project.\n\nAs long as you retain this notice you can do whatever you want with this stuff.\nIf we meet some day, and you think this stuff is worth it, you can buy me some beers in return.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fweg-li%2Fweg-li","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fweg-li%2Fweg-li","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fweg-li%2Fweg-li/lists"}