# arkar-myintmyat/sodtwaredevopsgpproject architecture

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

- Interactive diagram: https://gitdiagram.com/arkar-myintmyat/sodtwaredevopsgpproject
- Repository: https://github.com/arkar-myintmyat/sodtwaredevopsgpproject

## Overview

This repository is a simulated telemetry system that modernizes the gateway-to-cloud link while preserving an unmodifiable legacy device hop. A device samples sensors, formats and encrypts a reading, and sends it to the gateway; the gateway validates and parses frames, checks sequence numbers, then forwards readings through either the operator-selected legacy uplink or the ML-KEM channel. The cloud establishes sessions, accepts and stores readings, and serves health, read APIs, and a live dashboard. The graph reflects README-described HTTP links where source excerpts do not show transport details; unsampled internals are not inferred.

Main entry points: [`edge_gateway/gateway.py`](https://github.com/arkar-myintmyat/sodtwaredevopsgpproject/blob/main/edge_gateway/gateway.py) (TCP frame listener), [`cloud_service/app.py`](https://github.com/arkar-myintmyat/sodtwaredevopsgpproject/blob/main/cloud_service/app.py) (Read APIs), [`pqc_channel/channel.py`](https://github.com/arkar-myintmyat/sodtwaredevopsgpproject/blob/main/pqc_channel/channel.py) (Channel cryptography), [`legacy_device/protocol.py`](https://github.com/arkar-myintmyat/sodtwaredevopsgpproject/blob/main/legacy_device/protocol.py) (Frame generation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_device["Legacy device"]
  node_sensor["Sensor simulator<br/>[device.py]"]
  node_deviceframe["Frame generation<br/>[protocol.py]"]
end

subgraph group_gateway["Edge gateway"]
  node_gatewaylistener["TCP frame listener<br/>[gateway.py]"]
  node_frameparse["Frame validation<br/>[protocol.py]"]
  node_replay["Replay tracking<br/>[gateway.py]"]
  node_legacyuplink["Legacy uplink<br/>[gateway.py]"]
  node_pqquplink["PQC uplink<br/>[gateway.py]"]
end

subgraph group_secure["Secure uplink"]
  node_channelcrypto["Channel cryptography<br/>[channel.py]"]
  node_session["Session handshake<br/>[app.py]"]
end

subgraph group_cloud["Cloud service"]
  node_cloudkeys["Cloud key management<br/>[app.py]"]
  node_sealedingest["Sealed ingest<br/>[app.py]"]
  node_legacyingest["Legacy ingest<br/>[app.py]"]
  node_readingstore[("Reading store<br/>[app.py]")]
  node_readapi["Read APIs<br/>[app.py]"]
  node_dashboard["Live dashboard<br/>[dashboard.html]"]
end

node_operator(("Operator / viewer"))

node_sensor -->|"formats and encrypts"| node_deviceframe
node_deviceframe -->|"sends TCP frames"| node_gatewaylistener
node_gatewaylistener -->|"decrypts and parses"| node_frameparse
node_gatewaylistener -->|"checks sequences"| node_replay
node_gatewaylistener -->|"dispatches readings"| node_legacyuplink
node_gatewaylistener -->|"dispatches readings"| node_pqquplink
node_legacyuplink -->|"posts readings"| node_legacyingest
node_pqquplink -->|"fetches public key"| node_cloudkeys
node_pqquplink -->|"uses crypto"| node_channelcrypto
node_pqquplink -->|"opens sessions"| node_session
node_pqquplink -->|"posts sealed readings"| node_sealedingest
node_cloudkeys -->|"fingerprints key"| node_channelcrypto
node_session -->|"derives session keys"| node_channelcrypto
node_legacyingest -->|"stores readings"| node_readingstore
node_sealedingest -->|"stores readings"| node_readingstore
node_readapi -->|"reads readings"| node_readingstore
node_operator -->|"requests readings"| node_readapi
node_operator -->|"views dashboard"| node_dashboard
node_dashboard -->|"refreshes via APIs"| node_readapi

click node_sensor "https://github.com/arkar-myintmyat/sodtwaredevopsgpproject/blob/main/legacy_device/device.py"
click node_deviceframe "https://github.com/arkar-myintmyat/sodtwaredevopsgpproject/blob/main/legacy_device/protocol.py"
click node_gatewaylistener "https://github.com/arkar-myintmyat/sodtwaredevopsgpproject/blob/main/edge_gateway/gateway.py"
click node_frameparse "https://github.com/arkar-myintmyat/sodtwaredevopsgpproject/blob/main/legacy_device/protocol.py"
click node_replay "https://github.com/arkar-myintmyat/sodtwaredevopsgpproject/blob/main/edge_gateway/gateway.py"
click node_legacyuplink "https://github.com/arkar-myintmyat/sodtwaredevopsgpproject/blob/main/edge_gateway/gateway.py"
click node_pqquplink "https://github.com/arkar-myintmyat/sodtwaredevopsgpproject/blob/main/edge_gateway/gateway.py"
click node_channelcrypto "https://github.com/arkar-myintmyat/sodtwaredevopsgpproject/blob/main/pqc_channel/channel.py"
click node_cloudkeys "https://github.com/arkar-myintmyat/sodtwaredevopsgpproject/blob/main/cloud_service/app.py"
click node_session "https://github.com/arkar-myintmyat/sodtwaredevopsgpproject/blob/main/cloud_service/app.py"
click node_sealedingest "https://github.com/arkar-myintmyat/sodtwaredevopsgpproject/blob/main/cloud_service/app.py"
click node_legacyingest "https://github.com/arkar-myintmyat/sodtwaredevopsgpproject/blob/main/cloud_service/app.py"
click node_readingstore "https://github.com/arkar-myintmyat/sodtwaredevopsgpproject/blob/main/cloud_service/app.py"
click node_readapi "https://github.com/arkar-myintmyat/sodtwaredevopsgpproject/blob/main/cloud_service/app.py"
click node_dashboard "https://github.com/arkar-myintmyat/sodtwaredevopsgpproject/blob/main/cloud_service/static/dashboard.html"

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_sensor,node_deviceframe,node_operator toneBlue
class node_gatewaylistener,node_frameparse,node_replay,node_legacyuplink,node_pqquplink toneAmber
class node_channelcrypto,node_session toneMint
class node_cloudkeys,node_sealedingest,node_legacyingest,node_readingstore,node_readapi,node_dashboard toneRose
```

## Components

### Legacy device

- [Sensor simulator](https://github.com/arkar-myintmyat/sodtwaredevopsgpproject/blob/main/legacy_device/device.py): `legacy_device/device.py`
- [Frame generation](https://github.com/arkar-myintmyat/sodtwaredevopsgpproject/blob/main/legacy_device/protocol.py): `legacy_device/protocol.py`

### Edge gateway

- [TCP frame listener](https://github.com/arkar-myintmyat/sodtwaredevopsgpproject/blob/main/edge_gateway/gateway.py): `edge_gateway/gateway.py`
- [Frame validation](https://github.com/arkar-myintmyat/sodtwaredevopsgpproject/blob/main/legacy_device/protocol.py): `legacy_device/protocol.py`
- [Replay tracking](https://github.com/arkar-myintmyat/sodtwaredevopsgpproject/blob/main/edge_gateway/gateway.py): `edge_gateway/gateway.py`
- [Legacy uplink](https://github.com/arkar-myintmyat/sodtwaredevopsgpproject/blob/main/edge_gateway/gateway.py): `edge_gateway/gateway.py`
- [PQC uplink](https://github.com/arkar-myintmyat/sodtwaredevopsgpproject/blob/main/edge_gateway/gateway.py): `edge_gateway/gateway.py`

### Secure uplink

- [Channel cryptography](https://github.com/arkar-myintmyat/sodtwaredevopsgpproject/blob/main/pqc_channel/channel.py): `pqc_channel/channel.py`
- [Session handshake](https://github.com/arkar-myintmyat/sodtwaredevopsgpproject/blob/main/cloud_service/app.py): `cloud_service/app.py`

### Cloud service

- [Cloud key management](https://github.com/arkar-myintmyat/sodtwaredevopsgpproject/blob/main/cloud_service/app.py): `cloud_service/app.py`
- [Sealed ingest](https://github.com/arkar-myintmyat/sodtwaredevopsgpproject/blob/main/cloud_service/app.py): `cloud_service/app.py`
- [Legacy ingest](https://github.com/arkar-myintmyat/sodtwaredevopsgpproject/blob/main/cloud_service/app.py): `cloud_service/app.py`
- [Reading store](https://github.com/arkar-myintmyat/sodtwaredevopsgpproject/blob/main/cloud_service/app.py): `cloud_service/app.py`
- [Read APIs](https://github.com/arkar-myintmyat/sodtwaredevopsgpproject/blob/main/cloud_service/app.py): `cloud_service/app.py`
- [Live dashboard](https://github.com/arkar-myintmyat/sodtwaredevopsgpproject/blob/main/cloud_service/static/dashboard.html): `cloud_service/static/dashboard.html`

### Other components

- **Operator / viewer**

## Connections

- Sensor simulator → Frame generation: formats and encrypts (evidence: `legacy_device/device.py`)
- Frame generation → TCP frame listener: sends TCP frames (evidence: `README.md`)
- TCP frame listener → Frame validation: decrypts and parses (evidence: `edge_gateway/gateway.py`)
- TCP frame listener → Replay tracking: checks sequences (evidence: `edge_gateway/gateway.py`)
- TCP frame listener → Legacy uplink: dispatches readings (evidence: `edge_gateway/gateway.py`)
- TCP frame listener → PQC uplink: dispatches readings (evidence: `edge_gateway/gateway.py`)
- Legacy uplink → Legacy ingest: posts readings (evidence: `edge_gateway/gateway.py`)
- PQC uplink → Cloud key management: fetches public key (evidence: `edge_gateway/gateway.py`)
- PQC uplink → Channel cryptography: uses crypto (evidence: `edge_gateway/gateway.py`)
- PQC uplink → Session handshake: opens sessions (evidence: `edge_gateway/gateway.py`)
- PQC uplink → Sealed ingest: posts sealed readings (evidence: `README.md`)
- Cloud key management → Channel cryptography: fingerprints key (evidence: `cloud_service/app.py`)
- Session handshake → Channel cryptography: derives session keys (evidence: `README.md`)
- Legacy ingest → Reading store: stores readings (evidence: `cloud_service/app.py`)
- Sealed ingest → Reading store: stores readings (evidence: `cloud_service/app.py`)
- Read APIs → Reading store: reads readings (evidence: `cloud_service/app.py`)
- Operator / viewer → Read APIs: requests readings (evidence: `README.md`)
- Operator / viewer → Live dashboard: views dashboard (evidence: `README.md`)
- Live dashboard → Read APIs: refreshes via APIs (evidence: `cloud_service/app.py`)
