A Flutter + Python system for real-time machine data acquisition and visualization.
Edge (Raspberry Pi/PLC) → MQTT → Cloud subscriber → Firestore (live) + MongoDB (history) → Flutter dashboard.
- Edge: PLC → Raspberry Pi publishes telemetry via MQTT.
- Ingest: Cloud Python services subscribe to topics and dual-write to Firestore (real-time) and MongoDB (historical).
- UI: Flutter web/app for live charts, alarms, and CSV exports.
- (Optional): Small FastAPI helpers for API endpoints and CORS.
DataVisulaisationPlatform/
├─ frontend_scripts/ # Flutter web/app (dashboards, charts, auth)
├─ aws_service_scripts/ # Python services: MQTT subscriber, writers, helpers
├─ PLC/ # Edge publisher / PLC gateway scripts
├─ results/ # Screens / output snapshots
├─ README.md
└─ LICENSE # MIT
- Live monitoring from Firestore (low-latency reads)
- Historical trends from MongoDB (long-term storage)
- Multi-parameter plotting with quick parameter selection
- Threshold-based alarms (client-side or server-side)
- CSV export for offline analysis
- Role-based access with Firebase Auth (admin/operator)
- Edge/Gateway: Raspberry Pi, MQTT
- Backend: Python (MQTT subscriber, writers, optional FastAPI)
- Data: Firestore (real-time), MongoDB (history)
- Frontend: Flutter (Dart) web/app
- Flutter SDK installed (
flutter doctorshould pass) - Python 3.10+
- Access to:
- An MQTT broker
- A MongoDB instance
- A Firebase project (Auth + Firestore)
Adjust names/scripts to match your local setup; this repo groups code by responsibility to keep it portable.
git clone https://github.com/quanta-guy/DataVisulaisationPlatform.git
cd DataVisulaisationPlatformcd frontend_scripts
# set API/base URLs and Firebase client config in your environment or config file
flutter pub get
# for web
flutter run -d chrome
# for mobile, pick your device
# flutter runcd ../aws_service_scripts
python -m venv .venv
# Windows: .venv\Scripts\activate
# Linux/macOS: source .venv/bin/activate
pip install -r requirements.txt
# export environment variables (see Configuration below)
# then start your subscriber / writer entrypoint script
python path_to_your_subscriber.py- In
PLC/, configure the publisher with yourMQTT_BROKER,MQTT_PORT, credentials, and base topic. - Point the script to your PLC and publish telemetry at your chosen interval.
- Run as a systemd service for resilience (optional).
Create a .env or use your runtime environment for secrets:
MQTT_BROKERMQTT_PORTMQTT_USERNAMEMQTT_PASSWORDMQTT_TOPIC_BASE
MONGODB_URIMONGODB_DBMONGODB_COLLECTION
GOOGLE_APPLICATION_CREDENTIALS(service account JSON path for server components)- Frontend Firebase config (apiKey, authDomain, projectId, etc.) via your Flutter config
API_BASE_URLALLOWED_ORIGINS
Keep secrets out of source control. Use
.gitignorefor.envand service account files.
- Topics:
site/{site_id}/line/{line_id}/machine/{machine_id}/{signal} - Payload: JSON with timestamp, value, quality (example)
- Firestore: recent, frequently-read documents for live UI
- MongoDB: append-only timeseries collections for analytics
- Flutter:
flutter test - Python: add
pytestandruff(orflake8) torequirements-dev.txtand run locally or in CI
- Edge: run publisher as a systemd service on the Pi
- Cloud: run subscriber/writers as services (PM2, systemd, Docker, or your cloud’s app runner)
- Frontend:
flutter build weband serve via any static host / CDN
- Predictive maintenance models on MongoDB history
- Customizable dashboards by role
- Improved multi-tenant/topic configuration
Balaji Jayaprakash - @balajijp8 (https://github.com/balajijp8-boop)
PRs welcome. Keep commits focused and add a short rationale in the description.
For issues, include repro steps, logs, and platform info.
MIT — see LICENSE.