2015-05-19 09:49:07 +02:00
# Stadtratmonitor
2016-04-12 21:07:20 +02:00
**Offical site:** https://stadtratmonitor.leipzig.codefor.de/
2016-03-26 14:39:27 +01:00
## Usage / Features
2023-04-16 12:52:38 +02:00
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 ](https://ratsinformation.leipzig.de/allris_leipzig_public/ ) that also offers [text search capabilities ](https://ratsinformation.leipzig.de/allris_leipzig_public/vo040 ).
2016-03-26 14:39:27 +01:00
### Sorting
* Sort by date, paper was issued
2016-05-04 22:41:45 +02:00
2016-03-26 14:39:27 +01:00

2016-03-26 15:32:45 +01:00
2016-03-26 14:39:27 +01:00
* Sort by relevance, e.g. how often the search keyword appears inside the title resp. the content of the paper
2016-05-04 22:41:45 +02:00
2016-03-26 14:39:27 +01:00

2016-03-26 15:32:45 +01:00
2016-03-26 14:39:27 +01:00
### Filtering
* By paper type
2016-05-04 22:41:45 +02:00
2016-03-26 14:39:27 +01:00

2016-03-26 15:32:45 +01:00
2016-03-26 14:39:27 +01:00
* By originator
2016-05-04 22:41:45 +02:00
2016-03-26 14:39:27 +01:00

2016-03-26 15:32:45 +01:00
2016-03-26 14:39:27 +01:00
### Staying up-to-date
2016-03-26 15:32:45 +01:00
#### General
2016-03-26 14:39:27 +01:00
* Subscribing
* [Google Chrome RSS extension ](https://chrome.google.com/webstore/detail/rss-subscription-extensio/nlbjncdgjeocebhnmkbbbdekmmmcbfjd?hl=de )
2016-03-26 15:32:45 +01:00
* [Firefox RSS extension ](https://addons.mozilla.org/en-US/firefox/addon/rss-feed-icon-in-navbar/ )
2016-03-26 14:39:27 +01:00
* Reading
* [Google Chrome Extension ](https://chrome.google.com/webstore/detail/rss-feed-reader/pnjaodmkngahhkoihejjehlcdlnohgmp )
2016-03-26 15:32:45 +01:00
* [Firefox Extension ](https://addons.mozilla.org/en-US/firefox/addon/simple-rss-reader-srr )
* [RSSOWL ](http://www.rssowl.org/ )
2023-04-16 12:52:38 +02:00
#### Example using Firefox and RSSOWL
2016-03-26 15:32:45 +01:00
Click on the newsfeed icon in the address bar
2016-05-04 22:41:45 +02:00

2016-03-26 15:32:45 +01:00
Copy the URL from the address bar

Create a new Feed in RSSOWL and paste the just copied URL in the form
2016-04-12 21:07:20 +02:00

2016-03-26 15:32:45 +01:00
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.
2016-03-26 14:39:27 +01:00
2015-05-19 09:49:07 +02:00
## Setup
2016-03-02 21:38:57 +01:00
There are two ways to run this app: using a local development setup, or using
docker.
### Local machine setup
2015-05-19 09:49:07 +02:00
1. Install Ruby, Bundler, Elasticsearch
2023-05-05 19:13:08 +02:00
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. Open [http://localhost:3000 ](http://localhost:3000 )
2015-05-19 09:49:07 +02:00
2016-01-23 20:33:08 +01:00
### Using docker
1. Install docker and docker-compose: https://docs.docker.com/compose/install/
2023-05-05 19:13:08 +02:00
2. Start the app: `docker-compose up`
3. Initialize the database: `docker exec stadtratmonitor-web sh -c "rake db:setup && rake import_papers && rake index:rebuild"`
4. Open [http://localhost:3000 ](http://localhost:3000 )
2015-05-19 09:59:43 +02:00
2023-04-07 21:58:47 +02:00
```
rake assets:clean
rake assets:clobber
rake tmp:clear
2023-04-08 00:01:31 +02:00
npm install -g sass
#rails css:install:bootstrap
#rails javascript:install:esbuild
2023-04-16 12:52:38 +02:00
rake assets:precompile
2023-04-07 21:58:47 +02:00
```
2023-05-05 19:13:08 +02:00
### Importing data via allris-scraper (optional)
2023-04-16 12:52:38 +02:00
1. You can use [our allris-scraper ](https://github.com/CodeforLeipzig/allris-scraper ) to download the papers (resp. their links) from the [OPARL ](https://oparl.org/ ) API, this will produce an input.json file
2023-05-05 19:13:08 +02:00
2. Put this input.json to a public web server and set the URL to this file then in:
2023-04-16 12:52:38 +02:00
`app/controllers/import_controller.rb` and `lib/tasks/import_papers.rake`
2016-05-04 22:41:45 +02:00
### Running tests
Assuming docker and docker-compose is installed:
2023-05-05 19:13:08 +02:00
1. `docker-compose run web bin/run-tests`