# ardupilot/webtools architecture

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

- Interactive diagram: https://gitdiagram.com/ardupilot/webtools
- Repository: https://github.com/ardupilot/webtools

## Overview

##### Main Components
- Web Server/Static Hosting Environment: This serves all the static files (HTML, JS, CSS) and is the entry point for users.
- Individual Tools/Applications: Each tool (e.g., AnalyticTune, FilterReview, GeofenceGenerator, TelemetryDashboard, etc.) is essentially an independent client-side application, each with its own dedicated HTML file, main JavaScript file(s), and configuration (such as the params.json files).
- Shared Libraries: Represent the Libraries folder that provides common utilities (for math operations, file saving, logging, parameter handling, etc.) which are used across multiple tools.
- Modules: Display the modules folder and its subdirectories as external or third-party dependencies (e.g., JsDataflashParser, luxon, matrix, tabulator) that are used by the tools to handle more complex functionality such as parsing, date management, plotting, or user interface enhancements.
- External Integration Components: For example, the TelemetryDashboard is more complex—it includes integrations such as MAVLink (with its own submodules that handle message packing/unpacking) and widget systems supporting real-time telemetry display. This tool could be illustrated as interfacing with both in-built shared modules and additional external libraries (like TippyJS for tooltips).

##### Relationships and Interactions
- Data/configuration layering: Show that many tools load a params.json file for configuration, illustrating a pattern where each tool reads its own configuration.
- TelemetryDashboard Specifics: Highlight that this tool has additional interactions—its structure includes separate areas for widgets, examples, and a dedicated MAVLink integration layer (with local modules handling low-level message functionalities).

##### Architectural Patterns and Design Principles
- Modularity: Emphasize that the repository is structured into many self-contained, modular tools. Each tool can be developed, updated, or deployed independently.
- Reusability: The presence of shared libraries and modules underlines a design choice to reuse code across different tools.
- Client-side Single-Page Components: Since all tools are JavaScript/HTML based, they adhere to client-side patterns (though not a full SPA framework, they share the pattern of a central index.html entry point for navigation).

##### Technologies
- Core Technologies: HTML, CSS, and JavaScript.
- Development Tools: VSCode launch configurations suggest debugging is done with Chrome/Edge, which reinforces the client-side nature.
- Third-Party Libraries: Identify libraries like Plotly (for graphing), Luxon (for date/time management), and others such as TippyJS. Also, mention the custom modules for handling MavLink in TelemetryDashboard.

## Diagram (Mermaid)

```mermaid
flowchart TD 
    WS["Static Web Server"]:::server
    CB["Client Browser"]:::browser
    WS -->|"serves"| CB

    subgraph "Individual Tools"
        AT["AnalyticTune"]:::tool
        FR["FilterReview"]:::tool
        FT["FilterTool"]:::tool
        GG["GeofenceGenerator"]:::tool
        HR["HardwareReport"]:::tool
        KT["KinematicTool"]:::tool
        LF["LogFinder"]:::tool
        MF["MAGFit"]:::tool
        PR["PIDReview"]:::tool
        RC["RotationCheck"]:::tool
        SS["StreamStats"]:::tool
        SI["SysID"]:::tool
        TD["TelemetryDashboard"]:::tool
        TE["ThrustExpo"]:::tool
    end

    G["All Tools"]:::tool
    AT --> G
    FR --> G
    FT --> G
    GG --> G
    HR --> G
    KT --> G
    LF --> G
    MF --> G
    PR --> G
    RC --> G
    SS --> G
    SI --> G
    TD --> G
    TE --> G

    SL["Shared Libraries"]:::lib
    MOD["Modules"]:::mod

    G -->|"dependsOn"| SL
    G -->|"dependsOn"| MOD

    TD -->|"integratesWith"| TD_M["MAVLink Integration"]:::integration
    TD -->|"integratesWith"| TD_W["Widget System"]:::integration

    TD_M -->|"uses"| MOD
    TD_W -->|"uses"| MOD

    click WS "https://github.com/ardupilot/webtools/blob/main/index.html"
    click WS "https://github.com/ardupilot/webtools/blob/main/Dev/index.html"

    click AT "https://github.com/ardupilot/webtools/tree/main/AnalyticTune/"
    click FR "https://github.com/ardupilot/webtools/tree/main/FilterReview/"
    click FT "https://github.com/ardupilot/webtools/tree/main/FilterTool/"
    click GG "https://github.com/ardupilot/webtools/tree/main/GeofenceGenerator/"
    click HR "https://github.com/ardupilot/webtools/tree/main/HardwareReport/"
    click KT "https://github.com/ardupilot/webtools/tree/main/KinematicTool/"
    click LF "https://github.com/ardupilot/webtools/tree/main/LogFinder/"
    click MF "https://github.com/ardupilot/webtools/tree/main/MAGFit/"
    click PR "https://github.com/ardupilot/webtools/tree/main/PIDReview/"
    click RC "https://github.com/ardupilot/webtools/tree/main/RotationCheck/"
    click SS "https://github.com/ardupilot/webtools/tree/main/StreamStats/"
    click SI "https://github.com/ardupilot/webtools/tree/main/SysID/"
    click TD "https://github.com/ardupilot/webtools/tree/main/TelemetryDashboard/"
    click TE "https://github.com/ardupilot/webtools/tree/main/ThrustExpo/"

    click SL "https://github.com/ardupilot/webtools/tree/main/Libraries/"
    click MOD "https://github.com/ardupilot/webtools/tree/main/modules/"

    click TD_M "https://github.com/ardupilot/webtools/tree/main/TelemetryDashboard/MAVLink/"
    click TD_W "https://github.com/ardupilot/webtools/tree/main/TelemetryDashboard/Widgets/"

    classDef server fill:#FFCC00,stroke:#333,stroke-width:2px;
    classDef browser fill:#FFEFD5,stroke:#333,stroke-width:2px;
    classDef tool fill:#CCFFCC,stroke:#333,stroke-width:2px;
    classDef lib fill:#CCE5FF,stroke:#333,stroke-width:2px;
    classDef mod fill:#D1C4E9,stroke:#333,stroke-width:2px;
    classDef integration fill:#FFB3B3,stroke:#333,stroke-width:2px;
```
