Need help with weg-li?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

weg-li
156 Stars 16 Forks 1.9K Commits 5 Opened issues

Description

📸 📝 ✊ weg-li: 1, 2, 3 - Macht die Bahn frei!

Services available

!
?

Need anything else?

Contributors list

# 44,794
Ruby
Rails
Shell
dropzon...
1594 commits
# 435,473
Rails
HTML
sketch-...
sketcha...
8 commits
# 36,288
Rails
HTML
mac
rack-mi...
6 commits
# 387,270
Elixir
Rails
HTML
lita
3 commits
# 704,324
Rails
HTML
Shell
CSS
3 commits
# 735,248
Rails
HTML
Shell
CSS
2 commits
# 6,186
wechat-...
mac
alfred
omil
1 commit
# 793,794
Rails
HTML
Shell
CSS
1 commit
# 27,008
Rails
web-edi...
collabo...
time-ma...
1 commit
# 255,392
Visual ...
C#
entity-...
dotnet-...
1 commit

Build Status Financial Contributors on Open Collective

📸 📝 ✊ weg.li: 1, 2, 3 - Macht die Bahn frei!

https://www.weg.li/

weg.li: 1, 2, 3 - Macht die Bahn frei!

Installation

You can either run the application locally or via Docker.

Local setup

To run weg.li locally, you'll need:

  • Ruby
  • PostgreSQL
  • NodeJS & Yarn
  • Redis

Quick setup for Linux (Ubuntu)

See this guide which guides you through installing Ruby, Rails and PostgreSQL.

Complete the setup by installing the Redis server at the end.

apt install redis

Quick setup for Mac OS

Please follow this guide if you have not ever installed Ruby on your computer.

# global setup
brew install rbenv # ruby environemnt

brew install postgresql # database createuser -s postgres # create general purpose postgres user

brew install imagemagick # image-processing

project setup

bin/setup

# install ruby runtime
rbenv install

run this to start the rails process

script/server

Docker setup

docker-compose up

Contributing

Create admin user

After installing the dependencies and running the server, you should be able to log in via “email” by visiting http://localhost:3000/sessions/email and following the prompts. No email will be sent - the generated email is opened in your browser.

Once 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
=> true
. Now you should be able to access the admin interface at /admin.

Importing base data

For proper functionality, you need to populate your database with districts.

To fabricate random districts, run

rake dev:data
. This will synthesize all the kinds of data you need to get dashboards, stats, etc. working right.

If 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
):
> districts = JSON.parse(URI.open('https://www.weg.li/districts.json').read); districts.count
=> 3377
> District.insert_all!(districts.map{ |x| x.except('personal_email').merge({'flags': x['personal_email'] ? 1 : 0}) }); District.count
=> 3377

Secrets and keys

You need to set the following environment variables to enable full functionality for weg.li:

GITHUB_CONSUMER_KEY=github-key
GITHUB_CONSUMER_SECRET=github-secret

TWITTER_CONSUMER_KEY=twitter-key TWITTER_CONSUMER_SECRET=twitter-secret

GOOGLE_CONSUMER_KEY=google-key GOOGLE_CONSUMER_SECRET=google-secret

These are used to let users authenticate with the different providers. Learn how to create your own keys: GitHub, Twitter, Google.

In 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 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:

GOOGLE_CLOUD_PROJECT=google-cloud-project-id
GOOGLE_CLOUD_KEYFILE=path/to/project/keyfile/gcloud.json

For 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
.)

Contributors

Code Contributors

Dieses Projekt existiert dank aller Menschen, die dazu beitragen.

Financial Contributors

Werden Sie ein finanzieller Spender und helfen Sie uns, unsere Gemeinschaft zu erhalten. [Beitragen]

Individuals

Organizations

Unterstützen Sie dieses Projekt mit Ihrer Organisation. Ihr Logo wird hier mit einem Link zu Ihrer Website angezeigt.[Beitragen]

License

"THE (extended) BEER-WARE LICENSE" (Revision 42.0815): phoet contributed to this project.

As long as you retain this notice you can do whatever you want with this stuff. If we meet some day, and you think this stuff is worth it, you can buy me some beers in return.

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.