# rubashreekt/smart_food_spoilage_monitoring architecture

> Architecture diagram of the GitHub repository rubashreekt/smart_food_spoilage_monitoring, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/rubashreekt/smart_food_spoilage_monitoring
- Repository: https://github.com/rubashreekt/smart_food_spoilage_monitoring

## Overview

This project monitors food-storage conditions with ESP32 sensors, stores readings in Firebase, and presents analytics and safety alerts in a web dashboard. The documented capabilities also include a spoilage-prediction algorithm, periodic ESP32-CAM image capture, and local buzzer/LED warnings. The tree identifies the sensor and camera firmware files but gives no dashboard files, and no source excerpts were supplied; consequently, implementation details and undocumented connections are omitted. Edges reflect only relationships stated in the README.

Main entry points: [`ESP32Sensor_Code/ESP32Sensor_final.ino`](https://github.com/rubashreekt/smart_food_spoilage_monitoring/blob/main/ESP32Sensor_Code/ESP32Sensor_final.ino) (ESP32 sensor firmware), [`ESP32CAM_Code/ESP32CAM_final.ino`](https://github.com/rubashreekt/smart_food_spoilage_monitoring/blob/main/ESP32CAM_Code/ESP32CAM_final.ino) (Camera capture firmware), [`FoodDashboard`](https://github.com/rubashreekt/smart_food_spoilage_monitoring/tree/main/FoodDashboard) (Web dashboard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_sensing["Sensing and capture"]
  node_sensors["DHT22 and MQ sensors"]
  node_sensor_firmware["ESP32 sensor firmware"]
  node_prediction["Spoilage prediction"]
  node_camera_firmware["Camera capture firmware<br/>[ESP32CAM_final.ino]"]
end

subgraph group_cloud["Cloud and dashboard"]
  node_firebase[("Firebase Realtime Database")]
  node_dashboard["Web dashboard"]
end

subgraph group_warnings["Safety warnings"]
  node_warnings_output["Buzzer and LEDs"]
end

node_storage_conditions["Storage conditions"]
node_camera["ESP32-CAM"]

node_storage_conditions -->|"measured by"| node_sensors
node_sensors -->|"provide readings"| node_sensor_firmware
node_sensor_firmware -->|"uploads data"| node_firebase
node_firebase -->|"stores dashboard data"| node_dashboard
node_camera_firmware -->|"captures every 20s"| node_camera

click node_sensor_firmware "https://github.com/rubashreekt/smart_food_spoilage_monitoring/blob/main/ESP32Sensor_Code/ESP32Sensor_final.ino"
click node_prediction "https://github.com/rubashreekt/smart_food_spoilage_monitoring/tree/main/ESP32Sensor_Code"
click node_camera_firmware "https://github.com/rubashreekt/smart_food_spoilage_monitoring/blob/main/ESP32CAM_Code/ESP32CAM_final.ino"
click node_dashboard "https://github.com/rubashreekt/smart_food_spoilage_monitoring/tree/main/FoodDashboard"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_sensors,node_sensor_firmware,node_prediction,node_camera_firmware toneBlue
class node_firebase,node_dashboard,node_storage_conditions toneAmber
class node_warnings_output toneMint
class node_camera toneIndigo
```

## Components

### Sensing and capture

- **DHT22 and MQ sensors**
- [ESP32 sensor firmware](https://github.com/rubashreekt/smart_food_spoilage_monitoring/blob/main/ESP32Sensor_Code/ESP32Sensor_final.ino): `ESP32Sensor_Code/ESP32Sensor_final.ino`
- [Spoilage prediction](https://github.com/rubashreekt/smart_food_spoilage_monitoring/tree/main/ESP32Sensor_Code): `ESP32Sensor_Code`
- [Camera capture firmware](https://github.com/rubashreekt/smart_food_spoilage_monitoring/blob/main/ESP32CAM_Code/ESP32CAM_final.ino): `ESP32CAM_Code/ESP32CAM_final.ino`

### Cloud and dashboard

- **Firebase Realtime Database**
- [Web dashboard](https://github.com/rubashreekt/smart_food_spoilage_monitoring/tree/main/FoodDashboard): `FoodDashboard`

### Safety warnings

- **Buzzer and LEDs**

### Other components

- **Storage conditions**
- **ESP32-CAM**

## Connections

- Storage conditions → DHT22 and MQ sensors: measured by (evidence: `README.md`)
- DHT22 and MQ sensors → ESP32 sensor firmware: provide readings (evidence: `README.md`)
- ESP32 sensor firmware → Firebase Realtime Database: uploads data (evidence: `README.md`)
- Firebase Realtime Database → Web dashboard: stores dashboard data (evidence: `README.md`)
- Camera capture firmware → ESP32-CAM: captures every 20s (evidence: `README.md`)
