How raddhikagarg/cold_chain_guardian works
Cold Chain Guardian is a shipment-monitoring platform with a React dashboard and an Express/MongoDB API. Operators configure cargo limits, assign devices, schedule and depart shipments, review telemetry and exposure history, manage alerts, and complete delivery. Device readings enter through the API, where backend services persist and evaluate them for shipment monitoring. The README also describes opt-in simulated telemetry using that ingestion flow; physical ESP32 integration remains a starter. Relationships for unsampled dashboard and service branches are limited to explicit README documentation or shown imports/routes.
Main entry points: App.jsx Web Dashboard · readingService.js Reading Ingestion · shipmentController.js Shipment Controller · app.js Express API
Components 29
Shipment Operations
- Shipment Services
backend/src/services/shipmentService.js - Lifecycle Service
backend/src/services/shipmentLifecycleService.js - Device Assignment
backend/src/services/deviceAssignmentService.js - Device Services
backend/src/services/deviceService.js
Telemetry and Alerts
- Reading Ingestion
backend/src/services/readingService.js - Cargo Evaluation
backend/src/services/cargoEvaluation.js - Alert Evaluation
backend/src/services/systemAlertService.js - Alert Management
backend/src/services/alertService.js - Dashboard Analytics
backend/src/services/dashboardService.js - Monitoring Definitions
backend/src/constants/sensors.js
Backend API
- Express API
backend/src/app.js - Shipment Routes
backend/src/routes/shipmentRoutes.js - Shipment Controller
backend/src/controllers/shipmentController.js - Device Controller
backend/src/controllers/deviceController.js - Reading Controller
backend/src/controllers/readingController.js
Dashboard UI
- Web Dashboard
frontend/src/App.jsx - API Client
frontend/src/utils/api.js - Shipment Views
frontend/src/components/shipments/ShipmentDetail.jsx - Device Views
frontend/src/components/devices/DeviceDetail.jsx - History Views
frontend/src/pages/HistoryPage.jsx - Alert Views
frontend/src/pages/AlertsPage.jsx - Shipment Utilities
frontend/src/utils/shipments.js - Device Utilities
frontend/src/utils/devices.js - History Utilities
frontend/src/utils/history.js - Alert Utilities
frontend/src/utils/alerts.js
Persistence
- MongoDB
backend/src/config/db.js - Domain Models
backend/src/models/index.js
Other components
- Operator
- Monitoring Device
Connections 31
- Operator → Web Dashboard: uses
README.md - Web Dashboard → API Client: calls
frontend/src/App.jsx - API Client → Express API: requests
- Web Dashboard → Shipment Views: renders
frontend/src/App.jsx - Web Dashboard → Device Views: renders
frontend/src/App.jsx - Web Dashboard → History Views: renders
frontend/src/App.jsx - Web Dashboard → Alert Views: renders
frontend/src/App.jsx - Shipment Views → Shipment Utilities: uses
frontend/src/components/shipments/ShipmentDetail.jsx - Device Views → Device Utilities: uses
frontend/src/components/devices/DeviceDetail.jsx - History Views → History Utilities: filters with
frontend/src/pages/HistoryPage.jsx - Alert Views → Alert Utilities: uses
- Monitoring Device → Express API: sends readings
README.md - Express API → Shipment Routes: routes
backend/src/app.js - Shipment Routes → Shipment Controller: dispatches
backend/src/routes/shipmentRoutes.js - Shipment Controller → Shipment Services: calls
backend/src/controllers/shipmentController.js - Shipment Controller → Lifecycle Service: calls
backend/src/controllers/shipmentController.js - Shipment Controller → Device Assignment: calls
backend/src/controllers/shipmentController.js - Device Controller → Device Services: calls
backend/src/controllers/deviceController.js - Device Controller → Reading Ingestion: lists readings
backend/src/controllers/deviceController.js - Reading Controller → Reading Ingestion: ingests and lists
backend/src/controllers/readingController.js - Reading Ingestion → Cargo Evaluation: evaluates cargo
backend/src/services/readingService.js - Reading Ingestion → Alert Evaluation: triggers alerts
backend/src/services/readingService.js - Reading Ingestion → Shipment Services: loads shipment
backend/src/services/readingService.js - Reading Ingestion → Domain Models: reads and writes
backend/src/services/readingService.js - Shipment Services → Domain Models: reads and writes
backend/src/services/shipmentService.js - Lifecycle Service → Domain Models: reads and writes
backend/src/services/shipmentLifecycleService.js - Cargo Evaluation → Monitoring Definitions: uses sensor definitions
- Dashboard Analytics → Domain Models: queries analytics
- Express API → MongoDB: initializes via server
- Operator → Alert Management: acknowledges alerts
README.md - Operator → Lifecycle Service: completes delivery
README.md