This component is part of the the distributed system DENTISTIMO, a web application that offers a geolocalisation based dental care booking system. The clinic handler provides other components with dentistry data and updates the database. More details can be found in the component diagram in the documentation repository.
- Read dentist data from URL (https://raw.githubusercontent.com/feldob/dit355_2020/master/dentists.json)
- Save dentist data to database
- Listen to MQTT broker for dentist data requests from frontend (subscribed to topic: get_all_clinics)
- Publish dentistry data via MQTT (publish to topic: stored_new_clinic)
The component gets the dentist data from a JSON file.
The JSON objects should have at least these information for the following tasks:
- Store clinics: a JSON object following the clinic schema:
Example
{
"dentists": [
{
"id": 1,
"name": "Your Dentist",
"owner": "Dan Tist",
"dentists": 3,
"address": "Spannmålsgatan 20",
"city": "Gothenburg",
"coordinate": {
"longitude": 11.969388,
"latitude": 57.707619
},
"openinghours": {
"monday": "9:00-17:00",
"tuesday": "8:00-17:00",
"wednesday": "7:00-16:00",
"thursday": "9:00-17:00",
"friday": "9:00-15:00"
}
},
The component sends stringified JSON objects.
You need to have a running version of MQTT on your machine. Please refer to this link to download the mosquitto broker if you do not have any.
To download the latest version of node.js, please follow this link
In the window of your broker, you should see a message similar to this:
1638885841: New client connected from 127.0.0.1:49531 as Dentistimo Team5 - Clinic Handler n°3c1ff99e (p2, c1, k60).
The Clinic Handler is now ready to proceed your requests.