# muhammedkusay/micro-air-vehicle-telemetry architecture

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

- Interactive diagram: https://gitdiagram.com/muhammedkusay/micro-air-vehicle-telemetry
- Repository: https://github.com/muhammedkusay/micro-air-vehicle-telemetry

## Overview

This is a real-time ArduPilot telemetry monitor: MAVLink data is decoded and shared with a live React dashboard, while a slower Laravel API path records flights and telemetry for vehicle and flight history views. README documents the WebSocket and persistence rates, database, maps, and visualization capabilities. The sampled source confirms the service entry point, API request helper, and Laravel controllers; links inside unsampled hooks, routes, and service modules are limited to documented behavior.

Main entry points: [`telemetry_service/main.py`](https://github.com/muhammedkusay/micro-air-vehicle-telemetry/blob/main/telemetry_service/main.py) (Telemetry runner), [`backend/routes/api.php`](https://github.com/muhammedkusay/micro-air-vehicle-telemetry/blob/main/backend/routes/api.php) (API routes), [`backend/app/Http/Controllers/FlightController.php`](https://github.com/muhammedkusay/micro-air-vehicle-telemetry/blob/main/backend/app/Http/Controllers/FlightController.php) (Flight controller), [`frontend/src/App.jsx`](https://github.com/muhammedkusay/micro-air-vehicle-telemetry/blob/main/frontend/src/App.jsx) (React routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ingest["Telemetry service"]
  node_entry["Telemetry runner<br/>[main.py]"]
  node_mavlink["MAVLink I/O<br/>[mavlink.py]"]
  node_telemetry["Telemetry state<br/>[telemetry.py]"]
  node_ws["WebSocket server<br/>[websocket.py]"]
  node_service_api["History API client<br/>[api.py]"]
end

subgraph group_history["History API"]
  node_laravel["Laravel API<br/>[index.php]"]
  node_api_routes["API routes<br/>[api.php]"]
  node_vehicles["Vehicle controller"]
  node_flights["Flight controller"]
  node_telemetry_controller["Telemetry controller"]
  node_vehicle_model["Vehicle model<br/>[Vehicle.php]"]
  node_flight_model["Flight model<br/>[Flight.php]"]
  node_telemetry_model["Telemetry model<br/>[Telemetry.php]"]
end

subgraph group_frontend["Dashboard"]
  node_frontend_app["React routes<br/>[App.jsx]"]
  node_dashboard["Live dashboard<br/>[Dashboard.jsx]"]
  node_history_pages["Vehicle and flight pages"]
  node_api_hook["REST request hook<br/>[useApi.js]"]
  node_telemetry_hook["Live telemetry hook<br/>[useTelemetry.js]"]
  node_visuals["Charts and maps"]
end

subgraph group_integrations["External systems"]
  node_ardupilot["ArduPilot SITL"]
  node_mysql[("MySQL database")]
  node_osm["OpenStreetMap tiles"]
end

node_pilot(("Operator"))

node_pilot -->|"navigates"| node_frontend_app
node_ardupilot -->|"sends MAVLink"| node_mavlink
node_entry -->|"connects and receives"| node_mavlink
node_entry -->|"updates state"| node_telemetry
node_entry -->|"starts server"| node_ws
node_entry -->|"creates flight; sends records"| node_service_api
node_service_api -->|"posts history"| node_laravel
node_frontend_app -->|"routes"| node_dashboard
node_frontend_app -->|"routes"| node_history_pages
node_api_hook -->|"requests REST data"| node_laravel
node_telemetry_hook -->|"receives live stream"| node_ws
node_dashboard -->|"renders telemetry"| node_visuals
node_history_pages -->|"renders flight data"| node_visuals
node_visuals -->|"loads map tiles"| node_osm
node_laravel -->|"dispatches"| node_api_routes
node_api_routes -->|"dispatches vehicle requests"| node_vehicles
node_api_routes -->|"dispatches flight requests"| node_flights
node_api_routes -->|"dispatches telemetry requests"| node_telemetry_controller
node_vehicles -->|"queries"| node_vehicle_model
node_flights -->|"queries"| node_vehicle_model
node_flights -->|"queries and creates"| node_flight_model
node_telemetry_controller -->|"queries and stores"| node_telemetry_model
node_vehicle_model -->|"reads and writes"| node_mysql
node_flight_model -->|"reads and writes"| node_mysql
node_telemetry_model -->|"reads and writes"| node_mysql

click node_entry "https://github.com/muhammedkusay/micro-air-vehicle-telemetry/blob/main/telemetry_service/main.py"
click node_mavlink "https://github.com/muhammedkusay/micro-air-vehicle-telemetry/blob/main/telemetry_service/app/mavlink.py"
click node_telemetry "https://github.com/muhammedkusay/micro-air-vehicle-telemetry/blob/main/telemetry_service/app/telemetry.py"
click node_ws "https://github.com/muhammedkusay/micro-air-vehicle-telemetry/blob/main/telemetry_service/app/websocket.py"
click node_service_api "https://github.com/muhammedkusay/micro-air-vehicle-telemetry/blob/main/telemetry_service/app/api.py"
click node_laravel "https://github.com/muhammedkusay/micro-air-vehicle-telemetry/blob/main/backend/public/index.php"
click node_api_routes "https://github.com/muhammedkusay/micro-air-vehicle-telemetry/blob/main/backend/routes/api.php"
click node_vehicles "https://github.com/muhammedkusay/micro-air-vehicle-telemetry/blob/main/backend/app/Http/Controllers/VehicleController.php"
click node_flights "https://github.com/muhammedkusay/micro-air-vehicle-telemetry/blob/main/backend/app/Http/Controllers/FlightController.php"
click node_telemetry_controller "https://github.com/muhammedkusay/micro-air-vehicle-telemetry/blob/main/backend/app/Http/Controllers/TelemetryController.php"
click node_vehicle_model "https://github.com/muhammedkusay/micro-air-vehicle-telemetry/blob/main/backend/app/Models/Vehicle.php"
click node_flight_model "https://github.com/muhammedkusay/micro-air-vehicle-telemetry/blob/main/backend/app/Models/Flight.php"
click node_telemetry_model "https://github.com/muhammedkusay/micro-air-vehicle-telemetry/blob/main/backend/app/Models/Telemetry.php"
click node_frontend_app "https://github.com/muhammedkusay/micro-air-vehicle-telemetry/blob/main/frontend/src/App.jsx"
click node_dashboard "https://github.com/muhammedkusay/micro-air-vehicle-telemetry/blob/main/frontend/src/pages/Dashboard.jsx"
click node_history_pages "https://github.com/muhammedkusay/micro-air-vehicle-telemetry/tree/main/frontend/src/pages"
click node_api_hook "https://github.com/muhammedkusay/micro-air-vehicle-telemetry/blob/main/frontend/src/hooks/useApi.js"
click node_telemetry_hook "https://github.com/muhammedkusay/micro-air-vehicle-telemetry/blob/main/frontend/src/hooks/useTelemetry.js"
click node_visuals "https://github.com/muhammedkusay/micro-air-vehicle-telemetry/tree/main/frontend/src/components"

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_entry,node_mavlink,node_telemetry,node_ws,node_service_api toneBlue
class node_laravel,node_api_routes,node_vehicles,node_flights,node_telemetry_controller,node_vehicle_model,node_flight_model,node_telemetry_model toneAmber
class node_frontend_app,node_dashboard,node_history_pages,node_api_hook,node_telemetry_hook,node_visuals toneMint
class node_ardupilot,node_mysql,node_osm toneRose
class node_pilot toneIndigo
```

## Components

### Telemetry service

- [Telemetry runner](https://github.com/muhammedkusay/micro-air-vehicle-telemetry/blob/main/telemetry_service/main.py): `telemetry_service/main.py`
- [MAVLink I/O](https://github.com/muhammedkusay/micro-air-vehicle-telemetry/blob/main/telemetry_service/app/mavlink.py): `telemetry_service/app/mavlink.py`
- [Telemetry state](https://github.com/muhammedkusay/micro-air-vehicle-telemetry/blob/main/telemetry_service/app/telemetry.py): `telemetry_service/app/telemetry.py`
- [WebSocket server](https://github.com/muhammedkusay/micro-air-vehicle-telemetry/blob/main/telemetry_service/app/websocket.py): `telemetry_service/app/websocket.py`
- [History API client](https://github.com/muhammedkusay/micro-air-vehicle-telemetry/blob/main/telemetry_service/app/api.py): `telemetry_service/app/api.py`

### History API

- [Laravel API](https://github.com/muhammedkusay/micro-air-vehicle-telemetry/blob/main/backend/public/index.php): `backend/public/index.php`
- [API routes](https://github.com/muhammedkusay/micro-air-vehicle-telemetry/blob/main/backend/routes/api.php): `backend/routes/api.php`
- [Vehicle controller](https://github.com/muhammedkusay/micro-air-vehicle-telemetry/blob/main/backend/app/Http/Controllers/VehicleController.php): `backend/app/Http/Controllers/VehicleController.php`
- [Flight controller](https://github.com/muhammedkusay/micro-air-vehicle-telemetry/blob/main/backend/app/Http/Controllers/FlightController.php): `backend/app/Http/Controllers/FlightController.php`
- [Telemetry controller](https://github.com/muhammedkusay/micro-air-vehicle-telemetry/blob/main/backend/app/Http/Controllers/TelemetryController.php): `backend/app/Http/Controllers/TelemetryController.php`
- [Vehicle model](https://github.com/muhammedkusay/micro-air-vehicle-telemetry/blob/main/backend/app/Models/Vehicle.php): `backend/app/Models/Vehicle.php`
- [Flight model](https://github.com/muhammedkusay/micro-air-vehicle-telemetry/blob/main/backend/app/Models/Flight.php): `backend/app/Models/Flight.php`
- [Telemetry model](https://github.com/muhammedkusay/micro-air-vehicle-telemetry/blob/main/backend/app/Models/Telemetry.php): `backend/app/Models/Telemetry.php`

### Dashboard

- [React routes](https://github.com/muhammedkusay/micro-air-vehicle-telemetry/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Live dashboard](https://github.com/muhammedkusay/micro-air-vehicle-telemetry/blob/main/frontend/src/pages/Dashboard.jsx): `frontend/src/pages/Dashboard.jsx`
- [Vehicle and flight pages](https://github.com/muhammedkusay/micro-air-vehicle-telemetry/tree/main/frontend/src/pages): `frontend/src/pages`
- [REST request hook](https://github.com/muhammedkusay/micro-air-vehicle-telemetry/blob/main/frontend/src/hooks/useApi.js): `frontend/src/hooks/useApi.js`
- [Live telemetry hook](https://github.com/muhammedkusay/micro-air-vehicle-telemetry/blob/main/frontend/src/hooks/useTelemetry.js): `frontend/src/hooks/useTelemetry.js`
- [Charts and maps](https://github.com/muhammedkusay/micro-air-vehicle-telemetry/tree/main/frontend/src/components): `frontend/src/components`

### External systems

- **ArduPilot SITL**
- **MySQL database**
- **OpenStreetMap tiles**

### Other components

- **Operator**

## Connections

- Operator → React routes: navigates
- ArduPilot SITL → MAVLink I/O: sends MAVLink
- Telemetry runner → MAVLink I/O: connects and receives
- Telemetry runner → Telemetry state: updates state
- Telemetry runner → WebSocket server: starts server
- Telemetry runner → History API client: creates flight; sends records
- History API client → Laravel API: posts history
- React routes → Live dashboard: routes
- React routes → Vehicle and flight pages: routes
- REST request hook → Laravel API: requests REST data
- Live telemetry hook → WebSocket server: receives live stream
- Live dashboard → Charts and maps: renders telemetry
- Vehicle and flight pages → Charts and maps: renders flight data
- Charts and maps → OpenStreetMap tiles: loads map tiles
- Laravel API → API routes: dispatches
- API routes → Vehicle controller: dispatches vehicle requests
- API routes → Flight controller: dispatches flight requests
- API routes → Telemetry controller: dispatches telemetry requests
- Vehicle controller → Vehicle model: queries
- Flight controller → Vehicle model: queries
- Flight controller → Flight model: queries and creates
- Telemetry controller → Telemetry model: queries and stores
- Vehicle model → MySQL database: reads and writes
- Flight model → MySQL database: reads and writes
- Telemetry model → MySQL database: reads and writes
