# shivthakar18/sentry architecture

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

- Interactive diagram: https://gitdiagram.com/shivthakar18/sentry
- Repository: https://github.com/shivthakar18/sentry
- Video tour (about a minute): https://gitdiagram.com/shivthakar18/sentry/video

## Overview

SENTRY is an early smart-home display project. Its implemented runtime is the Philips Hue adapter, which exchanges device data and commands through MQTT; the broker is configured in the repository. The README describes a future FastAPI core and React touch UI, so these appear as planned components rather than inspected implementations. The Hue excerpt shows API access, state merging, and MQTT publishing, but omits much of the adapter’s orchestration; uncertain internal links are omitted.

Main entry points: [`deploy/config/mosquitto.conf`](https://github.com/shivthakar18/sentry/blob/main/deploy/config/mosquitto.conf) (Mosquitto broker), [`adapters/hue/main.py`](https://github.com/shivthakar18/sentry/blob/main/adapters/hue/main.py) (Hue adapter), [`ui`](https://github.com/shivthakar18/sentry/tree/main/ui) (Touch UI), [`adapters/send_mqtt.py`](https://github.com/shivthakar18/sentry/blob/main/adapters/send_mqtt.py) (MQTT debug CLI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_device["Hue integration"]
  node_hue_adapter["Hue adapter<br/>[main.py]"]
  node_state_merge["State merging<br/>[main.py]"]
end

subgraph group_messaging["MQTT messaging"]
  node_mqtt_broker["Mosquitto broker<br/>[mosquitto.conf]"]
  node_device_topics["Device topics"]
  node_dev_cli["MQTT debug CLI<br/>[send_mqtt.py]"]
end

subgraph group_experience["Core and interface"]
  node_core["FastAPI core"]
  node_registry[("Device registry")]
  node_scenes_automations["Scenes and automations"]
  node_touch_ui["Touch UI"]
end

node_user(("Home user"))
node_hue_bridge["Hue Bridge"]
node_hue_lights["Hue lights"]
node_display["Touch display"]

node_hue_adapter -->|"reads and controls"| node_hue_bridge
node_hue_adapter -->|"publishes device data"| node_hue_lights
node_hue_adapter -->|"merges updates"| node_state_merge
node_hue_adapter -->|"exchanges MQTT"| node_mqtt_broker
node_mqtt_broker -->|"routes messages"| node_device_topics
node_dev_cli -->|"publishes commands"| node_mqtt_broker
node_core -.->|"subscribes and publishes"| node_mqtt_broker
node_mqtt_broker -.->|"updates device state"| node_registry
node_core -.->|"manages"| node_scenes_automations
node_touch_ui -.->|"uses HTTP/WebSocket"| node_core
node_user -.->|"interacts with"| node_touch_ui
node_touch_ui -.->|"runs on"| node_display

click node_hue_adapter "https://github.com/shivthakar18/sentry/blob/main/adapters/hue/main.py"
click node_state_merge "https://github.com/shivthakar18/sentry/blob/main/adapters/hue/main.py"
click node_mqtt_broker "https://github.com/shivthakar18/sentry/blob/main/deploy/config/mosquitto.conf"
click node_dev_cli "https://github.com/shivthakar18/sentry/blob/main/adapters/send_mqtt.py"
click node_touch_ui "https://github.com/shivthakar18/sentry/tree/main/ui"

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_hue_adapter,node_state_merge,node_user toneBlue
class node_mqtt_broker,node_device_topics,node_dev_cli toneAmber
class node_core,node_registry,node_scenes_automations,node_touch_ui toneMint
class node_hue_bridge,node_hue_lights,node_display toneIndigo
```

## Components

### Hue integration

- [Hue adapter](https://github.com/shivthakar18/sentry/blob/main/adapters/hue/main.py): `adapters/hue/main.py`
- [State merging](https://github.com/shivthakar18/sentry/blob/main/adapters/hue/main.py): `adapters/hue/main.py`

### MQTT messaging

- [Mosquitto broker](https://github.com/shivthakar18/sentry/blob/main/deploy/config/mosquitto.conf): `deploy/config/mosquitto.conf`
- **Device topics**
- [MQTT debug CLI](https://github.com/shivthakar18/sentry/blob/main/adapters/send_mqtt.py): `adapters/send_mqtt.py`

### Core and interface

- **FastAPI core**
- **Device registry**
- **Scenes and automations**
- [Touch UI](https://github.com/shivthakar18/sentry/tree/main/ui): `ui`

### Other components

- **Home user**
- **Hue Bridge**
- **Hue lights**
- **Touch display**

## Connections

- Hue adapter → Hue Bridge: reads and controls (evidence: `adapters/hue/main.py`)
- Hue adapter → Hue lights: publishes device data (evidence: `README.md`)
- Hue adapter → State merging: merges updates (evidence: `adapters/hue/main.py`)
- Hue adapter → Mosquitto broker: exchanges MQTT (evidence: `README.md`)
- Mosquitto broker → Device topics: routes messages (evidence: `README.md`)
- MQTT debug CLI → Mosquitto broker: publishes commands (evidence: `adapters/send_mqtt.py`)
- FastAPI core → Mosquitto broker: subscribes and publishes (evidence: `README.md`)
- Mosquitto broker → Device registry: updates device state (evidence: `README.md`)
- FastAPI core → Scenes and automations: manages (evidence: `README.md`)
- Touch UI → FastAPI core: uses HTTP/WebSocket (evidence: `README.md`)
- Home user → Touch UI: interacts with (evidence: `README.md`)
- Touch UI → Touch display: runs on (evidence: `README.md`)
