# raymund-panganiban-etom/thesis_for_app_dev architecture

> Architecture diagram of the GitHub repository raymund-panganiban-etom/thesis_for_app_dev, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/raymund-panganiban-etom/thesis_for_app_dev
- Repository: https://github.com/raymund-panganiban-etom/thesis_for_app_dev

## Overview

This repository is an ESP32-based edge-AI post-harvest storage portal: users monitor produce-storage conditions through browser dashboards connected to device telemetry. The main dashboard polls an ESP32-S3 access point, presents sensor and fan status, and maintains event and sync UI; other variants use BLE or HTTP, with a separate camera and voice-AI trial. Classifier headers and SD-card helpers are present, but the excerpts do not show how firmware invokes them. Several device and UI relationships therefore remain unconnected rather than inferred.

Main entry points: [`script.js`](https://github.com/raymund-panganiban-etom/thesis_for_app_dev/blob/main/script.js) (AP dashboard), [`http_version/trial/app.js`](https://github.com/raymund-panganiban-etom/thesis_for_app_dev/blob/main/http_version/trial/app.js) (Camera controls), [`http_version/trial/bridge.js`](https://github.com/raymund-panganiban-etom/thesis_for_app_dev/blob/main/http_version/trial/bridge.js) (Voice bridge), [`app.js`](https://github.com/raymund-panganiban-etom/thesis_for_app_dev/blob/main/app.js) (BLE dashboard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_dash["Monitoring dashboards"]
  node_mainui["AP dashboard<br/>[script.js]"]
  node_bleui["BLE dashboard<br/>[app.js]"]
  node_httpui["HTTP dashboard<br/>[app.js]"]
  node_testui["Test dashboard<br/>[app.js]"]
end

subgraph group_device["ESP32 device"]
  node_device["ESP32 firmware<br/>[esp32-s3code.ino]"]
  node_httpdevice["HTTP firmware"]
  node_sd[("SD-card files<br/>[sd_read_write.cpp]")]
end

subgraph group_ml["Produce classifiers"]
  node_banana["Banana model<br/>[BananaClassifier.h]"]
  node_calamansi["Calamansi model"]
  node_corn["Corn model<br/>[CornClassifier.h]"]
  node_pomelo["Pomelo model<br/>[PomeloClassifier.h]"]
  node_stringbeans["Stringbeans model"]
end

subgraph group_camera["Camera and voice"]
  node_trialui["Camera controls<br/>[app.js]"]
  node_bridge["Voice bridge<br/>[bridge.js]"]
end

node_user(("Storage operator"))
node_operator(("Dashboard user"))
node_espservice["ESP32 service"]
node_xiaozhi["XiaoZhi service"]

node_user -->|"monitors"| node_mainui
node_mainui -->|"polls telemetry"| node_espservice
node_mainui -->|"posts events"| node_espservice
node_httpui -->|"fetches readings"| node_espservice
node_bleui -->|"connects by BLE"| node_espservice
node_testui -->|"pings device"| node_espservice
node_user -->|"controls camera"| node_trialui
node_trialui -->|"requests camera"| node_espservice
node_trialui -->|"opens voice socket"| node_bridge
node_bridge -->|"relays voice"| node_xiaozhi

click node_mainui "https://github.com/raymund-panganiban-etom/thesis_for_app_dev/blob/main/script.js"
click node_bleui "https://github.com/raymund-panganiban-etom/thesis_for_app_dev/blob/main/app.js"
click node_httpui "https://github.com/raymund-panganiban-etom/thesis_for_app_dev/blob/main/http_version/app.js"
click node_testui "https://github.com/raymund-panganiban-etom/thesis_for_app_dev/blob/main/testing_thesis/app.js"
click node_device "https://github.com/raymund-panganiban-etom/thesis_for_app_dev/blob/main/esp32-s3code.ino"
click node_httpdevice "https://github.com/raymund-panganiban-etom/thesis_for_app_dev/blob/main/http_version/ESP32-S3_N16R8_AP/ESP32-S3_N16R8_AP.ino"
click node_sd "https://github.com/raymund-panganiban-etom/thesis_for_app_dev/blob/main/sd_read_write.cpp"
click node_banana "https://github.com/raymund-panganiban-etom/thesis_for_app_dev/blob/main/BananaClassifier.h"
click node_calamansi "https://github.com/raymund-panganiban-etom/thesis_for_app_dev/blob/main/CalamansiClassifier.h"
click node_corn "https://github.com/raymund-panganiban-etom/thesis_for_app_dev/blob/main/CornClassifier.h"
click node_pomelo "https://github.com/raymund-panganiban-etom/thesis_for_app_dev/blob/main/PomeloClassifier.h"
click node_stringbeans "https://github.com/raymund-panganiban-etom/thesis_for_app_dev/blob/main/StringbeansClassifier.h"
click node_trialui "https://github.com/raymund-panganiban-etom/thesis_for_app_dev/blob/main/http_version/trial/app.js"
click node_bridge "https://github.com/raymund-panganiban-etom/thesis_for_app_dev/blob/main/http_version/trial/bridge.js"

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_mainui,node_bleui,node_httpui,node_testui,node_operator toneBlue
class node_device,node_httpdevice,node_sd,node_user toneAmber
class node_banana,node_calamansi,node_corn,node_pomelo,node_stringbeans toneMint
class node_trialui,node_bridge toneRose
class node_espservice,node_xiaozhi toneIndigo
```

## Components

### Monitoring dashboards

- [AP dashboard](https://github.com/raymund-panganiban-etom/thesis_for_app_dev/blob/main/script.js): `script.js`
- [BLE dashboard](https://github.com/raymund-panganiban-etom/thesis_for_app_dev/blob/main/app.js): `app.js`
- [HTTP dashboard](https://github.com/raymund-panganiban-etom/thesis_for_app_dev/blob/main/http_version/app.js): `http_version/app.js`
- [Test dashboard](https://github.com/raymund-panganiban-etom/thesis_for_app_dev/blob/main/testing_thesis/app.js): `testing_thesis/app.js`

### ESP32 device

- [ESP32 firmware](https://github.com/raymund-panganiban-etom/thesis_for_app_dev/blob/main/esp32-s3code.ino): `esp32-s3code.ino`
- [HTTP firmware](https://github.com/raymund-panganiban-etom/thesis_for_app_dev/blob/main/http_version/ESP32-S3_N16R8_AP/ESP32-S3_N16R8_AP.ino): `http_version/ESP32-S3_N16R8_AP/ESP32-S3_N16R8_AP.ino`
- [SD-card files](https://github.com/raymund-panganiban-etom/thesis_for_app_dev/blob/main/sd_read_write.cpp): `sd_read_write.cpp`

### Produce classifiers

- [Banana model](https://github.com/raymund-panganiban-etom/thesis_for_app_dev/blob/main/BananaClassifier.h): `BananaClassifier.h`
- [Calamansi model](https://github.com/raymund-panganiban-etom/thesis_for_app_dev/blob/main/CalamansiClassifier.h): `CalamansiClassifier.h`
- [Corn model](https://github.com/raymund-panganiban-etom/thesis_for_app_dev/blob/main/CornClassifier.h): `CornClassifier.h`
- [Pomelo model](https://github.com/raymund-panganiban-etom/thesis_for_app_dev/blob/main/PomeloClassifier.h): `PomeloClassifier.h`
- [Stringbeans model](https://github.com/raymund-panganiban-etom/thesis_for_app_dev/blob/main/StringbeansClassifier.h): `StringbeansClassifier.h`

### Camera and voice

- [Camera controls](https://github.com/raymund-panganiban-etom/thesis_for_app_dev/blob/main/http_version/trial/app.js): `http_version/trial/app.js`
- [Voice bridge](https://github.com/raymund-panganiban-etom/thesis_for_app_dev/blob/main/http_version/trial/bridge.js): `http_version/trial/bridge.js`

### Other components

- **Storage operator**
- **Dashboard user**
- **ESP32 service**
- **XiaoZhi service**

## Connections

- Storage operator → AP dashboard: monitors (evidence: `script.js`)
- AP dashboard → ESP32 service: polls telemetry (evidence: `script.js`)
- AP dashboard → ESP32 service: posts events (evidence: `script.js`)
- HTTP dashboard → ESP32 service: fetches readings (evidence: `http_version/app.js`)
- BLE dashboard → ESP32 service: connects by BLE (evidence: `app.js`)
- Test dashboard → ESP32 service: pings device (evidence: `testing_thesis/app.js`)
- Storage operator → Camera controls: controls camera (evidence: `http_version/trial/app.js`)
- Camera controls → ESP32 service: requests camera (evidence: `http_version/trial/app.js`)
- Camera controls → Voice bridge: opens voice socket (evidence: `http_version/trial/app.js`)
- Voice bridge → XiaoZhi service: relays voice (evidence: `http_version/trial/bridge.js`)
