Configuration - PaulaScharf/TwittStorm GitHub Wiki

0 Preface

This is the Configuration reference for our TwittStorm - dynamic weather data system.
This reference consists of our two configurable files:

1. .env
2. config.yaml


1 .env

This file is used for configuring the API keys. As the app uses Mapbox GL JS and Twitter API, it contains the following five variables which are required for using the app.

  • TWITTER_CONSUMER_KEY
  • TWITTER_CONSUMER_SECRET
  • TWITTER_ACCESS_TOKEN_KEY
  • TWITTER_ACCESS_TOKEN_SECRET
  • MAPBOX_ACCESS_KEY

To start the app, each key's value has to be set to the users own API key. See How to get and use your own API-keys for information about how to create your API keys.


2 config.yaml

Below is a reference of all keys available in the config.yaml.
This file should only be edited by developers.

Server or Client side?

On which side(s) the keys in config.yaml are used:

key server side client side required?
mongodb x yes
map x yes
refresh_rate x x yes
timestamp_last_warnings_request x yes
max_age_tweets x yes
demo x yes
mapbox_access_key x yes
dwd x yes

mongodb

Configuration for the mongodb.
Must contain:

  • host - adress of the host
  • port - port number used
  • db_name - name of the database
  • collection_name - name of the collection

Example

mongodb:
  host: localhost
  port: 27017
  db_name: itemdb
  collection_name: item

map

Default configuration for the map. Will be overwritten by parameters in the URL if present.
Must contain:

  • center - coordinates to the center of the map (first longitude, second latitude)
  • zoom - level of zoom

Example

map:
  center:
    - 10.5
    - 51.2
  zoom: 5

refresh_rate

Rate at which new weather and tweet events are requested from the server as milliseconds.

Example

refresh_rate: 300000

timestamp_last_warnings_request

Timestamp (in Epoch milliseconds) of the last request for new severe weather warnings from the DWD.

Example

timestamp_last_warnings_request: 1537514469040

max_age_tweets

How far back tweets are being searched from now in minutes. Maximum and default is one week back. The default is used if the value is null.

Example

max_age_tweets: null

demo

Configuration for the demo szenario data.
Must contain:

  • timestamp_start - beginning of the demo data as a timestamp in Epoch milliseconds
  • timestamp_end - end of the demo data as a timestamp in Epoch milliseconds
  • location - location of the demo data relative to the location of the repository

Example

demo:
  timestamp_start: 1537513200000
  timestamp_end: 1537524006000
  location: ../demo/

mapbox_access_key

Access token for Mapbox GL JS.
Although this attribute is a user specific key and therefore exists in .env, it is also included in config.yaml for forwarding it to the client-side. It should be set by normal users only in .env.

Example (not real key)

mapbox_access_key: >-
      zk.eiJ1Ijoib3VhZ2Fkb3Vnb3UiLCJhIjoiX2pvZTNodGRzMnY4cTNxbmx2eXF6czExcCJ9.pqbCaR8fTaR9q1dipdthAA

dwd

URLs from which weather information is requested.
Must contain:

  • warnings - URL for retrieving severe weather warning data
  • radar - URL for retrieving rain radar data

Example

dwd:
  warnings: >-
    https://maps.dwd.de/geoserver/dwd/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=dwd%3AWarnungen_Gemeinden_vereinigt&maxFeatures=200&outputFormat=application%2Fjson
  radar: 'ftp://ftp-cdc.dwd.de/weather/radar/radolan/'