wiki.ziemers.de

ziemer's informatik Wiki

Benutzer-Werkzeuge

Webseiten-Werkzeuge


wiki:software:beuthbot:mensa-service

Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen angezeigt.

Link zu dieser Vergleichsansicht

Beide Seiten der vorigen Revision Vorhergehende Überarbeitung
Nächste Überarbeitung
Vorhergehende Überarbeitung
wiki:software:beuthbot:mensa-service [23.01.2020 15:32]
Timo Bruns
wiki:software:beuthbot:mensa-service [24.01.2020 15:12] (aktuell)
Tolga Karaoglu [Versioning]
Zeile 14: Zeile 14:
  - [[wiki:software:beuthbot:mensa-service#structure|Structure]]  - [[wiki:software:beuthbot:mensa-service#structure|Structure]]
  - [[wiki:software:beuthbot:mensa-service#Functionalities|Functionalities]]  - [[wiki:software:beuthbot:mensa-service#Functionalities|Functionalities]]
- - [[wiki:software:beuthbot:mensa-service#the scripts-folder|The Scripts-Folder]] 
  - [[wiki:software:beuthbot:mensa-service#the services-folder|The Services-Folder]]  - [[wiki:software:beuthbot:mensa-service#the services-folder|The Services-Folder]]
  - [[wiki:software:beuthbot:mensa-service#generateResponse.js|generateResponse.js]]  - [[wiki:software:beuthbot:mensa-service#generateResponse.js|generateResponse.js]]
Zeile 35: Zeile 34:
 === Cloning === === Cloning ===
  
-Get the source code by cloning its repository via https: [[https://github.com/Onkilchen/mensa_microservice.git|mensa_microservice]] +Get the source code by cloning its repository via https: [[https://github.com/Onkilchen/mensa_microservice|mensa_microservice]]
  
 === Installing === === Installing ===
Zeile 48: Zeile 46:
 ''npm --version'' ''npm --version''
  
-If you don't have node or npm installed, download the Softare via the links provided in [[wiki:software:beuthbot:mensa-service#prerequisites|Prerequisites]] or search for them via your preferred search engine.\\+If you don't have node or npm installed, download the software via the links provided in [[wiki:software:beuthbot:mensa-service#prerequisites|Prerequisites]] or search for them via your preferred search engine([[https://duckduckgo.com|DuckDuckGo]]).\\
 \\ \\
-After that install all necessesary dependencies\\+After that install all necessesary dependencies in the directory where the package.json exists\\
 \\ \\
 ''npm install''\\ ''npm install''\\
Zeile 68: Zeile 66:
 ==== Structure ==== ==== Structure ====
  
-The microservice consists of four folders containing several scripts, which are designated to perform certain tasks. We have the **scripts**-folder containing scripts, that will be called by cron-jobs mainly for caching purposes. Then we have the **services**-folder containing files, that consist of functions useful to process incoming requests from the chatbot and to generate a formatted answer-string, that contains the requested meal-menu of a specific day from the Beuth mensa. The **routes**-folder consists of all the routes, that can be addressed. In the next chapters we will get into more details about the scripts and their functions.+The microservice consists of four folders containing several scripts, which are designated to perform certain tasks. Then we have the **services**-folder containing files, that consist of functions useful to process incoming requests from the chatbot and to generate a formatted answer-string, that contains the requested meal-menu of a specific day from the Beuth mensa. The **routes**-folder consists of all the routes, that can be addressed. In the next chapters we will get into more details about the scripts and their functions.
  
 ==== Functionalities ==== ==== Functionalities ====
Zeile 74: Zeile 72:
 On request, this microservice makes calls to the [[https://doc.openmensa.org/api/v2/|OpenMensa API]]. The received data is processed by services that give a list of filtered and unfiltered meals of the mensa of the Beuth University for Applied Sciences. Mainly this service was built throughout the Masterprojekt module that is a mandatory part of the media informatics master course of the Beuth University for Applied Sciences. On request, this microservice makes calls to the [[https://doc.openmensa.org/api/v2/|OpenMensa API]]. The received data is processed by services that give a list of filtered and unfiltered meals of the mensa of the Beuth University for Applied Sciences. Mainly this service was built throughout the Masterprojekt module that is a mandatory part of the media informatics master course of the Beuth University for Applied Sciences.
  
-==== The scripts-folder ====+==== Project structure ====
  
-This folder contains two scripts, that will be called by a cron job once a day. Probably early in the morning. `getMealsOfTheDay.js` makes a request to the [[https://doc.openmensa.org/api/v2/|OpenMensa API]] and caches the answer. After that `writeResponseFile.json` is called and generates a pretty formatted answer-string. Now everytime a User wants to know the meals for the day, we can just read it out of the cached data. +=== The services-folder ===
- +
-==== The services-folder ====+
  
 This folder consists of several services, that perform specific tasks for the microservice. This folder consists of several services, that perform specific tasks for the microservice.
  
-=== generateResponse.js ===+== generateResponse.js ==
  
 Creates a nicely formatted string from a mensa-JSON-object and caches it. Creates a nicely formatted string from a mensa-JSON-object and caches it.
  
-=== mealService.js === +== mealsOfSpecificDay.js ==
- +
-Makes a request to the OpenMensa-API and caches the response. It can also filter the file for specific meals. For example only vegetarian or vegan meals, etc. +
- +
-=== mealsOfSpecificDayService.js ===+
  
-If day other than the current day is requested, we need to make another request to the OpenMensa-API, fetch the meals for that specific day, cache them and maybe need to filter them. This is all done by this script.+Makes a request to the OpenMensa API and filters by given entities (for instance vegan and vegetarian meals only).
  
-==== The routes-folder ====+=== The routes-folder ===
  
 This folder contains all the routes, that can be addressed on this server. The `index.js` manages all the routes. We've only got two routes in our project. The `/swagger`-route leads you to the swagger documentation of this project.  This folder contains all the routes, that can be addressed on this server. The `index.js` manages all the routes. We've only got two routes in our project. The `/swagger`-route leads you to the swagger documentation of this project. 
Zeile 116: Zeile 108:
 ==== Versioning ==== ==== Versioning ====
  
-We use [[http://semver.org/|SemVer]] for versioning. For the versions available, see the [[https://github.com/<you>/<your-repo>/tags|tags on this repository]].+We use [[http://semver.org/|SemVer]] for versioning. For the versions available, see the [[https://github.com/Onkilchen/mensa_microservice/tags|tags]] on this repository.
  
 ==== Authors ==== ==== Authors ====
Zeile 123: Zeile 115:
 - **Steven Sobkowski**\\ - **Steven Sobkowski**\\
 \\ \\
-See also the list of [[https://github.com/<you>/<your-repo>/contributors) who participated in this project|contributors]].+See also the list of [[https://github.com/Onkilchen/mensa_microservice/contributors) who participated in this project|contributors]].
 <WRAP pagebreak></WRAP> <WRAP pagebreak></WRAP>
wiki/software/beuthbot/mensa-service.1579789948.txt.gz · Zuletzt geändert: 23.01.2020 15:32 von Timo Bruns