- Overview
- System Architecture
- Setup Instructions
- Installing Dependencies and Running the System
- Documentation
- Technologies Used
- Code Documentation
- Decision Documentation
This project simulates the collection of temperature and humidity data from various sensors. The data is aggregated by hubs, sent to a server via MQTT, stored in InfluxDB and PostgreSQL, and displayed using a React-based web dashboard.
The system is composed of the following key components:
- Simulated Sensors: Generate random temperature and humidity data.
- Hubs: Collect data from sensors and publish it to an MQTT broker.
- MQTT Broker: Facilitates communication between hubs and the server.
- Server: Subscribes to MQTT topics, processes incoming data, and stores it in InfluxDB.
- Database: InfluxDB to store time-series data and PostgreSQL to manage user data and authentication.
- Data Visualization: A React-based dashboard to visualize the collected sensor data.
-
Backend (Python and PostgreSQL and MQTT Broker and InfluxDB)
docker-compose up
-
Frontend (React)
cd dashboard npm install npm start
- Python: For simulating sensors and hubs, and for the FastAPI web server.
- MQTT (Mosquitto): For data communication.
- FastAPI: For developing the web server.
- InfluxDB: Ideal for time-series data storage and you can access to its UI dashboard via localhost.
- PostgreSQL: Robust database for storing user authentication data.
- React: Preferred for its component-based architecture and dynamic UI capabilities.
-
Hub Simulator (Python):
- Simulates sensors generating random data.
- Publishes data to MQTT topics.
-
FastAPI Server:
- Subscribes to MQTT topics.
- Processes and stores data in InfluxDB.
- Provides REST endpoints to fetch data for visualization and hub ids.
- User registration and authentication using PostgreSQL.
- You can access documentation and schemas via docs.
- And there is a postman API Collection that you can import and use.
- Provides a web-socket api to stream hubs data real-time.
-
React Dashboard:
- Fetches sensor data and hub ids from the FastAPI server.
- Visualizes data using Chart.js (react-chartjs-2).
- Visualizes Real-Time Chart using web socket and you can choose between them.
- Advanced Data Filtering by date and time and hub ids and you can have all your hub data in just one chart.
- Provides user login interface.
- Uses Material UI to enhance the UI.
- You can access it via localhost after npm start.
- Technology Choices:
- MQTT: Chosen for its lightweight, reliable messaging suited for IoT scenarios.
- FastAPI: Selected for its fast performance, ease of use, and modern Python support.
- InfluxDB: Ideal for time-series data storage with efficient querying.
- PostgreSQL: Robust and reliable for user data and authentication.
- React: Preferred for its component-based architecture and dynamic UI capabilities.

