This repo defines four microservices.
1. MQTT Broker
2. Python "Funnel"
3. MySql Database
4. Python Flask API
On a broad scale, the purpose of these microservices is to store and make JSON readable measurements from IOT devices.
Data travels through these microservices as follows...
The bench microcontroller will publish messages to the broker containing the temp and capacity of the battery to the topic "idsbench1/measurement". The broker will then pass that measurement to all programs subscribed to the topic.
The funnel is a constantly running Python project that is subscribed to the topic "idsbench1/measurement" on the broker. When a message is sent through the broker, the funnel will receive and "funnel" the message into the MySql server.
Stores the measurements from the microcontroller on database "idsBench" on one table (If the number of benches expands, there is a possibility to expand the number of tables in the database). This table holds cols "Time," "Temp," and "Capacity." Importantly, MySql data is tied to a docker volume; therefore, the data will persist between containers.
Lastly, the Flask app allows retrieval from the MySql database through REST API in JSON format. It will update its data every 5 seconds.