How sungmin9910/coldchain-digitaltwin-platform works
This repository is a prototype cold-chain traceability and monitoring platform for produce moving from farm/APC to consumers. Its principal workflow is sensor and QR-scanner capture, database-backed lifecycle records, dynamic QR generation, then separate APC and consumer views; the README also describes ledger-based integrity verification and QR recovery. The graph combines documented PoC capabilities with sampled firmware and prototype code. Some final integrations are documented rather than shown in source, so those edges cite the README; prototype MQTT and database wiring is shown in sampled source.
Main entry points: db.py Database connection helper · app.py QR trace web app · Step1_Farm_QR_Creator.py Farm QR generation · Step3_Sorting_QR_Creator.py Sorting QR generation
Components 18
Field hardware
- ESP32 QR scanner
Final_Experiment/2_ESP32_Firmware/src/main.cpp - Sensor telemetry
Hardware_Prototypes/coldchain_module_gy25/src/main.cpp
Traceability records
- Cloud MySQL
QR and integrity
- Farm QR generation
Final_Experiment/1_PC_QR_Generators/Step1_Farm_QR_Creator.py - Sorting QR generation
Final_Experiment/1_PC_QR_Generators/Step3_Sorting_QR_Creator.py - QR recovery
Final_Experiment/QR_Recovery_Script.py - Integrity ledger
Monitoring views
- APC operations dashboard
Final_Experiment/4_APC_Coldchain_Dashboard/Step4_Run_Coldchain_v2.py - Jetson split HUD
Final_Experiment/4_APC_Coldchain_Dashboard/Step4_Jetson_SplitHUD.py - Consumer history dashboard
Final_Experiment/3_Consumer_Dashboard/Step5_Run_Dashboard.py
Prototype apps
- QR trace web app
Hardware_Prototypes/code26/QR/260418code/qr_web/app.py - Database connection helper
Hardware_Prototypes/code26/QR/260418code/qr_web/db.py - Database configuration
Hardware_Prototypes/code26/QR/260418code/qr_web/config.py - Twin sensor API
Hardware_Prototypes/code26/QR/260418code/twin_web/twin_app.py - Twin Streamlit view
Hardware_Prototypes/code26/QR/260418code/twin_web_streamlit/streamlit_app.py
Other components
- MQTT broker
- Consumer
- APC manager
Connections 17
- Sensor telemetry → MQTT broker: publishes telemetry
Hardware_Prototypes/coldchain_module_gy25/src/main.cpp - ESP32 QR scanner → Cloud MySQL: writes scan stages
Final_Experiment/2_ESP32_Firmware/src/main.cpp - MQTT broker → Cloud MySQL: forwards telemetry
- Cloud MySQL → Farm QR generation: supplies lifecycle data
- Cloud MySQL → Sorting QR generation: supplies lifecycle data
- Farm QR generation → Integrity ledger: records verification data
- Sorting QR generation → Integrity ledger: records verification data
- Cloud MySQL → QR recovery: restores scan history
- Cloud MySQL → APC operations dashboard: streams monitoring data
- Cloud MySQL → Jetson split HUD: streams monitoring data
- Cloud MySQL → Consumer history dashboard: provides trace history
- Consumer → Consumer history dashboard: views product history
- APC manager → APC operations dashboard: monitors shipments
- QR trace web app → Database connection helper: queries records
Hardware_Prototypes/code26/QR/260418code/qr_web/app.py - Database connection helper → Database configuration: loads connection settings
Hardware_Prototypes/code26/QR/260418code/qr_web/db.py - QR trace web app → Integrity ledger: checks record hash
Hardware_Prototypes/code26/QR/260418code/qr_web/app.py - Twin sensor API → Database connection helper: queries latest sensors
Hardware_Prototypes/code26/QR/260418code/twin_web/twin_app.py