# akshajag/fridgeopensourcecoderedorion architecture

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

- Interactive diagram: https://gitdiagram.com/akshajag/fridgeopensourcecoderedorion
- Repository: https://github.com/akshajag/fridgeopensourcecoderedorion

## Overview

Nourish combines three operational flows: sensor telemetry and condition/thermal monitoring, camera-based donation and shelf observation, and a local voice-assisted food-bank demo. Hardware readings enter the Tiger Data service; the camera service exposes Gemini-backed identification and inventory analysis; the Python application provides local vision, voice, and shelf-audit capabilities. The excerpts support key service and helper relationships, but do not show all browser/API wiring or the full Python orchestration, so those links are omitted rather than inferred.

Main entry points: [`fridge_ui.py`](https://github.com/akshajag/fridgeopensourcecoderedorion/blob/main/fridge_ui.py) (Demo interface), [`tiger-data/server.js`](https://github.com/akshajag/fridgeopensourcecoderedorion/blob/main/tiger-data/server.js) (Monitoring API), [`tiger-data/serial-bridge.js`](https://github.com/akshajag/fridgeopensourcecoderedorion/blob/main/tiger-data/serial-bridge.js) (Serial ingestion), [`tiger-data/db.js`](https://github.com/akshajag/fridgeopensourcecoderedorion/blob/main/tiger-data/db.js) (Database pool)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_sensors["Sensors and monitoring"]
  node_board["Fridge sensors"]
  node_ingest["Serial ingestion<br/>[serial-bridge.js]"]
  node_parser["Reading parser<br/>[sensor-parser.js]"]
  node_alerts["Condition alerts<br/>[conditions.js]"]
  node_thermal_api["Monitoring API<br/>[server.js]"]
  node_dashboard["Live monitor<br/>[monitor.js]"]
  node_query["Thermal query<br/>[thermal-query.js]"]
  node_thermal_math["Thermal metrics<br/>[thermal-math.js]"]
end

subgraph group_camera["Camera service"]
  node_camera_ui["Camera web UI<br/>[index.html]"]
  node_camera_api["Camera API<br/>[app.js]"]
  node_vision_service["Gemini analysis<br/>[vision.js]"]
  node_audit_ui["Audit client<br/>[audit.js]"]
  node_tracker["Inventory tracker<br/>[tracker.js]"]
end

subgraph group_local["Local food-bank app"]
  node_local_ui["Demo interface<br/>[fridge_ui.py]"]
  node_voice["Voice agent"]
  node_local_vision["On-device vision"]
  node_gemini_vision["Donation vision<br/>[fridge_vision.py]"]
  node_shelf_audit["Shelf audits"]
end

subgraph group_persistence["Monitoring data"]
  node_db_pool["Database pool<br/>[db.js]"]
  node_timescale[("TimescaleDB")]
end

node_gemini["Gemini API"]
node_elevenlabs["ElevenLabs"]
node_openfoodfacts["Open Food Facts"]
node_donor(("Donor"))

node_board -->|"sends readings"| node_ingest
node_ingest -->|"parses lines"| node_parser
node_ingest -->|"writes readings"| node_db_pool
node_thermal_api -->|"queries data"| node_db_pool
node_thermal_api -->|"requests metrics"| node_query
node_thermal_api -->|"uses conditions"| node_alerts
node_query -->|"calculates metrics"| node_thermal_math
node_db_pool -->|"connects to"| node_timescale
node_camera_api -->|"calls analysis"| node_vision_service
node_camera_api -->|"serves files"| node_camera_ui
node_vision_service -->|"analyzes images"| node_gemini
node_local_ui -->|"starts agent"| node_voice
node_local_ui -->|"starts audits"| node_shelf_audit
node_local_ui -.->|"configures vision"| node_local_vision
node_local_ui -.->|"configures vision"| node_gemini_vision
node_gemini_vision -->|"requests vision"| node_gemini
node_local_vision -->|"looks up barcodes"| node_openfoodfacts
node_voice -.->|"runs conversation"| node_elevenlabs

click node_board "https://github.com/akshajag/fridgeopensourcecoderedorion/blob/main/hardware/fridge_all_sensors/fridge_all_sensors.ino"
click node_ingest "https://github.com/akshajag/fridgeopensourcecoderedorion/blob/main/tiger-data/serial-bridge.js"
click node_parser "https://github.com/akshajag/fridgeopensourcecoderedorion/blob/main/tiger-data/sensor-parser.js"
click node_alerts "https://github.com/akshajag/fridgeopensourcecoderedorion/blob/main/tiger-data/conditions.js"
click node_thermal_api "https://github.com/akshajag/fridgeopensourcecoderedorion/blob/main/tiger-data/server.js"
click node_dashboard "https://github.com/akshajag/fridgeopensourcecoderedorion/blob/main/tiger-data/public/monitor.js"
click node_query "https://github.com/akshajag/fridgeopensourcecoderedorion/blob/main/tiger-data/thermal-query.js"
click node_thermal_math "https://github.com/akshajag/fridgeopensourcecoderedorion/blob/main/tiger-data/thermal-math.js"
click node_db_pool "https://github.com/akshajag/fridgeopensourcecoderedorion/blob/main/tiger-data/db.js"
click node_camera_ui "https://github.com/akshajag/fridgeopensourcecoderedorion/blob/main/camera-service/public/index.html"
click node_camera_api "https://github.com/akshajag/fridgeopensourcecoderedorion/blob/main/camera-service/app.js"
click node_vision_service "https://github.com/akshajag/fridgeopensourcecoderedorion/blob/main/camera-service/vision.js"
click node_audit_ui "https://github.com/akshajag/fridgeopensourcecoderedorion/blob/main/camera-service/public/audit.js"
click node_tracker "https://github.com/akshajag/fridgeopensourcecoderedorion/blob/main/camera-service/public/tracker.js"
click node_local_ui "https://github.com/akshajag/fridgeopensourcecoderedorion/blob/main/fridge_ui.py"
click node_voice "https://github.com/akshajag/fridgeopensourcecoderedorion/blob/main/fridge_voice_agent.py"
click node_local_vision "https://github.com/akshajag/fridgeopensourcecoderedorion/blob/main/fridge_local_vision.py"
click node_gemini_vision "https://github.com/akshajag/fridgeopensourcecoderedorion/blob/main/fridge_vision.py"
click node_shelf_audit "https://github.com/akshajag/fridgeopensourcecoderedorion/blob/main/fridge_inventory.py"

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_board,node_ingest,node_parser,node_alerts,node_thermal_api,node_dashboard,node_query,node_thermal_math toneBlue
class node_camera_ui,node_camera_api,node_vision_service,node_audit_ui,node_tracker toneAmber
class node_local_ui,node_voice,node_local_vision,node_gemini_vision,node_shelf_audit,node_gemini toneMint
class node_db_pool,node_timescale toneRose
class node_elevenlabs,node_openfoodfacts,node_donor toneIndigo
```

## Components

### Sensors and monitoring

- [Fridge sensors](https://github.com/akshajag/fridgeopensourcecoderedorion/blob/main/hardware/fridge_all_sensors/fridge_all_sensors.ino): `hardware/fridge_all_sensors/fridge_all_sensors.ino`
- [Serial ingestion](https://github.com/akshajag/fridgeopensourcecoderedorion/blob/main/tiger-data/serial-bridge.js): `tiger-data/serial-bridge.js`
- [Reading parser](https://github.com/akshajag/fridgeopensourcecoderedorion/blob/main/tiger-data/sensor-parser.js): `tiger-data/sensor-parser.js`
- [Condition alerts](https://github.com/akshajag/fridgeopensourcecoderedorion/blob/main/tiger-data/conditions.js): `tiger-data/conditions.js`
- [Monitoring API](https://github.com/akshajag/fridgeopensourcecoderedorion/blob/main/tiger-data/server.js): `tiger-data/server.js`
- [Live monitor](https://github.com/akshajag/fridgeopensourcecoderedorion/blob/main/tiger-data/public/monitor.js): `tiger-data/public/monitor.js`
- [Thermal query](https://github.com/akshajag/fridgeopensourcecoderedorion/blob/main/tiger-data/thermal-query.js): `tiger-data/thermal-query.js`
- [Thermal metrics](https://github.com/akshajag/fridgeopensourcecoderedorion/blob/main/tiger-data/thermal-math.js): `tiger-data/thermal-math.js`

### Camera service

- [Camera web UI](https://github.com/akshajag/fridgeopensourcecoderedorion/blob/main/camera-service/public/index.html): `camera-service/public/index.html`
- [Camera API](https://github.com/akshajag/fridgeopensourcecoderedorion/blob/main/camera-service/app.js): `camera-service/app.js`
- [Gemini analysis](https://github.com/akshajag/fridgeopensourcecoderedorion/blob/main/camera-service/vision.js): `camera-service/vision.js`
- [Audit client](https://github.com/akshajag/fridgeopensourcecoderedorion/blob/main/camera-service/public/audit.js): `camera-service/public/audit.js`
- [Inventory tracker](https://github.com/akshajag/fridgeopensourcecoderedorion/blob/main/camera-service/public/tracker.js): `camera-service/public/tracker.js`

### Local food-bank app

- [Demo interface](https://github.com/akshajag/fridgeopensourcecoderedorion/blob/main/fridge_ui.py): `fridge_ui.py`
- [Voice agent](https://github.com/akshajag/fridgeopensourcecoderedorion/blob/main/fridge_voice_agent.py): `fridge_voice_agent.py`
- [On-device vision](https://github.com/akshajag/fridgeopensourcecoderedorion/blob/main/fridge_local_vision.py): `fridge_local_vision.py`
- [Donation vision](https://github.com/akshajag/fridgeopensourcecoderedorion/blob/main/fridge_vision.py): `fridge_vision.py`
- [Shelf audits](https://github.com/akshajag/fridgeopensourcecoderedorion/blob/main/fridge_inventory.py): `fridge_inventory.py`

### Monitoring data

- [Database pool](https://github.com/akshajag/fridgeopensourcecoderedorion/blob/main/tiger-data/db.js): `tiger-data/db.js`
- **TimescaleDB**

### Other components

- **Gemini API**
- **ElevenLabs**
- **Open Food Facts**
- **Donor**

## Connections

- Fridge sensors → Serial ingestion: sends readings (evidence: `README.md`)
- Serial ingestion → Reading parser: parses lines (evidence: `tiger-data/serial-bridge.js`)
- Serial ingestion → Database pool: writes readings (evidence: `tiger-data/serial-bridge.js`)
- Monitoring API → Database pool: queries data (evidence: `tiger-data/server.js`)
- Monitoring API → Thermal query: requests metrics (evidence: `tiger-data/server.js`)
- Monitoring API → Condition alerts: uses conditions (evidence: `tiger-data/server.js`)
- Thermal query → Thermal metrics: calculates metrics (evidence: `tiger-data/thermal-query.js`)
- Database pool → TimescaleDB: connects to (evidence: `tiger-data/db.js`)
- Camera API → Gemini analysis: calls analysis (evidence: `camera-service/app.js`)
- Camera API → Camera web UI: serves files (evidence: `camera-service/app.js`)
- Gemini analysis → Gemini API: analyzes images (evidence: `camera-service/vision.js`)
- Demo interface → Voice agent: starts agent (evidence: `fridge_ui.py`)
- Demo interface → Shelf audits: starts audits (evidence: `fridge_ui.py`)
- Demo interface → On-device vision: configures vision (evidence: `fridge_ui.py`)
- Demo interface → Donation vision: configures vision (evidence: `fridge_ui.py`)
- Donation vision → Gemini API: requests vision (evidence: `fridge_vision.py`)
- On-device vision → Open Food Facts: looks up barcodes (evidence: `fridge_local_vision.py`)
- Voice agent → ElevenLabs: runs conversation
