# hstellet/uavnet architecture

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

- Interactive diagram: https://gitdiagram.com/hstellet/uavnet
- Repository: https://github.com/hstellet/uavnet

## Overview

##### Project Type and Purpose
- The README indicates “UAVNET – Major Project” published in a journal, suggesting an advanced system for UAV/network integration, likely blending emerging technologies.
- The file tree shows at least three distinct sub-projects:
- The “Major-Blockchain” directory hosting blockchain migrations, smart contract artifacts (JSON ABIs), and a truffle configuration. This implies a blockchain component providing secure, decentralized operations (perhaps for UAV data transactions or trust management).
- The “MyApplication2” directory is an Android application source with activity files, UI layouts, and a typical Android project structure – this likely serves as a mobile client or control interface.
- The “mysite” directory is a Django project (evidenced by manage.py, apps, templates, and configurations) likely serving as a web-based dashboard or API layer, enabling integration with other services and possibly providing a front end for management or visualization.

##### File Structure and Architectural Choices
- The “Major-Blockchain” folder includes smart contract migrations and ABIs, suggesting an Ethereum-like blockchain setup. Component breakdown here should include:
- Smart contracts (the logic for data, registration, path finding, etc.)
- Blockchain migration scripts (initial deployment and subsequent updates)
- A client library under “src” for front-end integration with the blockchain.
- “MyApplication2” reveals an Android mobile client architecture that will likely interact with the blockchain and/or the Django backend using APIs.
- “mysite” (Django) provides a web server and possibly an API endpoint. It may serve to interact with the blockchain or manage data coming from the UAV network. The presence of a SQLite database suggests lightweight data persistence, perhaps for logging, simulation results, or user data.

##### Specific Elements
- From the Android app to the Django server for control commands and status data.
- From the Django server to the blockchain for transaction operations.
- Optionally, any direct communication from the mobile client to the blockchain if applicable.
- Rectangles for software components (apps, servers, contracts),
- You include any middleware or API gateways if they exist (or note that the Django server might serve that role).
- Deployment context where relevant—like containerization or separate hardware if known.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Blockchain Component
    subgraph "Blockchain Component"
        BC["Major-Blockchain"]:::blockchain
        B1["Smart Contracts"]:::blockchainDetail
        B2["Migration Scripts"]:::blockchainDetail
        B3["Client API (ABIs)"]:::blockchainDetail
        BC --> B1
        BC --> B2
        BC --> B3
    end

    %% Mobile Client (Android App)
    subgraph "Mobile Client (Android App)"
        MA["MyApplication2"]:::mobile
        M1["MainActivity.java"]:::mobileDetail
        M2["JoyStickClass.java"]:::mobileDetail
        M3["SendMessage.java"]:::mobileDetail
        MA --> M1
        MA --> M2
        MA --> M3
    end

    %% Web Server / Backend (Django)
    subgraph "Web Server / Backend (Django)"
        DS["mysite"]:::django
        D1["Django Server"]:::djangoDetail
        D2["SQLite Database"]:::database
        DS --> D1
        DS --> D2
    end

    %% Interactions
    MA -->|"sends_commands"| D1
    D1 -->|"invokes_contract"| BC
    MA -.->|"direct_call?"| BC

    %% Click Events
    click BC "https://github.com/hstellet/uavnet/tree/master/Major-Blockchain"
    click MA "https://github.com/hstellet/uavnet/tree/master/MyApplication2/app/src/main/java/com/example/myapplication"
    click DS "https://github.com/hstellet/uavnet/tree/master/mysite"

    %% Styles
    classDef blockchain fill:#f9d5e5,stroke:#f06595,stroke-width:2px;
    classDef blockchainDetail fill:#ffe0f0,stroke:#f06595,stroke-width:1px;
    classDef mobile fill:#bde0fe,stroke:#0077b6,stroke-width:2px;
    classDef mobileDetail fill:#e0f7ff,stroke:#0077b6,stroke-width:1px;
    classDef django fill:#caffbf,stroke:#2b9348,stroke-width:2px;
    classDef djangoDetail fill:#e6fffa,stroke:#2b9348,stroke-width:1px;
    classDef database fill:#fff3b0,stroke:#f4d35e,stroke-width:2px;
```
