# rromeo-rj/parental-all-features architecture

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

- Interactive diagram: https://gitdiagram.com/rromeo-rj/parental-all-features
- Repository: https://github.com/rromeo-rj/parental-all-features

## Overview

SafeGuard is a multi-parent parental monitoring system: parents pair child devices and view only their assigned devices’ activity, while administrators oversee users, devices, and system activity. The Android client runs a background service, receives remote commands, and sends device status and captured data to the server; parents manage devices and commands through the server’s dashboard/API, with SQLite-backed records and real-time socket communication. The README documents encrypted communication, role-based access, notifications, and monitoring capabilities. Some feature wiring is inferred from documentation and the tree; unsampled implementation links are omitted.

Main entry points: [`server/app.py`](https://github.com/rromeo-rj/parental-all-features/blob/main/server/app.py) (Flask application), [`server/database.py`](https://github.com/rromeo-rj/parental-all-features/blob/main/server/database.py) (Database layer), [`app/src/main/java/com/safeguard/client/network/ApiClient.kt`](https://github.com/rromeo-rj/parental-all-features/blob/main/app/src/main/java/com/safeguard/client/network/ApiClient.kt) (HTTP API client), [`app/src/main/java/com/safeguard/client/network/SocketManager.kt`](https://github.com/rromeo-rj/parental-all-features/blob/main/app/src/main/java/com/safeguard/client/network/SocketManager.kt) (Client socket)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Android client"]
  node_setup["Device setup<br/>[SetupActivity.kt]"]
  node_daemon["Background daemon<br/>[DaemonService.kt]"]
  node_dispatcher["Command dispatcher"]
  node_capture["Device capabilities"]
  node_accessibility["Accessibility telemetry"]
  node_projection["Screen capture"]
  node_clientapi["HTTP API client<br/>[ApiClient.kt]"]
  node_socket["Client socket<br/>[SocketManager.kt]"]
  node_rtc["WebRTC streaming<br/>[WebRtcManager.kt]"]
end

subgraph group_server["Server services"]
  node_app["Flask application<br/>[app.py]"]
  node_auth["Authentication<br/>[auth_routes.py]"]
  node_devices["Device management<br/>[device_routes.py]"]
  node_commands["Command queue<br/>[command_routes.py]"]
  node_adminroutes["Admin oversight<br/>[admin_routes.py]"]
  node_contentroutes["Monitoring APIs"]
end

subgraph group_data["Data and realtime"]
  node_models["Domain records"]
  node_database[("Database layer<br/>[database.py]")]
  node_socketserver["Realtime server<br/>[socket_server.py]"]
end

subgraph group_experience["Parent and admin"]
  node_dashboard["Dashboard interface<br/>[main.js]"]
end

node_parent(("Parent"))
node_admin(("Administrator"))
node_device(("Child device"))

node_parent -->|"uses"| node_dashboard
node_admin -->|"uses"| node_dashboard
node_device -->|"pairs through"| node_setup
node_setup -->|"registers"| node_clientapi
node_daemon -->|"connects and polls"| node_socket
node_socket -->|"exchanges events"| node_socketserver
node_socketserver -->|"delivers commands"| node_dispatcher
node_daemon -->|"dispatches polled commands"| node_dispatcher
node_dispatcher -->|"invokes capabilities"| node_capture
node_accessibility -->|"stores telemetry"| node_database
node_accessibility -->|"emits telemetry"| node_socket
node_projection -->|"uploads captures"| node_clientapi
node_clientapi -->|"calls HTTP API"| node_app
node_dashboard -->|"requests pages and data"| node_app
node_app -->|"routes authentication"| node_auth
node_app -->|"routes device requests"| node_devices
node_app -->|"routes commands"| node_commands
node_app -->|"routes administration"| node_adminroutes
node_app -->|"routes monitoring data"| node_contentroutes
node_app -->|"serves realtime integration"| node_socketserver
node_devices -->|"registers and updates devices"| node_database
node_commands -->|"queues and updates commands"| node_database
node_adminroutes -->|"reads and updates records"| node_database
node_contentroutes -->|"reads and stores activity"| node_database
node_database -->|"persists records"| node_models
node_rtc -.->|"exchanges signaling"| node_clientapi
node_rtc -.->|"uses signaling events"| node_socket

click node_setup "https://github.com/rromeo-rj/parental-all-features/blob/main/app/src/main/java/com/safeguard/client/ui/SetupActivity.kt"
click node_daemon "https://github.com/rromeo-rj/parental-all-features/blob/main/app/src/main/java/com/safeguard/client/services/DaemonService.kt"
click node_dispatcher "https://github.com/rromeo-rj/parental-all-features/blob/main/app/src/main/java/com/safeguard/client/managers/CommandDispatcher.kt"
click node_capture "https://github.com/rromeo-rj/parental-all-features/tree/main/app/src/main/java/com/safeguard/client/managers"
click node_accessibility "https://github.com/rromeo-rj/parental-all-features/blob/main/app/src/main/java/com/safeguard/client/services/AccessibilityEngine.kt"
click node_projection "https://github.com/rromeo-rj/parental-all-features/blob/main/app/src/main/java/com/safeguard/client/services/MediaProjectionService.kt"
click node_clientapi "https://github.com/rromeo-rj/parental-all-features/blob/main/app/src/main/java/com/safeguard/client/network/ApiClient.kt"
click node_socket "https://github.com/rromeo-rj/parental-all-features/blob/main/app/src/main/java/com/safeguard/client/network/SocketManager.kt"
click node_rtc "https://github.com/rromeo-rj/parental-all-features/blob/main/app/src/main/java/com/safeguard/client/webrtc/WebRtcManager.kt"
click node_app "https://github.com/rromeo-rj/parental-all-features/blob/main/server/app.py"
click node_auth "https://github.com/rromeo-rj/parental-all-features/blob/main/server/routes/auth_routes.py"
click node_devices "https://github.com/rromeo-rj/parental-all-features/blob/main/server/routes/device_routes.py"
click node_commands "https://github.com/rromeo-rj/parental-all-features/blob/main/server/routes/command_routes.py"
click node_adminroutes "https://github.com/rromeo-rj/parental-all-features/blob/main/server/routes/admin_routes.py"
click node_contentroutes "https://github.com/rromeo-rj/parental-all-features/tree/main/server/routes"
click node_models "https://github.com/rromeo-rj/parental-all-features/tree/main/server/models"
click node_database "https://github.com/rromeo-rj/parental-all-features/blob/main/server/database.py"
click node_socketserver "https://github.com/rromeo-rj/parental-all-features/blob/main/server/socket_server.py"
click node_dashboard "https://github.com/rromeo-rj/parental-all-features/blob/main/server/static/js/main.js"

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_setup,node_daemon,node_dispatcher,node_capture,node_accessibility,node_projection,node_clientapi,node_socket,node_rtc toneBlue
class node_app,node_auth,node_devices,node_commands,node_adminroutes,node_contentroutes toneAmber
class node_models,node_database,node_socketserver toneMint
class node_dashboard toneRose
class node_parent,node_admin,node_device toneIndigo
```

## Components

### Android client

- [Device setup](https://github.com/rromeo-rj/parental-all-features/blob/main/app/src/main/java/com/safeguard/client/ui/SetupActivity.kt): `app/src/main/java/com/safeguard/client/ui/SetupActivity.kt`
- [Background daemon](https://github.com/rromeo-rj/parental-all-features/blob/main/app/src/main/java/com/safeguard/client/services/DaemonService.kt): `app/src/main/java/com/safeguard/client/services/DaemonService.kt`
- [Command dispatcher](https://github.com/rromeo-rj/parental-all-features/blob/main/app/src/main/java/com/safeguard/client/managers/CommandDispatcher.kt): `app/src/main/java/com/safeguard/client/managers/CommandDispatcher.kt`
- [Device capabilities](https://github.com/rromeo-rj/parental-all-features/tree/main/app/src/main/java/com/safeguard/client/managers): `app/src/main/java/com/safeguard/client/managers`
- [Accessibility telemetry](https://github.com/rromeo-rj/parental-all-features/blob/main/app/src/main/java/com/safeguard/client/services/AccessibilityEngine.kt): `app/src/main/java/com/safeguard/client/services/AccessibilityEngine.kt`
- [Screen capture](https://github.com/rromeo-rj/parental-all-features/blob/main/app/src/main/java/com/safeguard/client/services/MediaProjectionService.kt): `app/src/main/java/com/safeguard/client/services/MediaProjectionService.kt`
- [HTTP API client](https://github.com/rromeo-rj/parental-all-features/blob/main/app/src/main/java/com/safeguard/client/network/ApiClient.kt): `app/src/main/java/com/safeguard/client/network/ApiClient.kt`
- [Client socket](https://github.com/rromeo-rj/parental-all-features/blob/main/app/src/main/java/com/safeguard/client/network/SocketManager.kt): `app/src/main/java/com/safeguard/client/network/SocketManager.kt`
- [WebRTC streaming](https://github.com/rromeo-rj/parental-all-features/blob/main/app/src/main/java/com/safeguard/client/webrtc/WebRtcManager.kt): `app/src/main/java/com/safeguard/client/webrtc/WebRtcManager.kt`

### Server services

- [Flask application](https://github.com/rromeo-rj/parental-all-features/blob/main/server/app.py): `server/app.py`
- [Authentication](https://github.com/rromeo-rj/parental-all-features/blob/main/server/routes/auth_routes.py): `server/routes/auth_routes.py`
- [Device management](https://github.com/rromeo-rj/parental-all-features/blob/main/server/routes/device_routes.py): `server/routes/device_routes.py`
- [Command queue](https://github.com/rromeo-rj/parental-all-features/blob/main/server/routes/command_routes.py): `server/routes/command_routes.py`
- [Admin oversight](https://github.com/rromeo-rj/parental-all-features/blob/main/server/routes/admin_routes.py): `server/routes/admin_routes.py`
- [Monitoring APIs](https://github.com/rromeo-rj/parental-all-features/tree/main/server/routes): `server/routes`

### Data and realtime

- [Domain records](https://github.com/rromeo-rj/parental-all-features/tree/main/server/models): `server/models`
- [Database layer](https://github.com/rromeo-rj/parental-all-features/blob/main/server/database.py): `server/database.py`
- [Realtime server](https://github.com/rromeo-rj/parental-all-features/blob/main/server/socket_server.py): `server/socket_server.py`

### Parent and admin

- [Dashboard interface](https://github.com/rromeo-rj/parental-all-features/blob/main/server/static/js/main.js): `server/static/js/main.js`

### Other components

- **Parent**
- **Administrator**
- **Child device**

## Connections

- Parent → Dashboard interface: uses
- Administrator → Dashboard interface: uses
- Child device → Device setup: pairs through
- Device setup → HTTP API client: registers
- Background daemon → Client socket: connects and polls
- Client socket → Realtime server: exchanges events
- Realtime server → Command dispatcher: delivers commands
- Background daemon → Command dispatcher: dispatches polled commands
- Command dispatcher → Device capabilities: invokes capabilities
- Accessibility telemetry → Database layer: stores telemetry
- Accessibility telemetry → Client socket: emits telemetry
- Screen capture → HTTP API client: uploads captures
- HTTP API client → Flask application: calls HTTP API
- Dashboard interface → Flask application: requests pages and data
- Flask application → Authentication: routes authentication
- Flask application → Device management: routes device requests
- Flask application → Command queue: routes commands
- Flask application → Admin oversight: routes administration
- Flask application → Monitoring APIs: routes monitoring data
- Flask application → Realtime server: serves realtime integration
- Device management → Database layer: registers and updates devices
- Command queue → Database layer: queues and updates commands
- Admin oversight → Database layer: reads and updates records
- Monitoring APIs → Database layer: reads and stores activity
- Database layer → Domain records: persists records
- WebRTC streaming → HTTP API client: exchanges signaling
- WebRTC streaming → Client socket: uses signaling events
