*`messaging`: MQTT messaging components to send data to MQTT broker
*`web`: A small flask application which provides access to selected data provided by `core` and `messaging`.
Architecture:
```bash
web <-> core <-> queue <-> mqtt_publisher
```
Details:
*`web`: The web application has a reference to the core services (e.g., temperature) and has currently two endpoints:
*`/`: Dashboard which shows the latest temperature value
*`/temperature`: Returns the latest temperature value as json
*`core, queue, mqtt_publisher`: The core services (e.g., `temperature`) are decoupled from the `mqtt_publisher` by a shared memory `threadsafe` queue. The `mqtt_publisher` forwards the message with a corresponding topic and payload.
For example:
```bash
temperature <-> TemperatureMeasurement (timestamp=XXX,value=XXX,unit=XXX)
To run edge-IoT simulator with docker, do the follpwing:
* Change to the root directory of this repository
* Build the image: `docker build -t edge:1.0 .`
* Change the working directory to the directory: `cd edge_iot_simulator`
* Create and adjust the `.env` file! Make sure that you take the right IP address for the message broker. If you are running the mqtt broker on the same system (physical host), obtain the broker's ip address via `docker inspect` or take the ip address of the machine (`ip a`)
* Run the image: `docker run -p 5000:5000 --env-file=.env edge:1.0`, choose `docker run -d -p 5000:5000 --env-file=.env edge:1.0`