# bxnxm/micros architecture

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

- Interactive diagram: https://gitdiagram.com/bxnxm/micros
- Repository: https://github.com/bxnxm/micros

## Overview

micrOS is a local-first automation runtime for Wi-Fi MicroPython boards, with DevToolKit as its desktop setup and management client. The main workflow is to deploy a node, configure it, connect over Wi-Fi, and invoke dynamically loaded Load Module behavior through the shell or web interface; schedules, interrupts, and background jobs provide additional execution paths. The graph also preserves hardware I/O, device-to-device communication, and USB/OTA updates. Some subsystem links are documented rather than visible in sampled implementation excerpts.

Main entry points: [`micrOS/source/modules`](https://github.com/bxnxm/micros/tree/master/micrOS/source/modules) (Load Modules), [`micrOS/source/Web.py`](https://github.com/bxnxm/micros/blob/master/micrOS/source/Web.py) (Web interface), [`micrOS/source/Server.py`](https://github.com/bxnxm/micros/blob/master/micrOS/source/Server.py) (Socket server), [`micrOS/source/micrOSloader.py`](https://github.com/bxnxm/micros/blob/master/micrOS/source/micrOSloader.py) (Boot loader)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_toolkit["DevToolKit"]
  node_tool["DevToolKit CLI/GUI<br/>[devToolKit.py]"]
  node_dev_manager["Device management<br/>[MicrOSDevEnv.py]"]
  node_socket_client["Socket client<br/>[socketClient.py]"]
  node_dashboard["Dashboard<br/>[micrOSdashboard.py]"]
end

subgraph group_runtime["Node runtime"]
  node_entry["Runtime entry<br/>[main.py]"]
  node_loader["Boot loader<br/>[micrOSloader.py]"]
  node_network["Network setup<br/>[Network.py]"]
  node_config[("Configuration<br/>[Config.py]")]
  node_files[("Node files<br/>[Files.py]")]
end

subgraph group_execution["Automation execution"]
  node_load_modules["Load Modules"]
  node_tasks["Async tasks<br/>[Tasks.py]"]
  node_scheduler["Scheduling<br/>[Scheduler.py]"]
  node_interrupts["Interrupt handlers<br/>[Interrupts.py]"]
  node_interconnect["Node interconnect<br/>[InterConnect.py]"]
end

subgraph group_interfaces["Client interfaces"]
  node_server["Socket server<br/>[Server.py]"]
  node_shell["Command shell<br/>[Shell.py]"]
  node_web["Web interface<br/>[Web.py]"]
  node_web_assets["Web applications"]
  node_auth["Authentication<br/>[Auth.py]"]
end

subgraph group_hardware["Hardware and connectivity"]
  node_io["Pin mapping<br/>[microIO.py]"]
  node_drivers["Board drivers"]
end

node_developer(("Developer"))
node_node(("MicroPython node"))
node_external_nodes(("Other nodes"))

node_developer -->|"uses"| node_tool
node_tool -->|"manages"| node_dev_manager
node_dev_manager -->|"deploys USB/OTA"| node_node
node_developer -->|"controls"| node_dashboard
node_dashboard -->|"sends commands"| node_socket_client
node_socket_client -.->|"connects over socket"| node_server
node_node -->|"boots"| node_entry
node_entry -->|"starts"| node_loader
node_loader -->|"initializes"| node_network
node_loader -->|"loads"| node_config
node_node -->|"serves clients"| node_server
node_server -->|"dispatches shell"| node_shell
node_server -->|"dispatches web"| node_web
node_web -->|"serves"| node_web_assets
node_web -.->|"authenticates"| node_auth
node_shell -->|"invokes"| node_load_modules
node_web -->|"invokes"| node_load_modules
node_scheduler -->|"invokes"| node_load_modules
node_interrupts -->|"invokes"| node_load_modules
node_tasks -->|"runs"| node_load_modules
node_load_modules -->|"maps pins"| node_io
node_io -.->|"selects board I/O"| node_drivers
node_load_modules -->|"uses device commands"| node_interconnect
node_interconnect -->|"communicates"| node_external_nodes
node_config -.->|"persists settings"| node_files

click node_tool "https://github.com/bxnxm/micros/blob/master/devToolKit.py"
click node_dev_manager "https://github.com/bxnxm/micros/blob/master/toolkit/MicrOSDevEnv.py"
click node_socket_client "https://github.com/bxnxm/micros/blob/master/toolkit/socketClient.py"
click node_dashboard "https://github.com/bxnxm/micros/blob/master/toolkit/micrOSdashboard.py"
click node_entry "https://github.com/bxnxm/micros/blob/master/micrOS/source/main.py"
click node_loader "https://github.com/bxnxm/micros/blob/master/micrOS/source/micrOSloader.py"
click node_network "https://github.com/bxnxm/micros/blob/master/micrOS/source/Network.py"
click node_config "https://github.com/bxnxm/micros/blob/master/micrOS/source/Config.py"
click node_files "https://github.com/bxnxm/micros/blob/master/micrOS/source/Files.py"
click node_server "https://github.com/bxnxm/micros/blob/master/micrOS/source/Server.py"
click node_shell "https://github.com/bxnxm/micros/blob/master/micrOS/source/Shell.py"
click node_web "https://github.com/bxnxm/micros/blob/master/micrOS/source/Web.py"
click node_web_assets "https://github.com/bxnxm/micros/tree/master/micrOS/source/web"
click node_auth "https://github.com/bxnxm/micros/blob/master/micrOS/source/Auth.py"
click node_load_modules "https://github.com/bxnxm/micros/tree/master/micrOS/source/modules"
click node_tasks "https://github.com/bxnxm/micros/blob/master/micrOS/source/Tasks.py"
click node_scheduler "https://github.com/bxnxm/micros/blob/master/micrOS/source/Scheduler.py"
click node_interrupts "https://github.com/bxnxm/micros/blob/master/micrOS/source/Interrupts.py"
click node_interconnect "https://github.com/bxnxm/micros/blob/master/micrOS/source/InterConnect.py"
click node_io "https://github.com/bxnxm/micros/blob/master/micrOS/source/microIO.py"
click node_drivers "https://github.com/bxnxm/micros/tree/master/micrOS/source/modules"

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_tool,node_dev_manager,node_socket_client,node_dashboard toneBlue
class node_entry,node_loader,node_network,node_config,node_files toneAmber
class node_load_modules,node_tasks,node_scheduler,node_interrupts,node_interconnect toneMint
class node_server,node_shell,node_web,node_web_assets,node_auth toneRose
class node_io,node_drivers,node_developer,node_node,node_external_nodes toneIndigo
```

## Components

### DevToolKit

- [DevToolKit CLI/GUI](https://github.com/bxnxm/micros/blob/master/devToolKit.py): `devToolKit.py`
- [Device management](https://github.com/bxnxm/micros/blob/master/toolkit/MicrOSDevEnv.py): `toolkit/MicrOSDevEnv.py`
- [Socket client](https://github.com/bxnxm/micros/blob/master/toolkit/socketClient.py): `toolkit/socketClient.py`
- [Dashboard](https://github.com/bxnxm/micros/blob/master/toolkit/micrOSdashboard.py): `toolkit/micrOSdashboard.py`

### Node runtime

- [Runtime entry](https://github.com/bxnxm/micros/blob/master/micrOS/source/main.py): `micrOS/source/main.py`
- [Boot loader](https://github.com/bxnxm/micros/blob/master/micrOS/source/micrOSloader.py): `micrOS/source/micrOSloader.py`
- [Network setup](https://github.com/bxnxm/micros/blob/master/micrOS/source/Network.py): `micrOS/source/Network.py`
- [Configuration](https://github.com/bxnxm/micros/blob/master/micrOS/source/Config.py): `micrOS/source/Config.py`
- [Node files](https://github.com/bxnxm/micros/blob/master/micrOS/source/Files.py): `micrOS/source/Files.py`

### Automation execution

- [Load Modules](https://github.com/bxnxm/micros/tree/master/micrOS/source/modules): `micrOS/source/modules`
- [Async tasks](https://github.com/bxnxm/micros/blob/master/micrOS/source/Tasks.py): `micrOS/source/Tasks.py`
- [Scheduling](https://github.com/bxnxm/micros/blob/master/micrOS/source/Scheduler.py): `micrOS/source/Scheduler.py`
- [Interrupt handlers](https://github.com/bxnxm/micros/blob/master/micrOS/source/Interrupts.py): `micrOS/source/Interrupts.py`
- [Node interconnect](https://github.com/bxnxm/micros/blob/master/micrOS/source/InterConnect.py): `micrOS/source/InterConnect.py`

### Client interfaces

- [Socket server](https://github.com/bxnxm/micros/blob/master/micrOS/source/Server.py): `micrOS/source/Server.py`
- [Command shell](https://github.com/bxnxm/micros/blob/master/micrOS/source/Shell.py): `micrOS/source/Shell.py`
- [Web interface](https://github.com/bxnxm/micros/blob/master/micrOS/source/Web.py): `micrOS/source/Web.py`
- [Web applications](https://github.com/bxnxm/micros/tree/master/micrOS/source/web): `micrOS/source/web`
- [Authentication](https://github.com/bxnxm/micros/blob/master/micrOS/source/Auth.py): `micrOS/source/Auth.py`

### Hardware and connectivity

- [Pin mapping](https://github.com/bxnxm/micros/blob/master/micrOS/source/microIO.py): `micrOS/source/microIO.py`
- [Board drivers](https://github.com/bxnxm/micros/tree/master/micrOS/source/modules): `micrOS/source/modules`

### Other components

- **Developer**
- **MicroPython node**
- **Other nodes**

## Connections

- Developer → DevToolKit CLI/GUI: uses (evidence: `README.md`)
- DevToolKit CLI/GUI → Device management: manages (evidence: `devToolKit.py`)
- Device management → MicroPython node: deploys USB/OTA (evidence: `README.md`)
- Developer → Dashboard: controls (evidence: `README.md`)
- Dashboard → Socket client: sends commands (evidence: `toolkit/micrOSdashboard.py`)
- Socket client → Socket server: connects over socket
- MicroPython node → Runtime entry: boots (evidence: `micrOS/source/main.py`)
- Runtime entry → Boot loader: starts (evidence: `micrOS/source/main.py`)
- Boot loader → Network setup: initializes (evidence: `micrOS/source/micrOSloader.py`)
- Boot loader → Configuration: loads (evidence: `micrOS/source/micrOSloader.py`)
- MicroPython node → Socket server: serves clients (evidence: `README.md`)
- Socket server → Command shell: dispatches shell (evidence: `micrOS/source/Server.py`)
- Socket server → Web interface: dispatches web (evidence: `micrOS/source/Server.py`)
- Web interface → Web applications: serves (evidence: `README.md`)
- Web interface → Authentication: authenticates
- Command shell → Load Modules: invokes (evidence: `README.md`)
- Web interface → Load Modules: invokes (evidence: `README.md`)
- Scheduling → Load Modules: invokes (evidence: `README.md`)
- Interrupt handlers → Load Modules: invokes (evidence: `README.md`)
- Async tasks → Load Modules: runs (evidence: `micrOS/source/Tasks.py`)
- Load Modules → Pin mapping: maps pins (evidence: `README.md`)
- Pin mapping → Board drivers: selects board I/O
- Load Modules → Node interconnect: uses device commands (evidence: `README.md`)
- Node interconnect → Other nodes: communicates (evidence: `README.md`)
- Configuration → Node files: persists settings (evidence: `micrOS/source/Config.py`)
