# atom-games/diplom_safary_eye architecture

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

- Interactive diagram: https://gitdiagram.com/atom-games/diplom_safary_eye
- Repository: https://github.com/atom-games/diplom_safary_eye

## Overview

Diplom is a camera-based weapon-detection and alerting system with an Angular management interface, an Express API, and a separate Python detection service. Users configure detection modules and subscribers; the detector retrieves camera frames, produces detections, and posts results to subscribed listeners. The backend tracks module state and can notify associated phone subscribers through UltraMsg. The graph reflects sampled source and the listed tree; router wiring and several controller implementations are absent, so uncertain links are omitted.

Main entry points: [`Diplom/app.js`](https://github.com/atom-games/diplom_safary_eye/blob/master/Diplom/app.js) (Express application), [`Diplom/controllers/neyro_controller.js`](https://github.com/atom-games/diplom_safary_eye/blob/master/Diplom/controllers/neyro_controller.js) (Detection module handlers), [`Diplom/client/src/app/app.module.ts`](https://github.com/atom-games/diplom_safary_eye/blob/master/Diplom/client/src/app/app.module.ts) (Angular app), [`Diplom_v_01/main.py`](https://github.com/atom-games/diplom_safary_eye/blob/master/Diplom_v_01/main.py) (Frame detection)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web client"]
  node_angular["Angular app<br/>[app.module.ts]"]
  node_auth_ui["Authentication UI<br/>[auth-service.ts]"]
  node_module_ui["Module management<br/>[neyros.service.ts]"]
  node_listener_ui["Listener management"]
end

subgraph group_api["Backend API"]
  node_express["Express application<br/>[app.js]"]
  node_auth_controller["Authentication handlers<br/>[auth.js]"]
  node_module_controller["Detection module handlers"]
  node_listener_controller["Subscriber handlers"]
  node_camera_controller["Camera handlers<br/>[camera_controls.js]"]
end

subgraph group_detection["Detection service"]
  node_detector["Frame detection<br/>[main.py]"]
  node_vision["Detection engine"]
end

subgraph group_state["Application state"]
  node_database[("SQLite state")]
end

node_operator(("Operator"))
node_camera["Camera device"]
node_ultramsg["UltraMsg service"]

node_operator -->|"uses"| node_angular
node_angular -->|"invokes"| node_auth_ui
node_angular -->|"invokes"| node_module_ui
node_angular -->|"renders"| node_listener_ui
node_auth_ui -->|"HTTP requests"| node_express
node_module_ui -->|"HTTP requests"| node_express
node_listener_ui -->|"HTTP requests"| node_express
node_express -->|"routes"| node_auth_controller
node_express -->|"routes"| node_module_controller
node_express -->|"routes"| node_listener_controller
node_express -->|"routes"| node_camera_controller
node_auth_controller -->|"queries"| node_database
node_module_controller -->|"reads and writes"| node_database
node_listener_controller -->|"reads and writes"| node_database
node_module_controller -->|"sends alerts"| node_ultramsg
node_detector -->|"fetches frames"| node_camera
node_detector -->|"runs detection"| node_vision
node_detector -->|"posts detections"| node_module_controller
node_module_controller -->|"subscribes callback"| node_detector

click node_angular "https://github.com/atom-games/diplom_safary_eye/blob/master/Diplom/client/src/app/app.module.ts"
click node_auth_ui "https://github.com/atom-games/diplom_safary_eye/blob/master/Diplom/client/src/app/service/auth-service.ts"
click node_module_ui "https://github.com/atom-games/diplom_safary_eye/blob/master/Diplom/client/src/app/service/neyros.service.ts"
click node_listener_ui "https://github.com/atom-games/diplom_safary_eye/blob/master/Diplom/client/src/app/Views/admin_panel_listeners/admin_panel_listeners.component.ts"
click node_express "https://github.com/atom-games/diplom_safary_eye/blob/master/Diplom/app.js"
click node_auth_controller "https://github.com/atom-games/diplom_safary_eye/blob/master/Diplom/controllers/auth.js"
click node_module_controller "https://github.com/atom-games/diplom_safary_eye/blob/master/Diplom/controllers/neyro_controller.js"
click node_listener_controller "https://github.com/atom-games/diplom_safary_eye/blob/master/Diplom/controllers/listeners_controller.js"
click node_camera_controller "https://github.com/atom-games/diplom_safary_eye/blob/master/Diplom/controllers/camera_controls.js"
click node_database "https://github.com/atom-games/diplom_safary_eye/blob/master/Diplom/controllers/database_controller.js"
click node_detector "https://github.com/atom-games/diplom_safary_eye/blob/master/Diplom_v_01/main.py"
click node_vision "https://github.com/atom-games/diplom_safary_eye/tree/master/Diplom_v_01"

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_angular,node_auth_ui,node_module_ui,node_listener_ui toneBlue
class node_express,node_auth_controller,node_module_controller,node_listener_controller,node_camera_controller toneAmber
class node_detector,node_vision toneMint
class node_database toneRose
class node_operator,node_camera,node_ultramsg toneIndigo
```

## Components

### Web client

- [Angular app](https://github.com/atom-games/diplom_safary_eye/blob/master/Diplom/client/src/app/app.module.ts): `Diplom/client/src/app/app.module.ts`
- [Authentication UI](https://github.com/atom-games/diplom_safary_eye/blob/master/Diplom/client/src/app/service/auth-service.ts): `Diplom/client/src/app/service/auth-service.ts`
- [Module management](https://github.com/atom-games/diplom_safary_eye/blob/master/Diplom/client/src/app/service/neyros.service.ts): `Diplom/client/src/app/service/neyros.service.ts`
- [Listener management](https://github.com/atom-games/diplom_safary_eye/blob/master/Diplom/client/src/app/Views/admin_panel_listeners/admin_panel_listeners.component.ts): `Diplom/client/src/app/Views/admin_panel_listeners/admin_panel_listeners.component.ts`

### Backend API

- [Express application](https://github.com/atom-games/diplom_safary_eye/blob/master/Diplom/app.js): `Diplom/app.js`
- [Authentication handlers](https://github.com/atom-games/diplom_safary_eye/blob/master/Diplom/controllers/auth.js): `Diplom/controllers/auth.js`
- [Detection module handlers](https://github.com/atom-games/diplom_safary_eye/blob/master/Diplom/controllers/neyro_controller.js): `Diplom/controllers/neyro_controller.js`
- [Subscriber handlers](https://github.com/atom-games/diplom_safary_eye/blob/master/Diplom/controllers/listeners_controller.js): `Diplom/controllers/listeners_controller.js`
- [Camera handlers](https://github.com/atom-games/diplom_safary_eye/blob/master/Diplom/controllers/camera_controls.js): `Diplom/controllers/camera_controls.js`

### Detection service

- [Frame detection](https://github.com/atom-games/diplom_safary_eye/blob/master/Diplom_v_01/main.py): `Diplom_v_01/main.py`
- [Detection engine](https://github.com/atom-games/diplom_safary_eye/tree/master/Diplom_v_01): `Diplom_v_01`

### Application state

- [SQLite state](https://github.com/atom-games/diplom_safary_eye/blob/master/Diplom/controllers/database_controller.js): `Diplom/controllers/database_controller.js`

### Other components

- **Operator**
- **Camera device**
- **UltraMsg service**

## Connections

- Operator → Angular app: uses
- Angular app → Authentication UI: invokes
- Angular app → Module management: invokes
- Angular app → Listener management: renders
- Authentication UI → Express application: HTTP requests
- Module management → Express application: HTTP requests
- Listener management → Express application: HTTP requests
- Express application → Authentication handlers: routes
- Express application → Detection module handlers: routes
- Express application → Subscriber handlers: routes
- Express application → Camera handlers: routes
- Authentication handlers → SQLite state: queries
- Detection module handlers → SQLite state: reads and writes
- Subscriber handlers → SQLite state: reads and writes
- Detection module handlers → UltraMsg service: sends alerts
- Frame detection → Camera device: fetches frames
- Frame detection → Detection engine: runs detection
- Frame detection → Detection module handlers: posts detections
- Detection module handlers → Frame detection: subscribes callback
