# phodal/iot architecture

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

- Interactive diagram: https://gitdiagram.com/phodal/iot
- Repository: https://github.com/phodal/iot

## Overview

This repository is a learning-oriented minimum IoT system: a user or device reads and updates IoT state through a REST API, while Python examples connect that state to serial hardware and Raspberry Pi GPIO. The README also identifies Android and a Dashing dashboard as client capabilities. The REST, Android, dashboard, and Arduino implementation details are not sampled here; their links reflect README documentation, while source-backed calls cite the Python files.

Main entry points: [`rest`](https://github.com/phodal/iot/tree/master/rest) (REST API), [`python/iot.py`](https://github.com/phodal/iot/blob/master/python/iot.py) (Serial controller), [`python/raspberrypi.py`](https://github.com/phodal/iot/blob/master/python/raspberrypi.py) (Pi controller), [`python/get.py`](https://github.com/phodal/iot/blob/master/python/get.py) (GET example)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_hardware["Hardware"]
  node_arduino["Arduino board"]
end

subgraph group_device["Device scripts"]
  node_get["GET example<br/>[get.py]"]
  node_post["PUT example<br/>[post.py]"]
  node_iot["Serial controller<br/>[iot.py]"]
  node_raspi["Pi controller<br/>[raspberrypi.py]"]
end

subgraph group_service["REST service"]
  node_api["REST API"]
end

subgraph group_clients["User interfaces"]
  node_dashboard["Dashboard"]
  node_android["Android app"]
end

node_user(("Operator"))

node_user -->|"runs example"| node_get
node_user -->|"updates state"| node_post
node_get -->|"GETs state"| node_api
node_post -->|"PUTs state"| node_api
node_raspi -->|"reads state"| node_api
node_iot -->|"reads state"| node_api
node_raspi -->|"writes serial"| node_arduino
node_iot -->|"writes serial"| node_arduino
node_user -->|"views dashboard"| node_dashboard
node_user -->|"uses app"| node_android
node_dashboard -.->|"visualizes state"| node_api
node_android -.->|"communicates"| node_api

click node_arduino "https://github.com/phodal/iot/tree/master/hardware/arduino"
click node_get "https://github.com/phodal/iot/blob/master/python/get.py"
click node_post "https://github.com/phodal/iot/blob/master/python/post.py"
click node_iot "https://github.com/phodal/iot/blob/master/python/iot.py"
click node_raspi "https://github.com/phodal/iot/blob/master/python/raspberrypi.py"
click node_api "https://github.com/phodal/iot/tree/master/rest"
click node_dashboard "https://github.com/phodal/iot/tree/master/dashboard"
click node_android "https://github.com/phodal/iot/tree/master/android"

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_arduino toneBlue
class node_get,node_post,node_iot,node_raspi toneAmber
class node_api toneMint
class node_dashboard,node_android toneRose
class node_user toneIndigo
```

## Components

### Hardware

- [Arduino board](https://github.com/phodal/iot/tree/master/hardware/arduino): `hardware/arduino`

### Device scripts

- [GET example](https://github.com/phodal/iot/blob/master/python/get.py): `python/get.py`
- [PUT example](https://github.com/phodal/iot/blob/master/python/post.py): `python/post.py`
- [Serial controller](https://github.com/phodal/iot/blob/master/python/iot.py): `python/iot.py`
- [Pi controller](https://github.com/phodal/iot/blob/master/python/raspberrypi.py): `python/raspberrypi.py`

### REST service

- [REST API](https://github.com/phodal/iot/tree/master/rest): `rest`

### User interfaces

- [Dashboard](https://github.com/phodal/iot/tree/master/dashboard): `dashboard`
- [Android app](https://github.com/phodal/iot/tree/master/android): `android`

### Other components

- **Operator**

## Connections

- Operator → GET example: runs example (evidence: `README.md`)
- Operator → PUT example: updates state (evidence: `README.md`)
- GET example → REST API: GETs state (evidence: `python/get.py`)
- PUT example → REST API: PUTs state (evidence: `python/post.py`)
- Pi controller → REST API: reads state (evidence: `python/raspberrypi.py`)
- Serial controller → REST API: reads state (evidence: `python/iot.py`)
- Pi controller → Arduino board: writes serial (evidence: `python/raspberrypi.py`)
- Serial controller → Arduino board: writes serial (evidence: `python/iot.py`)
- Operator → Dashboard: views dashboard (evidence: `README.md`)
- Operator → Android app: uses app (evidence: `README.md`)
- Dashboard → REST API: visualizes state
- Android app → REST API: communicates
