# petarcovic/sentinelmesh architecture

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

- Interactive diagram: https://gitdiagram.com/petarcovic/sentinelmesh
- Repository: https://github.com/petarcovic/sentinelmesh

## Overview

SentinelMesh is a distributed smart-home security platform: camera edge nodes capture and analyze video, report device status and security events, and upload media; the backend manages devices, events, alerts, and camera media; the dashboard supports operations and review. The graph preserves these documented product stages and the alert-rule and live-update capabilities. Source excerpts are partial, so unverified implementation links—especially within the edge runtime—are omitted rather than inferred.

Main entry points: [`backend/src/main/java/com/sentinelmesh/SentinelMeshApplication.java`](https://github.com/petarcovic/sentinelmesh/blob/main/backend/src/main/java/com/sentinelmesh/SentinelMeshApplication.java) (REST API), [`cv_edge_node/src/main/java/com/sentinelmesh/edge/client/SentinelMeshApiClient.java`](https://github.com/petarcovic/sentinelmesh/blob/main/cv_edge_node/src/main/java/com/sentinelmesh/edge/client/SentinelMeshApiClient.java) (API clients), [`backend/src/main/java/com/sentinelmesh/cameras/CameraService.java`](https://github.com/petarcovic/sentinelmesh/blob/main/backend/src/main/java/com/sentinelmesh/cameras/CameraService.java) (Camera overview), [`cv_edge_node/src/main/java/com/sentinelmesh/edge/CvEdgeNodeApplication.java`](https://github.com/petarcovic/sentinelmesh/blob/main/cv_edge_node/src/main/java/com/sentinelmesh/edge/CvEdgeNodeApplication.java) (Edge runtime)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_edge["Camera edge node"]
  node_edgeapp["Edge runtime"]
  node_capture["Frame capture<br/>[FrameSource.java]"]
  node_detection["Detection pipeline"]
  node_edgeclients["API clients"]
  node_spool["Recording spool"]
end

subgraph group_api["Backend services"]
  node_backend["REST API"]
  node_devices["Device management<br/>[DeviceService.java]"]
  node_deviceauth["Device authentication"]
  node_events["Security events"]
  node_alerts["Alert management<br/>[AlertService.java]"]
  node_rules["Alert rules"]
  node_cameras["Camera overview<br/>[CameraService.java]"]
end

subgraph group_media["Camera media"]
  node_live["Live frames"]
  node_recordings["Recording segments"]
  node_snapshots["Snapshots"]
  node_clips["Event clips"]
end

subgraph group_ops["Operations dashboard"]
  node_dashboard["Dashboard<br/>[App.tsx]"]
  node_websocket["Dashboard updates"]
end

subgraph group_infra["Platform services"]
  node_postgres[("PostgreSQL")]
  node_redis["Redis queue"]
end

node_operator(("Operator"))
node_browser(("Dashboard user"))

node_operator -->|"runs"| node_edgeapp
node_edgeapp -.->|"captures frames"| node_capture
node_capture -->|"analyzes frames"| node_detection
node_edgeapp -.->|"reports events"| node_edgeclients
node_edgeapp -.->|"records locally"| node_spool
node_edgeclients -->|"sends device data"| node_backend
node_edgeclients -->|"uploads frames"| node_live
node_edgeclients -->|"uploads segments"| node_recordings
node_edgeclients -->|"uploads snapshots"| node_snapshots
node_edgeclients -->|"uploads clips"| node_clips
node_backend -->|"authenticates devices"| node_deviceauth
node_deviceauth -->|"loads device"| node_devices
node_backend -->|"manages devices"| node_devices
node_backend -->|"processes events"| node_events
node_events -->|"creates alerts"| node_alerts
node_backend -->|"evaluates rules"| node_rules
node_backend -->|"serves camera views"| node_cameras
node_cameras -->|"reads live state"| node_live
node_cameras -->|"reads recording data"| node_recordings
node_cameras -->|"reads snapshots"| node_snapshots
node_cameras -->|"reads clips"| node_clips
node_alerts -->|"broadcasts updates"| node_websocket
node_browser -->|"views operations"| node_dashboard
node_dashboard -->|"polls API"| node_backend
node_websocket -->|"pushes updates"| node_dashboard
node_devices -.->|"persists device data"| node_postgres
node_events -.->|"persists events"| node_postgres
node_alerts -.->|"persists alerts"| node_postgres
node_backend -.->|"queues processing"| node_redis

click node_edgeapp "https://github.com/petarcovic/sentinelmesh/blob/main/cv_edge_node/src/main/java/com/sentinelmesh/edge/CvEdgeNodeApplication.java"
click node_capture "https://github.com/petarcovic/sentinelmesh/blob/main/cv_edge_node/src/main/java/com/sentinelmesh/edge/camera/FrameSource.java"
click node_detection "https://github.com/petarcovic/sentinelmesh/blob/main/cv_edge_node/src/main/java/com/sentinelmesh/edge/detection/DetectionPipeline.java"
click node_edgeclients "https://github.com/petarcovic/sentinelmesh/blob/main/cv_edge_node/src/main/java/com/sentinelmesh/edge/client/SentinelMeshApiClient.java"
click node_spool "https://github.com/petarcovic/sentinelmesh/blob/main/cv_edge_node/src/main/java/com/sentinelmesh/edge/recording/RecordingSpoolService.java"
click node_backend "https://github.com/petarcovic/sentinelmesh/blob/main/backend/src/main/java/com/sentinelmesh/SentinelMeshApplication.java"
click node_devices "https://github.com/petarcovic/sentinelmesh/blob/main/backend/src/main/java/com/sentinelmesh/devices/DeviceService.java"
click node_deviceauth "https://github.com/petarcovic/sentinelmesh/blob/main/backend/src/main/java/com/sentinelmesh/devices/DeviceAuthenticationService.java"
click node_events "https://github.com/petarcovic/sentinelmesh/blob/main/backend/src/main/java/com/sentinelmesh/events/SecurityEventService.java"
click node_alerts "https://github.com/petarcovic/sentinelmesh/blob/main/backend/src/main/java/com/sentinelmesh/alerts/AlertService.java"
click node_rules "https://github.com/petarcovic/sentinelmesh/blob/main/backend/src/main/java/com/sentinelmesh/rules/RuleEvaluationService.java"
click node_cameras "https://github.com/petarcovic/sentinelmesh/blob/main/backend/src/main/java/com/sentinelmesh/cameras/CameraService.java"
click node_live "https://github.com/petarcovic/sentinelmesh/blob/main/backend/src/main/java/com/sentinelmesh/live/LiveFrameService.java"
click node_recordings "https://github.com/petarcovic/sentinelmesh/blob/main/backend/src/main/java/com/sentinelmesh/recordings/RecordingSegmentService.java"
click node_snapshots "https://github.com/petarcovic/sentinelmesh/blob/main/backend/src/main/java/com/sentinelmesh/snapshots/SnapshotService.java"
click node_clips "https://github.com/petarcovic/sentinelmesh/blob/main/backend/src/main/java/com/sentinelmesh/clips/VideoClipService.java"
click node_dashboard "https://github.com/petarcovic/sentinelmesh/blob/main/frontend/src/App.tsx"
click node_websocket "https://github.com/petarcovic/sentinelmesh/blob/main/backend/src/main/java/com/sentinelmesh/realtime/DashboardWebSocketHandler.java"
click node_redis "https://github.com/petarcovic/sentinelmesh/blob/main/backend/src/main/java/com/sentinelmesh/async/RedisEventProcessingQueue.java"

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_edgeapp,node_capture,node_detection,node_edgeclients,node_spool,node_browser toneBlue
class node_backend,node_devices,node_deviceauth,node_events,node_alerts,node_rules,node_cameras toneAmber
class node_live,node_recordings,node_snapshots,node_clips toneMint
class node_dashboard,node_websocket toneRose
class node_postgres,node_redis,node_operator toneIndigo
```

## Components

### Camera edge node

- [Edge runtime](https://github.com/petarcovic/sentinelmesh/blob/main/cv_edge_node/src/main/java/com/sentinelmesh/edge/CvEdgeNodeApplication.java): `cv_edge_node/src/main/java/com/sentinelmesh/edge/CvEdgeNodeApplication.java`
- [Frame capture](https://github.com/petarcovic/sentinelmesh/blob/main/cv_edge_node/src/main/java/com/sentinelmesh/edge/camera/FrameSource.java): `cv_edge_node/src/main/java/com/sentinelmesh/edge/camera/FrameSource.java`
- [Detection pipeline](https://github.com/petarcovic/sentinelmesh/blob/main/cv_edge_node/src/main/java/com/sentinelmesh/edge/detection/DetectionPipeline.java): `cv_edge_node/src/main/java/com/sentinelmesh/edge/detection/DetectionPipeline.java`
- [API clients](https://github.com/petarcovic/sentinelmesh/blob/main/cv_edge_node/src/main/java/com/sentinelmesh/edge/client/SentinelMeshApiClient.java): `cv_edge_node/src/main/java/com/sentinelmesh/edge/client/SentinelMeshApiClient.java`
- [Recording spool](https://github.com/petarcovic/sentinelmesh/blob/main/cv_edge_node/src/main/java/com/sentinelmesh/edge/recording/RecordingSpoolService.java): `cv_edge_node/src/main/java/com/sentinelmesh/edge/recording/RecordingSpoolService.java`

### Backend services

- [REST API](https://github.com/petarcovic/sentinelmesh/blob/main/backend/src/main/java/com/sentinelmesh/SentinelMeshApplication.java): `backend/src/main/java/com/sentinelmesh/SentinelMeshApplication.java`
- [Device management](https://github.com/petarcovic/sentinelmesh/blob/main/backend/src/main/java/com/sentinelmesh/devices/DeviceService.java): `backend/src/main/java/com/sentinelmesh/devices/DeviceService.java`
- [Device authentication](https://github.com/petarcovic/sentinelmesh/blob/main/backend/src/main/java/com/sentinelmesh/devices/DeviceAuthenticationService.java): `backend/src/main/java/com/sentinelmesh/devices/DeviceAuthenticationService.java`
- [Security events](https://github.com/petarcovic/sentinelmesh/blob/main/backend/src/main/java/com/sentinelmesh/events/SecurityEventService.java): `backend/src/main/java/com/sentinelmesh/events/SecurityEventService.java`
- [Alert management](https://github.com/petarcovic/sentinelmesh/blob/main/backend/src/main/java/com/sentinelmesh/alerts/AlertService.java): `backend/src/main/java/com/sentinelmesh/alerts/AlertService.java`
- [Alert rules](https://github.com/petarcovic/sentinelmesh/blob/main/backend/src/main/java/com/sentinelmesh/rules/RuleEvaluationService.java): `backend/src/main/java/com/sentinelmesh/rules/RuleEvaluationService.java`
- [Camera overview](https://github.com/petarcovic/sentinelmesh/blob/main/backend/src/main/java/com/sentinelmesh/cameras/CameraService.java): `backend/src/main/java/com/sentinelmesh/cameras/CameraService.java`

### Camera media

- [Live frames](https://github.com/petarcovic/sentinelmesh/blob/main/backend/src/main/java/com/sentinelmesh/live/LiveFrameService.java): `backend/src/main/java/com/sentinelmesh/live/LiveFrameService.java`
- [Recording segments](https://github.com/petarcovic/sentinelmesh/blob/main/backend/src/main/java/com/sentinelmesh/recordings/RecordingSegmentService.java): `backend/src/main/java/com/sentinelmesh/recordings/RecordingSegmentService.java`
- [Snapshots](https://github.com/petarcovic/sentinelmesh/blob/main/backend/src/main/java/com/sentinelmesh/snapshots/SnapshotService.java): `backend/src/main/java/com/sentinelmesh/snapshots/SnapshotService.java`
- [Event clips](https://github.com/petarcovic/sentinelmesh/blob/main/backend/src/main/java/com/sentinelmesh/clips/VideoClipService.java): `backend/src/main/java/com/sentinelmesh/clips/VideoClipService.java`

### Operations dashboard

- [Dashboard](https://github.com/petarcovic/sentinelmesh/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Dashboard updates](https://github.com/petarcovic/sentinelmesh/blob/main/backend/src/main/java/com/sentinelmesh/realtime/DashboardWebSocketHandler.java): `backend/src/main/java/com/sentinelmesh/realtime/DashboardWebSocketHandler.java`

### Platform services

- **PostgreSQL**
- [Redis queue](https://github.com/petarcovic/sentinelmesh/blob/main/backend/src/main/java/com/sentinelmesh/async/RedisEventProcessingQueue.java): `backend/src/main/java/com/sentinelmesh/async/RedisEventProcessingQueue.java`

### Other components

- **Operator**
- **Dashboard user**

## Connections

- Operator → Edge runtime: runs (evidence: `README.md`)
- Edge runtime → Frame capture: captures frames
- Frame capture → Detection pipeline: analyzes frames (evidence: `cv_edge_node/src/main/java/com/sentinelmesh/edge/detection/DetectionPipeline.java`)
- Edge runtime → API clients: reports events
- Edge runtime → Recording spool: records locally
- API clients → REST API: sends device data (evidence: `README.md`)
- API clients → Live frames: uploads frames (evidence: `README.md`)
- API clients → Recording segments: uploads segments (evidence: `README.md`)
- API clients → Snapshots: uploads snapshots (evidence: `README.md`)
- API clients → Event clips: uploads clips (evidence: `README.md`)
- REST API → Device authentication: authenticates devices (evidence: `backend/src/main/java/com/sentinelmesh/devices/DeviceAuthenticationService.java`)
- Device authentication → Device management: loads device (evidence: `backend/src/main/java/com/sentinelmesh/devices/DeviceAuthenticationService.java`)
- REST API → Device management: manages devices (evidence: `README.md`)
- REST API → Security events: processes events (evidence: `README.md`)
- Security events → Alert management: creates alerts (evidence: `backend/src/main/java/com/sentinelmesh/alerts/AlertService.java`)
- REST API → Alert rules: evaluates rules (evidence: `README.md`)
- REST API → Camera overview: serves camera views (evidence: `backend/src/main/java/com/sentinelmesh/cameras/CameraService.java`)
- Camera overview → Live frames: reads live state (evidence: `backend/src/main/java/com/sentinelmesh/cameras/CameraService.java`)
- Camera overview → Recording segments: reads recording data (evidence: `backend/src/main/java/com/sentinelmesh/cameras/CameraService.java`)
- Camera overview → Snapshots: reads snapshots (evidence: `backend/src/main/java/com/sentinelmesh/cameras/CameraService.java`)
- Camera overview → Event clips: reads clips (evidence: `backend/src/main/java/com/sentinelmesh/cameras/CameraService.java`)
- Alert management → Dashboard updates: broadcasts updates (evidence: `backend/src/main/java/com/sentinelmesh/alerts/AlertService.java`)
- Dashboard user → Dashboard: views operations (evidence: `README.md`)
- Dashboard → REST API: polls API (evidence: `README.md`)
- Dashboard updates → Dashboard: pushes updates (evidence: `README.md`)
- Device management → PostgreSQL: persists device data
- Security events → PostgreSQL: persists events
- Alert management → PostgreSQL: persists alerts
- REST API → Redis queue: queues processing
