# mariusding/iotedgediscovery architecture

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

- Interactive diagram: https://gitdiagram.com/mariusding/iotedgediscovery
- Repository: https://github.com/mariusding/iotedgediscovery

## Overview

##### Main Components

a) Edge Layer:
- Following Edge Modules as separate containers:
- IotEdgeModule1 (handles virtual basket processing)
- IotEdgeModule2 (handles sensor data)
- VisionModule (handles computer vision processing)
- VisionModuleForARM (ARM-specific vision processing)

b) Frontend Layer:
- Blazor WebAssembly Client (IoTDashboard.Client)
- ASP.NET Core Server (IoTDashboard.Server)
- Shared Components (IoTDashboard.Shared)

c) Vision Processing Components:
- Computer Vision Models (model.pb)
- Vision Processing Pipeline
- Barcode/QR Scanner Services

##### Connection and Data Flow

- Module-to-module communication (Edge)
- Client-server communication (Blazor)
- Camera data flow
- Vision processing pipeline

##### Specific Elements

- ┌─ IoT Edge Device ──────────────────────┐
- ┌─ Edge Runtime ─────────────────┐    │
- IotEdgeModule1            │    │
- IotEdgeModule2            │    │
- VisionModule              │    │
- VisionModuleForARM        │    │
- ┘    │
- ┘

b) Web Application Layer:
- ┌─ Blazor Application ─────────────────┐
- WebAssembly Client              │
- ASP.NET Core Server            │
- Shared Components              │
- ┘

##### Specific Interactions

- Camera input flow to Vision Modules
- Vision processing pipeline (Barcode → QR → Product Recognition)
- Data flow to Virtual Basket (VirtualBasket.cs)
- Communication between Edge modules
- Client-server communication in Blazor app

##### Additional Details

Annotations for:
- Supported architectures (AMD64, ARM32v7, ARM64v8)
- Vision model specifications
- API endpoints
- Module configurations

## Diagram (Mermaid)

```mermaid
graph TB
    %% Styles
    classDef edge fill:#blue,stroke:#333,stroke-width:2px
    classDef vision fill:#90EE90,stroke:#333,stroke-width:2px
    classDef web fill:#FFA500,stroke:#333,stroke-width:2px
    classDef data fill:#DDA0DD,stroke:#333,stroke-width:2px
    classDef container fill:#f5f5f5,stroke:#333,stroke-width:2px

    %% Frontend Layer
    subgraph Frontend
        Client["Blazor WebAssembly Client"]:::web
        Server["ASP.NET Core Server"]:::web
        Shared["Shared Components"]:::web
        
        Client --> Server
        Server --> Shared
        Client --> Shared
    end

    %% Edge Layer
    subgraph EdgeDevice
        Runtime["IoT Edge Runtime"]:::edge
        Module1["IotEdgeModule1<br/>(Virtual Basket)"]:::edge
        Module2["IotEdgeModule2<br/>(Sensor Data)"]:::edge
        VisionMod["VisionModule"]:::vision
        VisionARM["VisionModuleForARM"]:::vision
        
        Runtime --> Module1
        Runtime --> Module2
        Runtime --> VisionMod
        Runtime --> VisionARM
    end

    %% Vision Processing Layer
    subgraph VisionProcessing
        CVModel["Computer Vision Model"]:::vision
        BarcodeScanner["Barcode Scanner"]:::vision
        QRScanner["QR Scanner"]:::vision
        VisionResponse["Vision Response Model"]:::vision
        
        BarcodeScanner --> VisionResponse
        QRScanner --> VisionResponse
        CVModel --> VisionResponse
    end

    %% Hardware Layer
    Cameras["Cameras/Sensors"]:::data

    %% Connections between layers
    Cameras --> VisionMod
    Cameras --> VisionARM
    VisionProcessing --> Module1
    Module2 --> Server
    Module1 --> Server

    %% Legend
    subgraph Legend
        L1["Edge Component"]:::edge
        L2["Vision Component"]:::vision
        L3["Web Component"]:::web
        L4["Data Flow"]:::data
    end

    %% Click events for component mapping
    click Runtime "https://github.com/mariusDing/IoTEdgeDiscovery/blob/main/AzureIotEdgeApp1/deployment.template.json"
    click Module1 "https://github.com/mariusDing/IoTEdgeDiscovery/blob/main/IotEdgeModule1/Model/VirtualBasket.cs"
    click Module2 "https://github.com/mariusDing/IoTEdgeDiscovery/blob/main/IotEdgeModule2/SensorModel.cs"
    click VisionMod "https://github.com/mariusDing/IoTEdgeDiscovery/blob/main/VisionModule/app/predict.py"
    click VisionARM "https://github.com/mariusDing/IoTEdgeDiscovery/blob/main/VisionModuleForARM/app/predict.py"
    click CVModel "https://github.com/mariusDing/IoTEdgeDiscovery/blob/main/VisionModule/app/model.pb"
    click Client "https://github.com/mariusDing/IoTEdgeDiscovery/tree/main/BlazorFrontEnd/IoTDashboard/IoTDashboard/Client"
    click Server "https://github.com/mariusDing/IoTEdgeDiscovery/tree/main/BlazorFrontEnd/IoTDashboard/IoTDashboard/Server"
    click Shared "https://github.com/mariusDing/IoTEdgeDiscovery/tree/main/BlazorFrontEnd/IoTDashboard/IoTDashboard/Shared"
    click VisionResponse "https://github.com/mariusDing/IoTEdgeDiscovery/blob/main/IotEdgeModule1/Model/VisionResponse.cs"
```
