stadtratmonitor/README.md

4.1 KiB

Stadtratmonitor

Offical site: https://stadtratmonitor.leipzig.codefor.de/

Usage / Features

The Stadtratmonitor Leipzig is a lightweight user interface for performing full text searches against paper contents issued to the city council of Leipzig. Note, this solution uses the data from Ratsinformationssystem Leipzig that also offers text search capabilities.

Sorting

  • Sort by date, paper was issued

Papers sorted by publishing date

  • Sort by relevance, e.g. how often the search keyword appears inside the title resp. the content of the paper

Papers sorted by relevance

Filtering

  • By paper type

Filter by paper type

  • By originator

Filter by originator

Staying up-to-date

General

Example using Firefox and RSSOWL

Click on the newsfeed icon in the address bar Abonnieren mit Firefox

Copy the URL from the address bar RSS URL in Firefox

Create a new Feed in RSSOWL and paste the just copied URL in the form RSSOWL Feed

When updating the feed in RSSOWL (or any other RSS reader of your choice) time after time all new papers matching the search query criteria will appear.

Setup

There are two ways to run this app: using a local development setup, or using docker.

Local machine setup

  1. Install Ruby, Bundler, Elasticsearch
  2. Start Elasticsearch: elasticsearch
  3. Setup Rails app: bundle && bundle exec rake db:setup
  4. See "Importing data" below
  5. Start Rails server: bundle exec rails s
  6. Visit http://localhost:3000

Using docker

  1. Install docker and docker-compose: https://docs.docker.com/compose/install/
  2. Start the app: docker-compose up
  3. Initialize the database: docker-compose run --user srm web rake db:setup'
  4. See "Importing data" below
  5. Get the address of the docker host: docker-machine ip default
  6. Point your browser to: 'http://<IP of docker host>:3000'
rake assets:clean
rake assets:clobber
rake tmp:clear

npm install -g sass
#rails css:install:bootstrap
#rails javascript:install:esbuild
rake assets:precompile

Importing data and building the index

  1. You can use our allris-scraper to download the papers (resp. their links) from the OPARL API, this will produce an input.json file
  2. Put this input.json to a public web server and set the URL to this file then in: app/controllers/import_controller.rb and lib/tasks/import_papers.rake
  3. Import the data from our scraper: docker-compose run --user srm web rake import_papers'
  4. Build the elasticsearch index: docker-compose run --user srm web rake index:rebuild'

Running tests

Assuming docker and docker-compose is installed:

  1. docker-compose run --user srm web bin/run-tests