# deepnan-umhack/scada-i-umhack26 architecture

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

- Interactive diagram: https://gitdiagram.com/deepnan-umhack/scada-i-umhack26
- Repository: https://github.com/deepnan-umhack/scada-i-umhack26

## Overview

SCADA-i is an AI-powered smart-building control system with natural-language interactions, autonomous HVAC optimization, room and equipment booking, ESG analysis, and web dashboards. A typical request enters through the mobile-facing app and agent API, is routed by the supervisor to a domain agent, and may produce a building-control action or booking/ESG result. Sensor data also enters through MQTT and is stored for operational use. README documentation supports the broad subsystem relationships; the sampled code confirms HVAC decision handling and sensor persistence, but not all integration details.

Main entry points: [`agents/orchestrator/supervisor.py`](https://github.com/deepnan-umhack/scada-i-umhack26/blob/main/agents/orchestrator/supervisor.py) (Agent Supervisor), [`website/src/App.tsx`](https://github.com/deepnan-umhack/scada-i-umhack26/blob/main/website/src/App.tsx) (Mobile App), [`dashboard/scada-i-react/src/App.tsx`](https://github.com/deepnan-umhack/scada-i-umhack26/blob/main/dashboard/scada-i-react/src/App.tsx) (Web Dashboard), [`agents/booking_agent/booking_agent.py`](https://github.com/deepnan-umhack/scada-i-umhack26/blob/main/agents/booking_agent/booking_agent.py) (Booking Agent)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interaction["User Applications"]
  node_mobile["Mobile App<br/>[App.tsx]"]
  node_chat["Chat Interface<br/>[MainChat.tsx]"]
  node_booking_ui["Booking Views<br/>[BrowseSpaces.tsx]"]
  node_booking_status["Booking Status<br/>[BookingStatus.tsx]"]
  node_dashboard["Web Dashboard<br/>[App.tsx]"]
  node_dashboard_page["Live Analytics<br/>[Dashboard.tsx]"]
  node_esg_page["ESG Reports<br/>[EsgReports.tsx]"]
end

subgraph group_coordination["Agent Coordination"]
  node_api["Agent API<br/>[api.py]"]
  node_supervisor["Agent Supervisor<br/>[supervisor.py]"]
end

subgraph group_domains["Domain Agents"]
  node_booking["Booking Agent<br/>[booking_agent.py]"]
  node_booking_tools["Booking Operations"]
  node_hvac["HVAC Agent<br/>[hvac_agent.py]"]
  node_hvac_service["HVAC Request Service<br/>[service.py]"]
  node_hvac_controller["HVAC Controller<br/>[controller.py]"]
  node_hvac_schemas["HVAC Data Models<br/>[schemas.py]"]
  node_esg["ESG Agent<br/>[esg_agent.py]"]
  node_esg_tools["ESG Analysis Tools"]
  node_policy_search["Policy Search<br/>[PolicyRetriever.py]"]
end

subgraph group_building["Building Data"]
  node_sensor_ingestor["Sensor Ingestor<br/>[sensor_ingestor.py]"]
  node_mqtt["MQTT Broker<br/>[mqtt.py]"]
  node_postgres[("Operational Database<br/>[postgres_client.py]")]
end

node_user(("Building User"))
node_device(("Building Devices"))
node_supabase[("Supabase")]

node_user -->|"uses"| node_mobile
node_mobile -->|"presents chat"| node_chat
node_user -->|"views analytics"| node_dashboard
node_dashboard -->|"routes to"| node_dashboard_page
node_dashboard -->|"routes to"| node_esg_page
node_booking_ui -->|"opens status"| node_booking_status
node_mobile -->|"presents views"| node_booking_ui
node_chat -.->|"submits queries"| node_api
node_api -.->|"enters orchestration"| node_supervisor
node_supervisor -->|"routes queries"| node_booking
node_supervisor -->|"routes queries"| node_hvac
node_supervisor -->|"routes queries"| node_esg
node_booking -.->|"uses tools"| node_booking_tools
node_esg -.->|"uses tools"| node_esg_tools
node_esg_tools -.->|"retrieves policies"| node_policy_search
node_hvac -.->|"handles requests"| node_hvac_service
node_hvac_service -->|"requests decision"| node_hvac_controller
node_hvac_controller -->|"uses models"| node_hvac_schemas
node_hvac_service -->|"builds requests"| node_hvac_schemas
node_device -->|"publishes telemetry"| node_mqtt
node_mqtt -->|"delivers messages"| node_sensor_ingestor
node_sensor_ingestor -->|"upserts state"| node_postgres
node_hvac -.->|"sends controls"| node_device
node_dashboard_page -.->|"shows IoT streams"| node_device
node_booking -.->|"manages records"| node_supabase
node_policy_search -->|"searches policies"| node_supabase
node_esg_page -.->|"views reports"| node_esg

click node_mobile "https://github.com/deepnan-umhack/scada-i-umhack26/blob/main/website/src/App.tsx"
click node_chat "https://github.com/deepnan-umhack/scada-i-umhack26/blob/main/website/src/pages/MainChat.tsx"
click node_booking_ui "https://github.com/deepnan-umhack/scada-i-umhack26/blob/main/website/src/pages/BrowseSpaces.tsx"
click node_booking_status "https://github.com/deepnan-umhack/scada-i-umhack26/blob/main/website/src/pages/BookingStatus.tsx"
click node_dashboard "https://github.com/deepnan-umhack/scada-i-umhack26/blob/main/dashboard/scada-i-react/src/App.tsx"
click node_dashboard_page "https://github.com/deepnan-umhack/scada-i-umhack26/blob/main/dashboard/scada-i-react/src/pages/Dashboard.tsx"
click node_esg_page "https://github.com/deepnan-umhack/scada-i-umhack26/blob/main/dashboard/scada-i-react/src/pages/EsgReports.tsx"
click node_api "https://github.com/deepnan-umhack/scada-i-umhack26/blob/main/agents/api.py"
click node_supervisor "https://github.com/deepnan-umhack/scada-i-umhack26/blob/main/agents/orchestrator/supervisor.py"
click node_booking "https://github.com/deepnan-umhack/scada-i-umhack26/blob/main/agents/booking_agent/booking_agent.py"
click node_booking_tools "https://github.com/deepnan-umhack/scada-i-umhack26/tree/main/agents/booking_agent/tools"
click node_hvac "https://github.com/deepnan-umhack/scada-i-umhack26/blob/main/agents/hvac_agent/hvac_agent.py"
click node_hvac_service "https://github.com/deepnan-umhack/scada-i-umhack26/blob/main/agents/hvac_agent/core/service.py"
click node_hvac_controller "https://github.com/deepnan-umhack/scada-i-umhack26/blob/main/agents/hvac_agent/core/controller.py"
click node_hvac_schemas "https://github.com/deepnan-umhack/scada-i-umhack26/blob/main/agents/hvac_agent/core/schemas.py"
click node_esg "https://github.com/deepnan-umhack/scada-i-umhack26/blob/main/agents/esg_agent/esg_agent.py"
click node_esg_tools "https://github.com/deepnan-umhack/scada-i-umhack26/tree/main/agents/esg_agent/tools"
click node_policy_search "https://github.com/deepnan-umhack/scada-i-umhack26/blob/main/agents/esg_agent/tools/PolicyRetriever.py"
click node_sensor_ingestor "https://github.com/deepnan-umhack/scada-i-umhack26/blob/main/agents/hvac_agent/infra/sensor_ingestor.py"
click node_mqtt "https://github.com/deepnan-umhack/scada-i-umhack26/blob/main/agents/mqtt.py"
click node_postgres "https://github.com/deepnan-umhack/scada-i-umhack26/blob/main/agents/hvac_agent/infra/postgres_client.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_mobile,node_chat,node_booking_ui,node_booking_status,node_dashboard,node_dashboard_page,node_esg_page,node_user toneBlue
class node_api,node_supervisor,node_supabase toneAmber
class node_booking,node_booking_tools,node_hvac,node_hvac_service,node_hvac_controller,node_hvac_schemas,node_esg,node_esg_tools,node_policy_search toneMint
class node_sensor_ingestor,node_mqtt,node_postgres toneRose
class node_device toneIndigo
```

## Components

### User Applications

- [Mobile App](https://github.com/deepnan-umhack/scada-i-umhack26/blob/main/website/src/App.tsx): `website/src/App.tsx`
- [Chat Interface](https://github.com/deepnan-umhack/scada-i-umhack26/blob/main/website/src/pages/MainChat.tsx): `website/src/pages/MainChat.tsx`
- [Booking Views](https://github.com/deepnan-umhack/scada-i-umhack26/blob/main/website/src/pages/BrowseSpaces.tsx): `website/src/pages/BrowseSpaces.tsx`
- [Booking Status](https://github.com/deepnan-umhack/scada-i-umhack26/blob/main/website/src/pages/BookingStatus.tsx): `website/src/pages/BookingStatus.tsx`
- [Web Dashboard](https://github.com/deepnan-umhack/scada-i-umhack26/blob/main/dashboard/scada-i-react/src/App.tsx): `dashboard/scada-i-react/src/App.tsx`
- [Live Analytics](https://github.com/deepnan-umhack/scada-i-umhack26/blob/main/dashboard/scada-i-react/src/pages/Dashboard.tsx): `dashboard/scada-i-react/src/pages/Dashboard.tsx`
- [ESG Reports](https://github.com/deepnan-umhack/scada-i-umhack26/blob/main/dashboard/scada-i-react/src/pages/EsgReports.tsx): `dashboard/scada-i-react/src/pages/EsgReports.tsx`

### Agent Coordination

- [Agent API](https://github.com/deepnan-umhack/scada-i-umhack26/blob/main/agents/api.py): `agents/api.py`
- [Agent Supervisor](https://github.com/deepnan-umhack/scada-i-umhack26/blob/main/agents/orchestrator/supervisor.py): `agents/orchestrator/supervisor.py`

### Domain Agents

- [Booking Agent](https://github.com/deepnan-umhack/scada-i-umhack26/blob/main/agents/booking_agent/booking_agent.py): `agents/booking_agent/booking_agent.py`
- [Booking Operations](https://github.com/deepnan-umhack/scada-i-umhack26/tree/main/agents/booking_agent/tools): `agents/booking_agent/tools`
- [HVAC Agent](https://github.com/deepnan-umhack/scada-i-umhack26/blob/main/agents/hvac_agent/hvac_agent.py): `agents/hvac_agent/hvac_agent.py`
- [HVAC Request Service](https://github.com/deepnan-umhack/scada-i-umhack26/blob/main/agents/hvac_agent/core/service.py): `agents/hvac_agent/core/service.py`
- [HVAC Controller](https://github.com/deepnan-umhack/scada-i-umhack26/blob/main/agents/hvac_agent/core/controller.py): `agents/hvac_agent/core/controller.py`
- [HVAC Data Models](https://github.com/deepnan-umhack/scada-i-umhack26/blob/main/agents/hvac_agent/core/schemas.py): `agents/hvac_agent/core/schemas.py`
- [ESG Agent](https://github.com/deepnan-umhack/scada-i-umhack26/blob/main/agents/esg_agent/esg_agent.py): `agents/esg_agent/esg_agent.py`
- [ESG Analysis Tools](https://github.com/deepnan-umhack/scada-i-umhack26/tree/main/agents/esg_agent/tools): `agents/esg_agent/tools`
- [Policy Search](https://github.com/deepnan-umhack/scada-i-umhack26/blob/main/agents/esg_agent/tools/PolicyRetriever.py): `agents/esg_agent/tools/PolicyRetriever.py`

### Building Data

- [Sensor Ingestor](https://github.com/deepnan-umhack/scada-i-umhack26/blob/main/agents/hvac_agent/infra/sensor_ingestor.py): `agents/hvac_agent/infra/sensor_ingestor.py`
- [MQTT Broker](https://github.com/deepnan-umhack/scada-i-umhack26/blob/main/agents/mqtt.py): `agents/mqtt.py`
- [Operational Database](https://github.com/deepnan-umhack/scada-i-umhack26/blob/main/agents/hvac_agent/infra/postgres_client.py): `agents/hvac_agent/infra/postgres_client.py`

### Other components

- **Building User**
- **Building Devices**
- **Supabase**

## Connections

- Building User → Mobile App: uses (evidence: `README.md`)
- Mobile App → Chat Interface: presents chat (evidence: `website/src/App.tsx`)
- Building User → Web Dashboard: views analytics (evidence: `README.md`)
- Web Dashboard → Live Analytics: routes to (evidence: `dashboard/scada-i-react/src/App.tsx`)
- Web Dashboard → ESG Reports: routes to (evidence: `dashboard/scada-i-react/src/App.tsx`)
- Booking Views → Booking Status: opens status (evidence: `website/src/App.tsx`)
- Mobile App → Booking Views: presents views (evidence: `website/src/App.tsx`)
- Chat Interface → Agent API: submits queries
- Agent API → Agent Supervisor: enters orchestration (evidence: `README.md`)
- Agent Supervisor → Booking Agent: routes queries (evidence: `agents/orchestrator/supervisor.py`)
- Agent Supervisor → HVAC Agent: routes queries (evidence: `agents/orchestrator/supervisor.py`)
- Agent Supervisor → ESG Agent: routes queries (evidence: `agents/orchestrator/supervisor.py`)
- Booking Agent → Booking Operations: uses tools (evidence: `README.md`)
- ESG Agent → ESG Analysis Tools: uses tools (evidence: `README.md`)
- ESG Analysis Tools → Policy Search: retrieves policies (evidence: `README.md`)
- HVAC Agent → HVAC Request Service: handles requests
- HVAC Request Service → HVAC Controller: requests decision (evidence: `agents/hvac_agent/core/service.py`)
- HVAC Controller → HVAC Data Models: uses models (evidence: `agents/hvac_agent/core/controller.py`)
- HVAC Request Service → HVAC Data Models: builds requests (evidence: `agents/hvac_agent/core/service.py`)
- Building Devices → MQTT Broker: publishes telemetry (evidence: `README.md`)
- MQTT Broker → Sensor Ingestor: delivers messages (evidence: `agents/hvac_agent/infra/sensor_ingestor.py`)
- Sensor Ingestor → Operational Database: upserts state (evidence: `agents/hvac_agent/infra/sensor_ingestor.py`)
- HVAC Agent → Building Devices: sends controls (evidence: `README.md`)
- Live Analytics → Building Devices: shows IoT streams (evidence: `README.md`)
- Booking Agent → Supabase: manages records (evidence: `README.md`)
- Policy Search → Supabase: searches policies (evidence: `agents/esg_agent/tools/PolicyRetriever.py`)
- ESG Reports → ESG Agent: views reports (evidence: `README.md`)
