# ratanakvicheasok26-creator/inbound_surveillance architecture

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

- Interactive diagram: https://gitdiagram.com/ratanakvicheasok26-creator/inbound_surveillance
- Repository: https://github.com/ratanakvicheasok26-creator/inbound_surveillance

## Overview

This repository appears to implement Inbound Surveillance: a local vision engine and a desktop/web console for configuring cameras and monitoring garage or massage-business activity. The user workflow runs from account and camera setup through pipeline configuration, edge detection and visit analysis, then into live views, alerts, cases, complaints, and reporting. The graph also preserves Telegram operations and workplace analytics. No README was provided, and several engine modules were not sampled; uncertain engine-to-subsystem links are omitted rather than inferred.

Main entry points: [`src/dashboard/components/PipelineView.tsx`](https://github.com/ratanakvicheasok26-creator/inbound_surveillance/blob/main/src/dashboard/components/PipelineView.tsx) (Pipeline editor), [`src/dashboard/App.tsx`](https://github.com/ratanakvicheasok26-creator/inbound_surveillance/blob/main/src/dashboard/App.tsx) (Operations console), [`edge/main.py`](https://github.com/ratanakvicheasok26-creator/inbound_surveillance/blob/main/edge/main.py) (Edge engine), [`src/dashboard/account.ts`](https://github.com/ratanakvicheasok26-creator/inbound_surveillance/blob/main/src/dashboard/account.ts) (Account and setup)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_console["Console and accounts"]
  node_dashboard["Operations console<br/>[App.tsx]"]
  node_account["Account and setup<br/>[account.ts]"]
  node_auth["Authentication<br/>[auth.tsx]"]
  node_opsstore["Console state<br/>[store.tsx]"]
end

subgraph group_pipeline["Pipeline configuration"]
  node_pipelineview["Pipeline editor<br/>[PipelineView.tsx]"]
  node_pipelineir["Pipeline model<br/>[ir.ts]"]
  node_catalog["Node catalog<br/>[catalog.ts]"]
  node_templates["Pipeline templates<br/>[templates.ts]"]
  node_validation["Pipeline validation<br/>[validate.ts]"]
  node_engineapi["Engine API client<br/>[engineApi.ts]"]
end

subgraph group_engine["Edge vision engine"]
  node_engine["Edge engine<br/>[main.py]"]
  node_launcher["Engine launcher<br/>[launcher.py]"]
  node_cameras["Camera adapters<br/>[base.py]"]
  node_vision["Detection and occupancy<br/>[occupancy.py]"]
  node_tracking["Person and vehicle tracking<br/>[person.py]"]
end

subgraph group_operations["Workplace operations"]
  node_edgeanalytics["Visit sessions<br/>[sessions.py]"]
  node_workplace["Workplace monitoring<br/>[customer_visits.py]"]
  node_registry["Visitor registry"]
  node_storage[("Edge database<br/>[db.py]")]
  node_analytics["Customer analytics"]
  node_telegramcontrol["Telegram commands"]
end

subgraph group_integrations["External services"]
  node_telegramout["Telegram notifications<br/>[telegram_out.py]"]
  node_supabase[("Supabase<br/>[supabase.ts]")]
  node_telegram["Telegram service"]
end

node_operator(("Venue operator"))

node_operator -->|"uses"| node_dashboard
node_dashboard -->|"loads account"| node_account
node_dashboard -->|"hydrates state"| node_opsstore
node_dashboard -->|"opens editor"| node_pipelineview
node_auth -->|"uses account"| node_account
node_account -->|"reads and writes"| node_supabase
node_account -->|"creates defaults"| node_templates
node_pipelineview -->|"loads template"| node_templates
node_pipelineview -->|"submits graph"| node_engineapi
node_pipelineview -->|"edits graph"| node_pipelineir
node_pipelineview -->|"renders node types"| node_catalog
node_pipelineview -->|"validates graph"| node_validation
node_pipelineir -->|"defines node ports"| node_catalog
node_templates -->|"builds graphs"| node_pipelineir
node_engineapi -.->|"sends API requests"| node_engine
node_engine -->|"delegates runtime"| node_launcher
node_engine -->|"uses occupancy"| node_vision
node_vision -->|"uses tracking"| node_tracking
node_engine -.->|"uses camera adapters"| node_cameras
node_workplace -->|"uses occupancy"| node_vision
node_edgeanalytics -->|"looks up visitors"| node_registry
node_edgeanalytics -->|"sends alerts"| node_telegramout
node_edgeanalytics -->|"writes sessions"| node_storage
node_analytics -->|"sends reports"| node_telegramout
node_telegramcontrol -->|"dispatches reports"| node_analytics
node_telegramcontrol -->|"sends replies"| node_telegramout
node_telegramout -->|"sends messages"| node_telegram
node_telegramcontrol -.->|"polls commands"| node_telegram

click node_dashboard "https://github.com/ratanakvicheasok26-creator/inbound_surveillance/blob/main/src/dashboard/App.tsx"
click node_account "https://github.com/ratanakvicheasok26-creator/inbound_surveillance/blob/main/src/dashboard/account.ts"
click node_auth "https://github.com/ratanakvicheasok26-creator/inbound_surveillance/blob/main/src/dashboard/auth.tsx"
click node_opsstore "https://github.com/ratanakvicheasok26-creator/inbound_surveillance/blob/main/src/dashboard/store.tsx"
click node_pipelineview "https://github.com/ratanakvicheasok26-creator/inbound_surveillance/blob/main/src/dashboard/components/PipelineView.tsx"
click node_pipelineir "https://github.com/ratanakvicheasok26-creator/inbound_surveillance/blob/main/src/pipeline/ir.ts"
click node_catalog "https://github.com/ratanakvicheasok26-creator/inbound_surveillance/blob/main/src/pipeline/catalog.ts"
click node_templates "https://github.com/ratanakvicheasok26-creator/inbound_surveillance/blob/main/src/pipeline/templates.ts"
click node_validation "https://github.com/ratanakvicheasok26-creator/inbound_surveillance/blob/main/src/pipeline/validate.ts"
click node_engineapi "https://github.com/ratanakvicheasok26-creator/inbound_surveillance/blob/main/src/lib/engineApi.ts"
click node_engine "https://github.com/ratanakvicheasok26-creator/inbound_surveillance/blob/main/edge/main.py"
click node_launcher "https://github.com/ratanakvicheasok26-creator/inbound_surveillance/blob/main/edge/launcher.py"
click node_cameras "https://github.com/ratanakvicheasok26-creator/inbound_surveillance/blob/main/edge/adapters/base.py"
click node_vision "https://github.com/ratanakvicheasok26-creator/inbound_surveillance/blob/main/edge/occupancy.py"
click node_tracking "https://github.com/ratanakvicheasok26-creator/inbound_surveillance/blob/main/edge/person.py"
click node_edgeanalytics "https://github.com/ratanakvicheasok26-creator/inbound_surveillance/blob/main/edge/analytics/sessions.py"
click node_workplace "https://github.com/ratanakvicheasok26-creator/inbound_surveillance/blob/main/edge/workplaces/customer_visits.py"
click node_registry "https://github.com/ratanakvicheasok26-creator/inbound_surveillance/blob/main/edge/visitor_registry.py"
click node_storage "https://github.com/ratanakvicheasok26-creator/inbound_surveillance/blob/main/edge/db.py"
click node_analytics "https://github.com/ratanakvicheasok26-creator/inbound_surveillance/blob/main/edge/analytics/weekly_customer_brief.py"
click node_telegramcontrol "https://github.com/ratanakvicheasok26-creator/inbound_surveillance/blob/main/edge/telegram_controller.py"
click node_telegramout "https://github.com/ratanakvicheasok26-creator/inbound_surveillance/blob/main/edge/telegram_out.py"
click node_supabase "https://github.com/ratanakvicheasok26-creator/inbound_surveillance/blob/main/src/lib/supabase.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_dashboard,node_account,node_auth,node_opsstore toneBlue
class node_pipelineview,node_pipelineir,node_catalog,node_templates,node_validation,node_engineapi toneAmber
class node_engine,node_launcher,node_cameras,node_vision,node_tracking toneMint
class node_edgeanalytics,node_workplace,node_registry,node_storage,node_analytics,node_telegramcontrol toneRose
class node_telegramout,node_supabase,node_telegram,node_operator toneIndigo
```

## Components

### Console and accounts

- [Operations console](https://github.com/ratanakvicheasok26-creator/inbound_surveillance/blob/main/src/dashboard/App.tsx): `src/dashboard/App.tsx`
- [Account and setup](https://github.com/ratanakvicheasok26-creator/inbound_surveillance/blob/main/src/dashboard/account.ts): `src/dashboard/account.ts`
- [Authentication](https://github.com/ratanakvicheasok26-creator/inbound_surveillance/blob/main/src/dashboard/auth.tsx): `src/dashboard/auth.tsx`
- [Console state](https://github.com/ratanakvicheasok26-creator/inbound_surveillance/blob/main/src/dashboard/store.tsx): `src/dashboard/store.tsx`

### Pipeline configuration

- [Pipeline editor](https://github.com/ratanakvicheasok26-creator/inbound_surveillance/blob/main/src/dashboard/components/PipelineView.tsx): `src/dashboard/components/PipelineView.tsx`
- [Pipeline model](https://github.com/ratanakvicheasok26-creator/inbound_surveillance/blob/main/src/pipeline/ir.ts): `src/pipeline/ir.ts`
- [Node catalog](https://github.com/ratanakvicheasok26-creator/inbound_surveillance/blob/main/src/pipeline/catalog.ts): `src/pipeline/catalog.ts`
- [Pipeline templates](https://github.com/ratanakvicheasok26-creator/inbound_surveillance/blob/main/src/pipeline/templates.ts): `src/pipeline/templates.ts`
- [Pipeline validation](https://github.com/ratanakvicheasok26-creator/inbound_surveillance/blob/main/src/pipeline/validate.ts): `src/pipeline/validate.ts`
- [Engine API client](https://github.com/ratanakvicheasok26-creator/inbound_surveillance/blob/main/src/lib/engineApi.ts): `src/lib/engineApi.ts`

### Edge vision engine

- [Edge engine](https://github.com/ratanakvicheasok26-creator/inbound_surveillance/blob/main/edge/main.py): `edge/main.py`
- [Engine launcher](https://github.com/ratanakvicheasok26-creator/inbound_surveillance/blob/main/edge/launcher.py): `edge/launcher.py`
- [Camera adapters](https://github.com/ratanakvicheasok26-creator/inbound_surveillance/blob/main/edge/adapters/base.py): `edge/adapters/base.py`
- [Detection and occupancy](https://github.com/ratanakvicheasok26-creator/inbound_surveillance/blob/main/edge/occupancy.py): `edge/occupancy.py`
- [Person and vehicle tracking](https://github.com/ratanakvicheasok26-creator/inbound_surveillance/blob/main/edge/person.py): `edge/person.py`

### Workplace operations

- [Visit sessions](https://github.com/ratanakvicheasok26-creator/inbound_surveillance/blob/main/edge/analytics/sessions.py): `edge/analytics/sessions.py`
- [Workplace monitoring](https://github.com/ratanakvicheasok26-creator/inbound_surveillance/blob/main/edge/workplaces/customer_visits.py): `edge/workplaces/customer_visits.py`
- [Visitor registry](https://github.com/ratanakvicheasok26-creator/inbound_surveillance/blob/main/edge/visitor_registry.py): `edge/visitor_registry.py`
- [Edge database](https://github.com/ratanakvicheasok26-creator/inbound_surveillance/blob/main/edge/db.py): `edge/db.py`
- [Customer analytics](https://github.com/ratanakvicheasok26-creator/inbound_surveillance/blob/main/edge/analytics/weekly_customer_brief.py): `edge/analytics/weekly_customer_brief.py`
- [Telegram commands](https://github.com/ratanakvicheasok26-creator/inbound_surveillance/blob/main/edge/telegram_controller.py): `edge/telegram_controller.py`

### External services

- [Telegram notifications](https://github.com/ratanakvicheasok26-creator/inbound_surveillance/blob/main/edge/telegram_out.py): `edge/telegram_out.py`
- [Supabase](https://github.com/ratanakvicheasok26-creator/inbound_surveillance/blob/main/src/lib/supabase.ts): `src/lib/supabase.ts`
- **Telegram service**

### Other components

- **Venue operator**

## Connections

- Venue operator → Operations console: uses (evidence: `src/dashboard/App.tsx`)
- Operations console → Account and setup: loads account (evidence: `src/dashboard/App.tsx`)
- Operations console → Console state: hydrates state (evidence: `src/dashboard/App.tsx`)
- Operations console → Pipeline editor: opens editor (evidence: `src/dashboard/App.tsx`)
- Authentication → Account and setup: uses account (evidence: `src/dashboard/auth.tsx`)
- Account and setup → Supabase: reads and writes (evidence: `src/dashboard/account.ts`)
- Account and setup → Pipeline templates: creates defaults (evidence: `src/dashboard/account.ts`)
- Pipeline editor → Pipeline templates: loads template (evidence: `src/dashboard/components/PipelineView.tsx`)
- Pipeline editor → Engine API client: submits graph (evidence: `src/dashboard/components/PipelineView.tsx`)
- Pipeline editor → Pipeline model: edits graph (evidence: `src/dashboard/components/PipelineView.tsx`)
- Pipeline editor → Node catalog: renders node types (evidence: `src/dashboard/components/PipelineView.tsx`)
- Pipeline editor → Pipeline validation: validates graph (evidence: `src/dashboard/components/PipelineView.tsx`)
- Pipeline model → Node catalog: defines node ports (evidence: `src/pipeline/catalog.ts`)
- Pipeline templates → Pipeline model: builds graphs (evidence: `src/pipeline/templates.ts`)
- Engine API client → Edge engine: sends API requests
- Edge engine → Engine launcher: delegates runtime (evidence: `edge/main.py`)
- Edge engine → Detection and occupancy: uses occupancy (evidence: `edge/main.py`)
- Detection and occupancy → Person and vehicle tracking: uses tracking (evidence: `edge/occupancy.py`)
- Edge engine → Camera adapters: uses camera adapters
- Workplace monitoring → Detection and occupancy: uses occupancy (evidence: `edge/workplaces/customer_visits.py`)
- Visit sessions → Visitor registry: looks up visitors (evidence: `edge/analytics/sessions.py`)
- Visit sessions → Telegram notifications: sends alerts (evidence: `edge/analytics/sessions.py`)
- Visit sessions → Edge database: writes sessions (evidence: `edge/analytics/sessions.py`)
- Customer analytics → Telegram notifications: sends reports (evidence: `edge/analytics/weekly_customer_brief.py`)
- Telegram commands → Customer analytics: dispatches reports (evidence: `edge/telegram_controller.py`)
- Telegram commands → Telegram notifications: sends replies (evidence: `edge/telegram_controller.py`)
- Telegram notifications → Telegram service: sends messages (evidence: `edge/telegram_out.py`)
- Telegram commands → Telegram service: polls commands
