# afnanalamm/dronedroid architecture

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

- Interactive diagram: https://gitdiagram.com/afnanalamm/dronedroid
- Repository: https://github.com/afnanalamm/dronedroid

## Overview

Dronedroid is a hobby project for controlling a drone with hand gestures. The visible workflow is a phone app reading accelerometer values, emitting them over Socket.IO, and a Python service scaling the values and forwarding them over serial to a flight controller. The tree also contains Arduino flight-controller sketches and a separate YMFC-AL firmware set, but their behavior and relationship to the serial bridge are not shown in the excerpts. The graph preserves these firmware components without asserting an unverified connection.

Main entry points: [`Dronedroid_UserController/App.jsx`](https://github.com/afnanalamm/dronedroid/blob/main/Dronedroid_UserController/App.jsx) (Sensor UI), [`Dronedroid_FlightController/main.py`](https://github.com/afnanalamm/dronedroid/blob/main/Dronedroid_FlightController/main.py) (Socket event bridge), [`Dronedroid_UserController/index.js`](https://github.com/afnanalamm/dronedroid/blob/main/Dronedroid_UserController/index.js) (App entry), [`Dronedroid_FlightController/sketch_dec19a_test_serial_dronedroid/sketch_dec19a_test_serial_dronedroid.ino`](https://github.com/afnanalamm/dronedroid/blob/main/Dronedroid_FlightController/sketch_dec19a_test_serial_dronedroid/sketch_dec19a_test_serial_dronedroid.ino) (Serial test sketch)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_mobile["Mobile controller"]
  node_app_entry["App entry<br/>[index.js]"]
  node_gesture_ui["Sensor UI<br/>[App.jsx]"]
  node_socket_client["Socket client<br/>[App.jsx]"]
end

subgraph group_bridge["Control bridge"]
  node_socket_bridge["Socket event bridge<br/>[main.py]"]
  node_serial_output["Serial command output<br/>[main.py]"]
end

subgraph group_firmware["Flight firmware"]
  node_serial_controller["Serial test sketch"]
  node_temporary_sketch["Temporary sketch<br/>[temporary.ino]"]
  node_ymfc_flight["YMFC flight firmware"]
  node_ymfc_setup["YMFC setup firmware<br/>[YMFC-AL-setup.ino]"]
  node_ymfc_calibration["ESC calibration"]
end

node_user(("Drone operator"))
node_sensors(("Device accelerometer"))
node_flight_hardware["Flight controller"]

node_user -->|"tilts device"| node_gesture_ui
node_sensors -->|"provides readings"| node_gesture_ui
node_app_entry -->|"registers app"| node_gesture_ui
node_gesture_ui -->|"emits readings"| node_socket_client
node_socket_client -->|"sends accel event"| node_socket_bridge
node_socket_bridge -->|"scales and writes"| node_serial_output
node_serial_output -->|"serial commands"| node_flight_hardware
node_serial_controller -.->|"may run on"| node_flight_hardware
node_temporary_sketch -.->|"may run on"| node_flight_hardware
node_ymfc_flight -.->|"may control"| node_flight_hardware
node_ymfc_setup -.->|"may configure"| node_flight_hardware
node_ymfc_calibration -.->|"may calibrate"| node_flight_hardware

click node_app_entry "https://github.com/afnanalamm/dronedroid/blob/main/Dronedroid_UserController/index.js"
click node_gesture_ui "https://github.com/afnanalamm/dronedroid/blob/main/Dronedroid_UserController/App.jsx"
click node_socket_client "https://github.com/afnanalamm/dronedroid/blob/main/Dronedroid_UserController/App.jsx"
click node_socket_bridge "https://github.com/afnanalamm/dronedroid/blob/main/Dronedroid_FlightController/main.py"
click node_serial_output "https://github.com/afnanalamm/dronedroid/blob/main/Dronedroid_FlightController/main.py"
click node_serial_controller "https://github.com/afnanalamm/dronedroid/blob/main/Dronedroid_FlightController/sketch_dec19a_test_serial_dronedroid/sketch_dec19a_test_serial_dronedroid.ino"
click node_temporary_sketch "https://github.com/afnanalamm/dronedroid/blob/main/Dronedroid_FlightController/temporary.ino"
click node_ymfc_flight "https://github.com/afnanalamm/dronedroid/blob/main/YMFC-AL/YMFC-AL-Flight_controller.ino"
click node_ymfc_setup "https://github.com/afnanalamm/dronedroid/blob/main/YMFC-AL/YMFC-AL-setup.ino"
click node_ymfc_calibration "https://github.com/afnanalamm/dronedroid/blob/main/YMFC-AL/YMFC-AL-esc_calibrate.ino"

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_entry,node_gesture_ui,node_socket_client toneBlue
class node_socket_bridge,node_serial_output toneAmber
class node_serial_controller,node_temporary_sketch,node_ymfc_flight,node_ymfc_setup,node_ymfc_calibration toneMint
class node_user,node_sensors,node_flight_hardware toneIndigo
```

## Components

### Mobile controller

- [App entry](https://github.com/afnanalamm/dronedroid/blob/main/Dronedroid_UserController/index.js): `Dronedroid_UserController/index.js`
- [Sensor UI](https://github.com/afnanalamm/dronedroid/blob/main/Dronedroid_UserController/App.jsx): `Dronedroid_UserController/App.jsx`
- [Socket client](https://github.com/afnanalamm/dronedroid/blob/main/Dronedroid_UserController/App.jsx): `Dronedroid_UserController/App.jsx`

### Control bridge

- [Socket event bridge](https://github.com/afnanalamm/dronedroid/blob/main/Dronedroid_FlightController/main.py): `Dronedroid_FlightController/main.py`
- [Serial command output](https://github.com/afnanalamm/dronedroid/blob/main/Dronedroid_FlightController/main.py): `Dronedroid_FlightController/main.py`

### Flight firmware

- [Serial test sketch](https://github.com/afnanalamm/dronedroid/blob/main/Dronedroid_FlightController/sketch_dec19a_test_serial_dronedroid/sketch_dec19a_test_serial_dronedroid.ino): `Dronedroid_FlightController/sketch_dec19a_test_serial_dronedroid/sketch_dec19a_test_serial_dronedroid.ino`
- [Temporary sketch](https://github.com/afnanalamm/dronedroid/blob/main/Dronedroid_FlightController/temporary.ino): `Dronedroid_FlightController/temporary.ino`
- [YMFC flight firmware](https://github.com/afnanalamm/dronedroid/blob/main/YMFC-AL/YMFC-AL-Flight_controller.ino): `YMFC-AL/YMFC-AL-Flight_controller.ino`
- [YMFC setup firmware](https://github.com/afnanalamm/dronedroid/blob/main/YMFC-AL/YMFC-AL-setup.ino): `YMFC-AL/YMFC-AL-setup.ino`
- [ESC calibration](https://github.com/afnanalamm/dronedroid/blob/main/YMFC-AL/YMFC-AL-esc_calibrate.ino): `YMFC-AL/YMFC-AL-esc_calibrate.ino`

### Other components

- **Drone operator**
- **Device accelerometer**
- **Flight controller**

## Connections

- Drone operator → Sensor UI: tilts device (evidence: `Dronedroid_UserController/App.jsx`)
- Device accelerometer → Sensor UI: provides readings (evidence: `Dronedroid_UserController/App.jsx`)
- App entry → Sensor UI: registers app (evidence: `Dronedroid_UserController/index.js`)
- Sensor UI → Socket client: emits readings (evidence: `Dronedroid_UserController/App.jsx`)
- Socket client → Socket event bridge: sends accel event (evidence: `Dronedroid_UserController/App.jsx`)
- Socket event bridge → Serial command output: scales and writes (evidence: `Dronedroid_FlightController/main.py`)
- Serial command output → Flight controller: serial commands (evidence: `Dronedroid_FlightController/main.py`)
- Serial test sketch → Flight controller: may run on
- Temporary sketch → Flight controller: may run on
- YMFC flight firmware → Flight controller: may control
- YMFC setup firmware → Flight controller: may configure
- ESC calibration → Flight controller: may calibrate
