# advaetuc/vertebrate architecture

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

- Interactive diagram: https://gitdiagram.com/advaetuc/vertebrate
- Repository: https://github.com/advaetuc/vertebrate

## Overview

Vertebrate is a local PySide6 webcam application that detects and confirms falls from pose geometry, then presents live status and manages alarms, history, location, and optional Discord alerts. The main workflow runs from app.py through MainWindow to a camera worker; the worker performs CPU pose inference and per-person tracking, then signals annotated frames and alert state back to the GUI. The README documents the broader UI and integrations. Some UI wiring is visible only in partial MainWindow excerpts, so edges that depend on unsampled details are omitted.

Main entry points: [`app_modules/mainwindow.py`](https://github.com/advaetuc/vertebrate/blob/main/app_modules/mainwindow.py) (Main window), [`app_modules/camerathread.py`](https://github.com/advaetuc/vertebrate/blob/main/app_modules/camerathread.py) (Camera worker), [`app_modules/falllog.py`](https://github.com/advaetuc/vertebrate/blob/main/app_modules/falllog.py) (Fall event log), [`app.py`](https://github.com/advaetuc/vertebrate/blob/main/app.py) (Application entry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Application"]
  node_app["Application entry<br/>[app.py]"]
  node_shared["Shared runtime helpers<br/>[common.py]"]
end

subgraph group_monitoring["Fall monitoring"]
  node_camera["Camera worker<br/>[camerathread.py]"]
  node_pose["Pose inference<br/>[camerathread.py]"]
  node_tracker["Person tracking<br/>[tracking.py]"]
end

subgraph group_interface["Live interface"]
  node_window["Main window<br/>[mainwindow.py]"]
  node_video["Video view<br/>[videoview.py]"]
  node_meter["Evidence meter<br/>[evidencemeter.py]"]
  node_stat["Status tiles<br/>[stattile.py]"]
  node_logo["Logo mark<br/>[logomark.py]"]
end

subgraph group_response["Alerts and history"]
  node_fall_log["Fall event log<br/>[falllog.py]"]
  node_log_store[("Per-device CSV<br/>[falllog.py]")]
  node_log_dialog["Fall log dialog<br/>[falllogdialog.py]"]
  node_alarm["Local alarm<br/>[alarmsound.py]"]
  node_caregiver["Discord alerts<br/>[caregivers.py]"]
end

subgraph group_context["Location context"]
  node_location["Location feed<br/>[locationfeed.py]"]
end

node_user(("Operator"))
node_discord(("Discord channel"))
node_webcam(("Webcam"))

node_user -->|"launches"| node_app
node_app -->|"creates"| node_window
node_app -->|"applies theme"| node_shared
node_user -->|"controls"| node_window
node_window -->|"starts worker"| node_camera
node_window -->|"receives signals"| node_camera
node_camera -->|"reads frames"| node_webcam
node_camera -->|"runs inference"| node_pose
node_camera -->|"updates tracks"| node_tracker
node_camera -->|"emits frame state"| node_window
node_window -->|"updates view"| node_video
node_window -->|"shows evidence"| node_meter
node_window -->|"shows status"| node_stat
node_window -->|"uses widget"| node_logo
node_window -->|"starts feed"| node_location
node_window -->|"updates events"| node_fall_log
node_fall_log -->|"writes CSV"| node_log_store
node_window -->|"opens history"| node_log_dialog
node_log_dialog -->|"reads history"| node_fall_log
node_window -->|"controls siren"| node_alarm
node_window -->|"sends event alerts"| node_caregiver
node_caregiver -->|"posts messages"| node_discord
node_fall_log -.->|"stores event location"| node_location

click node_app "https://github.com/advaetuc/vertebrate/blob/main/app.py"
click node_window "https://github.com/advaetuc/vertebrate/blob/main/app_modules/mainwindow.py"
click node_camera "https://github.com/advaetuc/vertebrate/blob/main/app_modules/camerathread.py"
click node_pose "https://github.com/advaetuc/vertebrate/blob/main/app_modules/camerathread.py"
click node_tracker "https://github.com/advaetuc/vertebrate/blob/main/app_modules/tracking.py"
click node_shared "https://github.com/advaetuc/vertebrate/blob/main/app_modules/common.py"
click node_video "https://github.com/advaetuc/vertebrate/blob/main/app_modules/videoview.py"
click node_meter "https://github.com/advaetuc/vertebrate/blob/main/app_modules/evidencemeter.py"
click node_stat "https://github.com/advaetuc/vertebrate/blob/main/app_modules/stattile.py"
click node_logo "https://github.com/advaetuc/vertebrate/blob/main/app_modules/logomark.py"
click node_location "https://github.com/advaetuc/vertebrate/blob/main/app_modules/locationfeed.py"
click node_fall_log "https://github.com/advaetuc/vertebrate/blob/main/app_modules/falllog.py"
click node_log_store "https://github.com/advaetuc/vertebrate/blob/main/app_modules/falllog.py"
click node_log_dialog "https://github.com/advaetuc/vertebrate/blob/main/app_modules/falllogdialog.py"
click node_alarm "https://github.com/advaetuc/vertebrate/blob/main/app_modules/alarmsound.py"
click node_caregiver "https://github.com/advaetuc/vertebrate/blob/main/app_modules/caregivers.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_app,node_shared toneBlue
class node_camera,node_pose,node_tracker toneAmber
class node_window,node_video,node_meter,node_stat,node_logo toneMint
class node_fall_log,node_log_store,node_log_dialog,node_alarm,node_caregiver toneRose
class node_location,node_user,node_discord,node_webcam toneIndigo
```

## Components

### Application

- [Application entry](https://github.com/advaetuc/vertebrate/blob/main/app.py): `app.py`
- [Shared runtime helpers](https://github.com/advaetuc/vertebrate/blob/main/app_modules/common.py): `app_modules/common.py`

### Fall monitoring

- [Camera worker](https://github.com/advaetuc/vertebrate/blob/main/app_modules/camerathread.py): `app_modules/camerathread.py`
- [Pose inference](https://github.com/advaetuc/vertebrate/blob/main/app_modules/camerathread.py): `app_modules/camerathread.py`
- [Person tracking](https://github.com/advaetuc/vertebrate/blob/main/app_modules/tracking.py): `app_modules/tracking.py`

### Live interface

- [Main window](https://github.com/advaetuc/vertebrate/blob/main/app_modules/mainwindow.py): `app_modules/mainwindow.py`
- [Video view](https://github.com/advaetuc/vertebrate/blob/main/app_modules/videoview.py): `app_modules/videoview.py`
- [Evidence meter](https://github.com/advaetuc/vertebrate/blob/main/app_modules/evidencemeter.py): `app_modules/evidencemeter.py`
- [Status tiles](https://github.com/advaetuc/vertebrate/blob/main/app_modules/stattile.py): `app_modules/stattile.py`
- [Logo mark](https://github.com/advaetuc/vertebrate/blob/main/app_modules/logomark.py): `app_modules/logomark.py`

### Alerts and history

- [Fall event log](https://github.com/advaetuc/vertebrate/blob/main/app_modules/falllog.py): `app_modules/falllog.py`
- [Per-device CSV](https://github.com/advaetuc/vertebrate/blob/main/app_modules/falllog.py): `app_modules/falllog.py`
- [Fall log dialog](https://github.com/advaetuc/vertebrate/blob/main/app_modules/falllogdialog.py): `app_modules/falllogdialog.py`
- [Local alarm](https://github.com/advaetuc/vertebrate/blob/main/app_modules/alarmsound.py): `app_modules/alarmsound.py`
- [Discord alerts](https://github.com/advaetuc/vertebrate/blob/main/app_modules/caregivers.py): `app_modules/caregivers.py`

### Location context

- [Location feed](https://github.com/advaetuc/vertebrate/blob/main/app_modules/locationfeed.py): `app_modules/locationfeed.py`

### Other components

- **Operator**
- **Discord channel**
- **Webcam**

## Connections

- Operator → Application entry: launches (evidence: `README.md`)
- Application entry → Main window: creates (evidence: `app.py`)
- Application entry → Shared runtime helpers: applies theme (evidence: `app.py`)
- Operator → Main window: controls (evidence: `README.md`)
- Main window → Camera worker: starts worker (evidence: `app_modules/mainwindow.py`)
- Main window → Camera worker: receives signals (evidence: `app_modules/mainwindow.py`)
- Camera worker → Webcam: reads frames (evidence: `README.md`)
- Camera worker → Pose inference: runs inference (evidence: `app_modules/camerathread.py`)
- Camera worker → Person tracking: updates tracks (evidence: `app_modules/camerathread.py`)
- Camera worker → Main window: emits frame state (evidence: `app_modules/camerathread.py`)
- Main window → Video view: updates view (evidence: `README.md`)
- Main window → Evidence meter: shows evidence (evidence: `README.md`)
- Main window → Status tiles: shows status (evidence: `README.md`)
- Main window → Logo mark: uses widget (evidence: `app_modules/mainwindow.py`)
- Main window → Location feed: starts feed (evidence: `app_modules/mainwindow.py`)
- Main window → Fall event log: updates events (evidence: `README.md`)
- Fall event log → Per-device CSV: writes CSV (evidence: `app_modules/falllog.py`)
- Main window → Fall log dialog: opens history (evidence: `app_modules/mainwindow.py`)
- Fall log dialog → Fall event log: reads history (evidence: `app_modules/falllogdialog.py`)
- Main window → Local alarm: controls siren (evidence: `app_modules/mainwindow.py`)
- Main window → Discord alerts: sends event alerts (evidence: `app_modules/mainwindow.py`)
- Discord alerts → Discord channel: posts messages (evidence: `app_modules/caregivers.py`)
- Fall event log → Location feed: stores event location
