# ayush52907/droneinterface architecture

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

- Interactive diagram: https://gitdiagram.com/ayush52907/droneinterface
- Repository: https://github.com/ayush52907/droneinterface

## Overview

Drone Panel is a browser-based control surface for a Jetson drone computer. A teammate opens the panel, the UI fetches identity and live stats, then page actions use the API to inspect or operate services, files, hardware, and other drone subsystems. The backend also supports preflight, ROS 2, camera and flight-data workflows, gimbal control, alerts, and persistent terminal sessions. Edges reflect shown imports, calls, and documented API behavior; some subsystem links are based on the SOURCE INDEX rather than inspected implementation excerpts.

Main entry points: [`agent/app/main.py`](https://github.com/ayush52907/droneinterface/blob/main/agent/app/main.py) (FastAPI routes), [`agent/web/js/app.js`](https://github.com/ayush52907/droneinterface/blob/main/agent/web/js/app.js) (Panel router), [`agent/web/js/api.js`](https://github.com/ayush52907/droneinterface/blob/main/agent/web/js/api.js) (HTTP and sockets), [`agent/app/preflight.py`](https://github.com/ayush52907/droneinterface/blob/main/agent/app/preflight.py) (Preflight checklist)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Browser interface"]
  node_app["Panel router<br/>[app.js]"]
  node_api["HTTP and sockets<br/>[api.js]"]
  node_services_ui["Service page<br/>[services.js]"]
  node_files_ui["File manager<br/>[files.js]"]
  node_actions_ui["Quick actions page<br/>[actions.js]"]
  node_map_ui["Map page<br/>[map.js]"]
  node_other_pages["Capability pages"]
end

subgraph group_core["Agent and operations"]
  node_backend["FastAPI routes<br/>[main.py]"]
  node_config["Configuration<br/>[config.py]"]
  node_services["Service manager<br/>[services.py]"]
  node_logs["Journal logs<br/>[logs.py]"]
  node_files["Sandboxed files<br/>[files.py]"]
  node_terminal["Web terminal<br/>[terminal.py]"]
end

subgraph group_drone["Drone capabilities"]
  node_stats["System stats<br/>[stats.py]"]
  node_hardware["Hardware status<br/>[hardware.py]"]
  node_ros["ROS 2 probe<br/>[ros.py]"]
  node_camera["Camera preview<br/>[camera.py]"]
  node_gimbal["Gimbal control<br/>[gimbal.py]"]
  node_flightdata["Flight data<br/>[flightdata.py]"]
  node_mapdata["Map data<br/>[mapdata.py]"]
  node_payload["Payload controls<br/>[payload.py]"]
end

subgraph group_state["State and oversight"]
  node_preflight["Preflight checklist<br/>[preflight.py]"]
  node_alerts["Alert rules<br/>[alerts.py]"]
  node_actions["Quick actions<br/>[actions.py]"]
  node_audit[("Audit log<br/>[audit.py]")]
end

node_teammate(("Tailnet teammate"))

node_teammate -->|"opens panel"| node_app
node_app -->|"fetches data"| node_api
node_app -->|"routes to"| node_services_ui
node_app -->|"routes to"| node_files_ui
node_app -->|"routes to"| node_actions_ui
node_app -->|"routes to"| node_map_ui
node_app -->|"routes to"| node_other_pages
node_services_ui -->|"requests operations"| node_api
node_files_ui -->|"requests files"| node_api
node_actions_ui -->|"requests actions"| node_api
node_map_ui -->|"requests map data"| node_api
node_other_pages -->|"requests features"| node_api
node_api -->|"dispatches HTTP"| node_backend
node_backend -->|"calls service handlers"| node_services
node_backend -->|"calls log handlers"| node_logs
node_backend -->|"calls file handlers"| node_files
node_backend -->|"calls terminal handlers"| node_terminal
node_backend -->|"streams stats"| node_stats
node_backend -->|"calls hardware handlers"| node_hardware
node_backend -->|"calls ROS handlers"| node_ros
node_backend -->|"serves preview"| node_camera
node_backend -->|"calls data handlers"| node_flightdata
node_backend -->|"calls map handlers"| node_mapdata
node_backend -->|"calls payload handlers"| node_payload
node_backend -->|"calls checklist handlers"| node_preflight
node_backend -->|"calls alert handlers"| node_alerts
node_backend -->|"calls action handlers"| node_actions
node_backend -->|"records changes"| node_audit
node_actions -->|"operates services"| node_services
node_actions -->|"controls gimbal"| node_gimbal
node_flightdata -->|"uses file operations"| node_files
node_logs -->|"uses service runner"| node_services
node_terminal -->|"uses service runner"| node_services
node_alerts -->|"checks hardware"| node_hardware
node_alerts -->|"checks gimbal"| node_gimbal
node_preflight -->|"checks hardware"| node_hardware
node_preflight -->|"checks services"| node_services
node_preflight -->|"checks ROS"| node_ros
node_preflight -->|"checks system"| node_stats
node_preflight -->|"checks gimbal"| node_gimbal
node_stats -->|"includes alerts"| node_alerts

click node_app "https://github.com/ayush52907/droneinterface/blob/main/agent/web/js/app.js"
click node_api "https://github.com/ayush52907/droneinterface/blob/main/agent/web/js/api.js"
click node_services_ui "https://github.com/ayush52907/droneinterface/blob/main/agent/web/js/pages/services.js"
click node_files_ui "https://github.com/ayush52907/droneinterface/blob/main/agent/web/js/pages/files.js"
click node_actions_ui "https://github.com/ayush52907/droneinterface/blob/main/agent/web/js/pages/actions.js"
click node_map_ui "https://github.com/ayush52907/droneinterface/blob/main/agent/web/js/pages/map.js"
click node_other_pages "https://github.com/ayush52907/droneinterface/tree/main/agent/web/js/pages"
click node_backend "https://github.com/ayush52907/droneinterface/blob/main/agent/app/main.py"
click node_config "https://github.com/ayush52907/droneinterface/blob/main/agent/app/config.py"
click node_services "https://github.com/ayush52907/droneinterface/blob/main/agent/app/services.py"
click node_logs "https://github.com/ayush52907/droneinterface/blob/main/agent/app/logs.py"
click node_files "https://github.com/ayush52907/droneinterface/blob/main/agent/app/files.py"
click node_terminal "https://github.com/ayush52907/droneinterface/blob/main/agent/app/terminal.py"
click node_stats "https://github.com/ayush52907/droneinterface/blob/main/agent/app/stats.py"
click node_hardware "https://github.com/ayush52907/droneinterface/blob/main/agent/app/hardware.py"
click node_ros "https://github.com/ayush52907/droneinterface/blob/main/agent/app/ros.py"
click node_camera "https://github.com/ayush52907/droneinterface/blob/main/agent/app/camera.py"
click node_gimbal "https://github.com/ayush52907/droneinterface/blob/main/agent/app/gimbal.py"
click node_flightdata "https://github.com/ayush52907/droneinterface/blob/main/agent/app/flightdata.py"
click node_mapdata "https://github.com/ayush52907/droneinterface/blob/main/agent/app/mapdata.py"
click node_payload "https://github.com/ayush52907/droneinterface/blob/main/agent/app/payload.py"
click node_preflight "https://github.com/ayush52907/droneinterface/blob/main/agent/app/preflight.py"
click node_alerts "https://github.com/ayush52907/droneinterface/blob/main/agent/app/alerts.py"
click node_actions "https://github.com/ayush52907/droneinterface/blob/main/agent/app/actions.py"
click node_audit "https://github.com/ayush52907/droneinterface/blob/main/agent/app/audit.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_api,node_services_ui,node_files_ui,node_actions_ui,node_map_ui,node_other_pages toneBlue
class node_backend,node_config,node_services,node_logs,node_files,node_terminal toneAmber
class node_stats,node_hardware,node_ros,node_camera,node_gimbal,node_flightdata,node_mapdata,node_payload toneMint
class node_preflight,node_alerts,node_actions,node_audit toneRose
class node_teammate toneIndigo
```

## Components

### Browser interface

- [Panel router](https://github.com/ayush52907/droneinterface/blob/main/agent/web/js/app.js): `agent/web/js/app.js`
- [HTTP and sockets](https://github.com/ayush52907/droneinterface/blob/main/agent/web/js/api.js): `agent/web/js/api.js`
- [Service page](https://github.com/ayush52907/droneinterface/blob/main/agent/web/js/pages/services.js): `agent/web/js/pages/services.js`
- [File manager](https://github.com/ayush52907/droneinterface/blob/main/agent/web/js/pages/files.js): `agent/web/js/pages/files.js`
- [Quick actions page](https://github.com/ayush52907/droneinterface/blob/main/agent/web/js/pages/actions.js): `agent/web/js/pages/actions.js`
- [Map page](https://github.com/ayush52907/droneinterface/blob/main/agent/web/js/pages/map.js): `agent/web/js/pages/map.js`
- [Capability pages](https://github.com/ayush52907/droneinterface/tree/main/agent/web/js/pages): `agent/web/js/pages`

### Agent and operations

- [FastAPI routes](https://github.com/ayush52907/droneinterface/blob/main/agent/app/main.py): `agent/app/main.py`
- [Configuration](https://github.com/ayush52907/droneinterface/blob/main/agent/app/config.py): `agent/app/config.py`
- [Service manager](https://github.com/ayush52907/droneinterface/blob/main/agent/app/services.py): `agent/app/services.py`
- [Journal logs](https://github.com/ayush52907/droneinterface/blob/main/agent/app/logs.py): `agent/app/logs.py`
- [Sandboxed files](https://github.com/ayush52907/droneinterface/blob/main/agent/app/files.py): `agent/app/files.py`
- [Web terminal](https://github.com/ayush52907/droneinterface/blob/main/agent/app/terminal.py): `agent/app/terminal.py`

### Drone capabilities

- [System stats](https://github.com/ayush52907/droneinterface/blob/main/agent/app/stats.py): `agent/app/stats.py`
- [Hardware status](https://github.com/ayush52907/droneinterface/blob/main/agent/app/hardware.py): `agent/app/hardware.py`
- [ROS 2 probe](https://github.com/ayush52907/droneinterface/blob/main/agent/app/ros.py): `agent/app/ros.py`
- [Camera preview](https://github.com/ayush52907/droneinterface/blob/main/agent/app/camera.py): `agent/app/camera.py`
- [Gimbal control](https://github.com/ayush52907/droneinterface/blob/main/agent/app/gimbal.py): `agent/app/gimbal.py`
- [Flight data](https://github.com/ayush52907/droneinterface/blob/main/agent/app/flightdata.py): `agent/app/flightdata.py`
- [Map data](https://github.com/ayush52907/droneinterface/blob/main/agent/app/mapdata.py): `agent/app/mapdata.py`
- [Payload controls](https://github.com/ayush52907/droneinterface/blob/main/agent/app/payload.py): `agent/app/payload.py`

### State and oversight

- [Preflight checklist](https://github.com/ayush52907/droneinterface/blob/main/agent/app/preflight.py): `agent/app/preflight.py`
- [Alert rules](https://github.com/ayush52907/droneinterface/blob/main/agent/app/alerts.py): `agent/app/alerts.py`
- [Quick actions](https://github.com/ayush52907/droneinterface/blob/main/agent/app/actions.py): `agent/app/actions.py`
- [Audit log](https://github.com/ayush52907/droneinterface/blob/main/agent/app/audit.py): `agent/app/audit.py`

### Other components

- **Tailnet teammate**

## Connections

- Tailnet teammate → Panel router: opens panel (evidence: `README.md`)
- Panel router → HTTP and sockets: fetches data (evidence: `agent/web/js/app.js`)
- Panel router → Service page: routes to (evidence: `agent/web/js/app.js`)
- Panel router → File manager: routes to (evidence: `agent/web/js/app.js`)
- Panel router → Quick actions page: routes to (evidence: `agent/web/js/app.js`)
- Panel router → Map page: routes to (evidence: `agent/web/js/app.js`)
- Panel router → Capability pages: routes to (evidence: `agent/web/js/app.js`)
- Service page → HTTP and sockets: requests operations (evidence: `agent/web/js/pages/services.js`)
- File manager → HTTP and sockets: requests files (evidence: `agent/web/js/pages/files.js`)
- Quick actions page → HTTP and sockets: requests actions (evidence: `agent/web/js/pages/actions.js`)
- Map page → HTTP and sockets: requests map data (evidence: `agent/web/js/pages/map.js`)
- Capability pages → HTTP and sockets: requests features (evidence: `agent/web/js/pages/dashboard.js`)
- HTTP and sockets → FastAPI routes: dispatches HTTP (evidence: `agent/web/js/api.js`)
- FastAPI routes → Service manager: calls service handlers (evidence: `agent/app/main.py`)
- FastAPI routes → Journal logs: calls log handlers (evidence: `agent/app/main.py`)
- FastAPI routes → Sandboxed files: calls file handlers (evidence: `agent/app/main.py`)
- FastAPI routes → Web terminal: calls terminal handlers (evidence: `agent/app/main.py`)
- FastAPI routes → System stats: streams stats (evidence: `agent/app/main.py`)
- FastAPI routes → Hardware status: calls hardware handlers (evidence: `agent/app/main.py`)
- FastAPI routes → ROS 2 probe: calls ROS handlers (evidence: `agent/app/main.py`)
- FastAPI routes → Camera preview: serves preview (evidence: `agent/app/main.py`)
- FastAPI routes → Flight data: calls data handlers (evidence: `agent/app/main.py`)
- FastAPI routes → Map data: calls map handlers (evidence: `agent/app/main.py`)
- FastAPI routes → Payload controls: calls payload handlers (evidence: `agent/app/main.py`)
- FastAPI routes → Preflight checklist: calls checklist handlers (evidence: `agent/app/main.py`)
- FastAPI routes → Alert rules: calls alert handlers (evidence: `agent/app/main.py`)
- FastAPI routes → Quick actions: calls action handlers (evidence: `agent/app/main.py`)
- FastAPI routes → Audit log: records changes (evidence: `agent/app/main.py`)
- Quick actions → Service manager: operates services (evidence: `agent/app/actions.py`)
- Quick actions → Gimbal control: controls gimbal (evidence: `agent/app/actions.py`)
- Flight data → Sandboxed files: uses file operations (evidence: `agent/app/flightdata.py`)
- Journal logs → Service manager: uses service runner (evidence: `agent/app/logs.py`)
- Web terminal → Service manager: uses service runner (evidence: `agent/app/terminal.py`)
- Alert rules → Hardware status: checks hardware (evidence: `agent/app/alerts.py`)
- Alert rules → Gimbal control: checks gimbal (evidence: `agent/app/alerts.py`)
- Preflight checklist → Hardware status: checks hardware (evidence: `agent/app/preflight.py`)
- Preflight checklist → Service manager: checks services (evidence: `agent/app/preflight.py`)
- Preflight checklist → ROS 2 probe: checks ROS (evidence: `agent/app/preflight.py`)
- Preflight checklist → System stats: checks system (evidence: `agent/app/preflight.py`)
- Preflight checklist → Gimbal control: checks gimbal (evidence: `agent/app/preflight.py`)
- System stats → Alert rules: includes alerts (evidence: `agent/app/stats.py`)
