# tamilselvan04200803-max/steadygate architecture

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

- Interactive diagram: https://gitdiagram.com/tamilselvan04200803-max/steadygate
- Repository: https://github.com/tamilselvan04200803-max/steadygate

## Overview

SteadyGate is a vision-based accessibility system for controlling simulated smart-home appliances. The main workflow is camera input and gesture interpretation, followed by dwell and risk-aware intent checks, then API-mediated appliance updates and audit logging. Calibration, telemetry, user management, and agent findings are supporting product capabilities. Several API and vision implementations were not excerpted, so their documented or indexed relationships are shown conservatively; dashed edges indicate optional or unverified links.

Main entry points: [`src/app/page.tsx`](https://github.com/tamilselvan04200803-max/steadygate/blob/main/src/app/page.tsx) (Dashboard), [`src/db/index.ts`](https://github.com/tamilselvan04200803-max/steadygate/blob/main/src/db/index.ts) (Database connection), [`src/app/api/actuate/route.ts`](https://github.com/tamilselvan04200803-max/steadygate/blob/main/src/app/api/actuate/route.ts) (Actuation API), [`src/app/api/agents/route.ts`](https://github.com/tamilselvan04200803-max/steadygate/blob/main/src/app/api/agents/route.ts) (Agent API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["User experience"]
  node_page["Dashboard<br/>[page.tsx]"]
  node_camera["Live camera"]
  node_dwell["Dwell controller"]
  node_house["House simulator"]
  node_applianceui["Appliance controls"]
  node_enrolui["Enrolment wizard<br/>[EnrolmentModal.tsx]"]
  node_auditui["Audit and telemetry views<br/>[AuditLogView.tsx]"]
  node_benchmark["Benchmark lab<br/>[BenchmarkLab.tsx]"]
  node_patent["Disclosure view"]
end

subgraph group_vision["Gesture and safety"]
  node_vision["Hand landmark runtime<br/>[vision-runtime.ts]"]
  node_gesture["Gesture recognition"]
  node_signal["Signal processing"]
  node_gate["Intent and dwell gate<br/>[steady-gate.ts]"]
end

subgraph group_api["Product services"]
  node_actuate["Actuation API<br/>[route.ts]"]
  node_appliances["Appliance API<br/>[route.ts]"]
  node_enrol["Enrolment API<br/>[route.ts]"]
  node_personalize["Personalization API<br/>[route.ts]"]
  node_users["User API<br/>[route.ts]"]
  node_logs["Logs API<br/>[route.ts]"]
  node_telemetry["Telemetry API<br/>[route.ts]"]
  node_physics["Appliance physics<br/>[iot-physics.ts]"]
end

subgraph group_data["Persistence"]
  node_schema["Database schema<br/>[schema.ts]"]
  node_db["Database connection<br/>[index.ts]"]
  node_postgres[("PostgreSQL")]
end

subgraph group_agents["Agent operations"]
  node_agentsapi["Agent API<br/>[route.ts]"]
  node_agentbrain["Agent analysis<br/>[agent-brain.ts]"]
  node_agentruntime["Agent runtime"]
  node_roster["Agent roster<br/>[agent-roster.ts]"]
end

node_user(("Home user"))
node_admin(("Administrator"))

node_user -->|"uses"| node_page
node_admin -->|"administers"| node_page
node_page -->|"renders"| node_camera
node_page -->|"renders"| node_dwell
node_page -->|"renders"| node_house
node_page -->|"renders"| node_applianceui
node_page -->|"renders"| node_enrolui
node_page -->|"renders"| node_auditui
node_page -->|"renders"| node_benchmark
node_page -->|"renders"| node_patent
node_camera -->|"uses"| node_vision
node_camera -->|"uses"| node_gesture
node_camera -->|"uses"| node_signal
node_dwell -->|"calculates dwell"| node_gate
node_dwell -.->|"requests actuation"| node_page
node_page -->|"posts actuation"| node_actuate
node_actuate -->|"evaluates intent"| node_gate
node_actuate -->|"computes telemetry"| node_physics
node_appliances -->|"computes telemetry"| node_physics
node_actuate -->|"reads and writes"| node_db
node_appliances -->|"reads and writes"| node_db
node_enrol -->|"persists calibration"| node_db
node_personalize -->|"persists profiles"| node_db
node_users -->|"reads and writes"| node_db
node_logs -->|"reads logs"| node_db
node_telemetry -->|"reads telemetry"| node_db
node_agentsapi -->|"runs analysis"| node_agentbrain
node_agentsapi -.->|"runs agents"| node_agentruntime
node_agentbrain -->|"uses roster"| node_roster
node_agentbrain -->|"uses runtime"| node_agentruntime
node_agentsapi -->|"reads and writes findings"| node_db
node_db -->|"connects"| node_postgres
node_actuate -->|"uses tables"| node_schema
node_appliances -->|"uses tables"| node_schema
node_enrol -->|"uses tables"| node_schema
node_agentsapi -->|"uses tables"| node_schema

click node_page "https://github.com/tamilselvan04200803-max/steadygate/blob/main/src/app/page.tsx"
click node_camera "https://github.com/tamilselvan04200803-max/steadygate/blob/main/src/components/LiveCameraStream.tsx"
click node_dwell "https://github.com/tamilselvan04200803-max/steadygate/blob/main/src/components/DwellRingController.tsx"
click node_house "https://github.com/tamilselvan04200803-max/steadygate/blob/main/src/components/SmartHouseSimulator.tsx"
click node_applianceui "https://github.com/tamilselvan04200803-max/steadygate/blob/main/src/components/ApplianceCardGrid.tsx"
click node_enrolui "https://github.com/tamilselvan04200803-max/steadygate/blob/main/src/components/EnrolmentModal.tsx"
click node_auditui "https://github.com/tamilselvan04200803-max/steadygate/blob/main/src/components/AuditLogView.tsx"
click node_benchmark "https://github.com/tamilselvan04200803-max/steadygate/blob/main/src/components/BenchmarkLab.tsx"
click node_patent "https://github.com/tamilselvan04200803-max/steadygate/blob/main/src/components/PatentDisclosureView.tsx"
click node_vision "https://github.com/tamilselvan04200803-max/steadygate/blob/main/src/lib/vision-runtime.ts"
click node_gesture "https://github.com/tamilselvan04200803-max/steadygate/blob/main/src/lib/hand-gesture-engine.ts"
click node_signal "https://github.com/tamilselvan04200803-max/steadygate/blob/main/src/lib/signal-processing.ts"
click node_gate "https://github.com/tamilselvan04200803-max/steadygate/blob/main/src/lib/steady-gate.ts"
click node_actuate "https://github.com/tamilselvan04200803-max/steadygate/blob/main/src/app/api/actuate/route.ts"
click node_appliances "https://github.com/tamilselvan04200803-max/steadygate/blob/main/src/app/api/appliances/route.ts"
click node_enrol "https://github.com/tamilselvan04200803-max/steadygate/blob/main/src/app/api/enrol/route.ts"
click node_personalize "https://github.com/tamilselvan04200803-max/steadygate/blob/main/src/app/api/personalize/route.ts"
click node_users "https://github.com/tamilselvan04200803-max/steadygate/blob/main/src/app/api/users/route.ts"
click node_logs "https://github.com/tamilselvan04200803-max/steadygate/blob/main/src/app/api/logs/route.ts"
click node_telemetry "https://github.com/tamilselvan04200803-max/steadygate/blob/main/src/app/api/telemetry/route.ts"
click node_agentsapi "https://github.com/tamilselvan04200803-max/steadygate/blob/main/src/app/api/agents/route.ts"
click node_agentbrain "https://github.com/tamilselvan04200803-max/steadygate/blob/main/src/lib/agent-brain.ts"
click node_agentruntime "https://github.com/tamilselvan04200803-max/steadygate/blob/main/src/lib/agent-brain-runtime.ts"
click node_roster "https://github.com/tamilselvan04200803-max/steadygate/blob/main/src/lib/agent-roster.ts"
click node_schema "https://github.com/tamilselvan04200803-max/steadygate/blob/main/src/db/schema.ts"
click node_db "https://github.com/tamilselvan04200803-max/steadygate/blob/main/src/db/index.ts"
click node_physics "https://github.com/tamilselvan04200803-max/steadygate/blob/main/src/lib/iot-physics.ts"

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_page,node_camera,node_dwell,node_house,node_applianceui,node_enrolui,node_auditui,node_benchmark,node_patent,node_user toneBlue
class node_vision,node_gesture,node_signal,node_gate toneAmber
class node_actuate,node_appliances,node_enrol,node_personalize,node_users,node_logs,node_telemetry,node_physics toneMint
class node_schema,node_db,node_postgres toneRose
class node_agentsapi,node_agentbrain,node_agentruntime,node_roster,node_admin toneIndigo
```

## Components

### User experience

- [Dashboard](https://github.com/tamilselvan04200803-max/steadygate/blob/main/src/app/page.tsx): `src/app/page.tsx`
- [Live camera](https://github.com/tamilselvan04200803-max/steadygate/blob/main/src/components/LiveCameraStream.tsx): `src/components/LiveCameraStream.tsx`
- [Dwell controller](https://github.com/tamilselvan04200803-max/steadygate/blob/main/src/components/DwellRingController.tsx): `src/components/DwellRingController.tsx`
- [House simulator](https://github.com/tamilselvan04200803-max/steadygate/blob/main/src/components/SmartHouseSimulator.tsx): `src/components/SmartHouseSimulator.tsx`
- [Appliance controls](https://github.com/tamilselvan04200803-max/steadygate/blob/main/src/components/ApplianceCardGrid.tsx): `src/components/ApplianceCardGrid.tsx`
- [Enrolment wizard](https://github.com/tamilselvan04200803-max/steadygate/blob/main/src/components/EnrolmentModal.tsx): `src/components/EnrolmentModal.tsx`
- [Audit and telemetry views](https://github.com/tamilselvan04200803-max/steadygate/blob/main/src/components/AuditLogView.tsx): `src/components/AuditLogView.tsx`
- [Benchmark lab](https://github.com/tamilselvan04200803-max/steadygate/blob/main/src/components/BenchmarkLab.tsx): `src/components/BenchmarkLab.tsx`
- [Disclosure view](https://github.com/tamilselvan04200803-max/steadygate/blob/main/src/components/PatentDisclosureView.tsx): `src/components/PatentDisclosureView.tsx`

### Gesture and safety

- [Hand landmark runtime](https://github.com/tamilselvan04200803-max/steadygate/blob/main/src/lib/vision-runtime.ts): `src/lib/vision-runtime.ts`
- [Gesture recognition](https://github.com/tamilselvan04200803-max/steadygate/blob/main/src/lib/hand-gesture-engine.ts): `src/lib/hand-gesture-engine.ts`
- [Signal processing](https://github.com/tamilselvan04200803-max/steadygate/blob/main/src/lib/signal-processing.ts): `src/lib/signal-processing.ts`
- [Intent and dwell gate](https://github.com/tamilselvan04200803-max/steadygate/blob/main/src/lib/steady-gate.ts): `src/lib/steady-gate.ts`

### Product services

- [Actuation API](https://github.com/tamilselvan04200803-max/steadygate/blob/main/src/app/api/actuate/route.ts): `src/app/api/actuate/route.ts`
- [Appliance API](https://github.com/tamilselvan04200803-max/steadygate/blob/main/src/app/api/appliances/route.ts): `src/app/api/appliances/route.ts`
- [Enrolment API](https://github.com/tamilselvan04200803-max/steadygate/blob/main/src/app/api/enrol/route.ts): `src/app/api/enrol/route.ts`
- [Personalization API](https://github.com/tamilselvan04200803-max/steadygate/blob/main/src/app/api/personalize/route.ts): `src/app/api/personalize/route.ts`
- [User API](https://github.com/tamilselvan04200803-max/steadygate/blob/main/src/app/api/users/route.ts): `src/app/api/users/route.ts`
- [Logs API](https://github.com/tamilselvan04200803-max/steadygate/blob/main/src/app/api/logs/route.ts): `src/app/api/logs/route.ts`
- [Telemetry API](https://github.com/tamilselvan04200803-max/steadygate/blob/main/src/app/api/telemetry/route.ts): `src/app/api/telemetry/route.ts`
- [Appliance physics](https://github.com/tamilselvan04200803-max/steadygate/blob/main/src/lib/iot-physics.ts): `src/lib/iot-physics.ts`

### Persistence

- [Database schema](https://github.com/tamilselvan04200803-max/steadygate/blob/main/src/db/schema.ts): `src/db/schema.ts`
- [Database connection](https://github.com/tamilselvan04200803-max/steadygate/blob/main/src/db/index.ts): `src/db/index.ts`
- **PostgreSQL**

### Agent operations

- [Agent API](https://github.com/tamilselvan04200803-max/steadygate/blob/main/src/app/api/agents/route.ts): `src/app/api/agents/route.ts`
- [Agent analysis](https://github.com/tamilselvan04200803-max/steadygate/blob/main/src/lib/agent-brain.ts): `src/lib/agent-brain.ts`
- [Agent runtime](https://github.com/tamilselvan04200803-max/steadygate/blob/main/src/lib/agent-brain-runtime.ts): `src/lib/agent-brain-runtime.ts`
- [Agent roster](https://github.com/tamilselvan04200803-max/steadygate/blob/main/src/lib/agent-roster.ts): `src/lib/agent-roster.ts`

### Other components

- **Home user**
- **Administrator**

## Connections

- Home user → Dashboard: uses (evidence: `README.md`)
- Administrator → Dashboard: administers (evidence: `src/app/page.tsx`)
- Dashboard → Live camera: renders (evidence: `src/app/page.tsx`)
- Dashboard → Dwell controller: renders (evidence: `src/app/page.tsx`)
- Dashboard → House simulator: renders (evidence: `src/app/page.tsx`)
- Dashboard → Appliance controls: renders (evidence: `src/app/page.tsx`)
- Dashboard → Enrolment wizard: renders (evidence: `src/app/page.tsx`)
- Dashboard → Audit and telemetry views: renders (evidence: `src/app/page.tsx`)
- Dashboard → Benchmark lab: renders (evidence: `src/app/page.tsx`)
- Dashboard → Disclosure view: renders (evidence: `src/app/page.tsx`)
- Live camera → Hand landmark runtime: uses (evidence: `src/components/LiveCameraStream.tsx`)
- Live camera → Gesture recognition: uses (evidence: `src/components/LiveCameraStream.tsx`)
- Live camera → Signal processing: uses (evidence: `src/components/LiveCameraStream.tsx`)
- Dwell controller → Intent and dwell gate: calculates dwell (evidence: `src/components/DwellRingController.tsx`)
- Dwell controller → Dashboard: requests actuation (evidence: `src/app/page.tsx`)
- Dashboard → Actuation API: posts actuation (evidence: `src/app/page.tsx`)
- Actuation API → Intent and dwell gate: evaluates intent (evidence: `src/app/api/actuate/route.ts`)
- Actuation API → Appliance physics: computes telemetry (evidence: `src/app/api/actuate/route.ts`)
- Appliance API → Appliance physics: computes telemetry (evidence: `src/app/api/appliances/route.ts`)
- Actuation API → Database connection: reads and writes (evidence: `src/app/api/actuate/route.ts`)
- Appliance API → Database connection: reads and writes (evidence: `src/app/api/appliances/route.ts`)
- Enrolment API → Database connection: persists calibration (evidence: `src/app/api/enrol/route.ts`)
- Personalization API → Database connection: persists profiles (evidence: `src/app/api/personalize/route.ts`)
- User API → Database connection: reads and writes (evidence: `src/app/api/users/route.ts`)
- Logs API → Database connection: reads logs (evidence: `src/app/api/logs/route.ts`)
- Telemetry API → Database connection: reads telemetry (evidence: `src/app/api/telemetry/route.ts`)
- Agent API → Agent analysis: runs analysis (evidence: `src/app/api/agents/route.ts`)
- Agent API → Agent runtime: runs agents
- Agent analysis → Agent roster: uses roster (evidence: `src/lib/agent-brain.ts`)
- Agent analysis → Agent runtime: uses runtime (evidence: `src/lib/agent-brain.ts`)
- Agent API → Database connection: reads and writes findings (evidence: `src/app/api/agents/route.ts`)
- Database connection → PostgreSQL: connects (evidence: `src/db/index.ts`)
- Actuation API → Database schema: uses tables (evidence: `src/app/api/actuate/route.ts`)
- Appliance API → Database schema: uses tables (evidence: `src/app/api/appliances/route.ts`)
- Enrolment API → Database schema: uses tables (evidence: `src/app/api/enrol/route.ts`)
- Agent API → Database schema: uses tables (evidence: `src/app/api/agents/route.ts`)
