codeformuenster/familien-dashboard

Name: familien-dashboard

Owner: codeformuenster

Description: Eine "Stadtviertel-App", zeigt Infos aus Deiner Umgebung an, aus Open Data Datensätzen der Stadt Münster.

Created: 2017-11-10 11:27:06.0

Updated: 2018-05-22 20:40:24.0

Pushed: 2018-05-22 20:40:21.0

Homepage: https://mein-ms.de/

Size: 2127

Language: TypeScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Dependency Status FOSSA Status

This project was bootstrapped with https://github.com/Microsoft/TypeScript-React-Starter

Installing
npm install
Running elasticsearch and the react dev tool
sudo docker-compose up

If you get problems with file permissions on startup, check that the mounted directory ./elasticsearch/data has correct permissions.

Great Elasticsearch JS documentation is linked here: https://github.com/elastic/elasticsearch-js

Running only the react app
npm run start

Initialize the Database

cd src/scripts
../../node_modules/typescript/bin/tsc initialize-database.ts && node ./initialize-database.js  
Importing data
# Aufgrabungen und similar things
See README in `import-scripts`

# Wn events and news, and stadt münster webcams:
See README in `import-scripts/wn-events-news-cams`
Deployment auf Ubuntu 16.04
Data “type”-category values
Indexes
Playing with the data

Open kibana:

http://localhost:5601/

go to “dev-tools”

enter this:

PUT /locations
{
  "mappings": {
    "restaurant": {
      "properties": {
        "times": {
          "type": "nested"
        },
        "address": {
          "properties": {
            "geo": {
              "type": "geo_point"
            }
          }
        }
      }
    }
  }
}

add sample location:

PUT /locations/restaurant/1?pretty
{
  "name": "Cafe Extrablatt",
  "food": ["Burger", "Pizza", "Wraps"],
  "times": [
    {
      "type": "lunch",
      "day": "monday",
      "start": 660,
      "end": 780
    },
    {
      "type": "lunch",
      "day": "tuesday",
      "start": 660,
      "end": 780
    },
    {
      "type": "lunch",
      "day": "wednesday",
      "start": 660,
      "end": 780
    },
    {
      "type": "lunch",
      "day": "thursday",
      "start": 660,
      "end": 780
    },
    {
      "type": "lunch",
      "day": "friday",
      "start": 660,
      "end": 780
    },
    {
      "type": "happy_hour",
      "day": "friday",
      "start": 1200,
      "end": 1260
    },
    {
      "type": "happy_hour",
      "day": "saturday",
      "start": 1200,
      "end": 1260
    }
  ],
  "payment_methods": ["cash", "debit_card", "credit_card"],
  "wifi": false,
  "url": "https://cafe-extrablatt.de/speisekarte",
  "address": {
    "street": "Salzstraße",
    "house_number": "7",
    "zip_code": "48143",
    "city": "Münster",
    "geo": {
      "lat": 51.9622843,
      "lon": 7.6278623
    }
  },
  "phone_number": "025144445"
}

PUT /locations/restaurant/2?pretty
{
  "name": "Der silberne Löffel",
  "type": ["Restaurant"],
  "food": ["Pasta", "Pizza"],
  "times": [
    {
      "type": "lunch",
      "day": "tuesday",
      "start": 705,
      "end": 840
    },
    {
      "type": "lunch",
      "day": "wednesday",
      "start": 705,
      "end": 840
    },
    {
      "type": "lunch",
      "day": "thursday",
      "start": 705,
      "end": 840
    },
    {
      "type": "lunch",
      "day": "friday",
      "start": 705,
      "end": 840
    },
    {
      "type": "lunch",
      "day": "friday",
      "start": 705,
      "end": 840
    },
    {
      "type": "lunch",
      "day": "saturday",
      "start": 705,
      "end": 840
    }
  ],
  "payment_methods": ["cash", "debit_card", "credit_card"],
  "wifi": false,
  "url": "https://i.imgur.com/QwsmbNb.jpg",
  "address": {
    "street": "Überwasserstraße",
    "house_number": "3",
    "zip_code": "48143",
    "city": "Münster",
    "geo": {
      "lat": 51.965230,
      "lon": 7.620721
    }
  },
  "phone_number": "+49251392045"
}

query for all locations which offer happy hours and only show times of type happy hour:

GET /locations/restaurant/_search
{
  "_source": {
    "includes": [ "*" ],
    "excludes": [ "times" ]
  },
  "query": {
    "nested": {
      "path": "times",
      "inner_hits": {
        "_source": [
          "times", "type"
        ]
      },
      "query": {
        "bool": {
          "must": [
            {
              "term": {
                "times.type": "happy_hour"
              }
            }
          ]
        }
      }
    }
  }
}
License

FOSSA Status


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.