# 78/micropixel architecture

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

- Interactive diagram: https://gitdiagram.com/78/micropixel
- Repository: https://github.com/78/micropixel

## Overview

MicroPixel is an embedded WebAssembly app platform: developers use the C++ SDK to build and run apps, while firmware hosts isolated Guests, provides system UI, and adapts app capabilities to board hardware. The graph follows that user-to-device workflow and retains the major graphics, storage, audio, and board-support branches documented or visible in the supplied evidence. Some firmware routing is not shown in the excerpts; those relationships are marked unverified rather than asserted as source-verified calls.

Main entry points: [`guest/sdk/application.hpp`](https://github.com/78/micropixel/blob/main/guest/sdk/application.hpp) (C++ app SDK), [`guest/runtime/application.cpp`](https://github.com/78/micropixel/blob/main/guest/runtime/application.cpp) (Guest application runtime), [`firmware/espressif/main/firmware_app.cpp`](https://github.com/78/micropixel/blob/main/firmware/espressif/main/firmware_app.cpp) (Firmware app lifecycle), [`firmware/espressif/main/runtime/services/storage_service.cpp`](https://github.com/78/micropixel/blob/main/firmware/espressif/main/runtime/services/storage_service.cpp) (App storage service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_dev["App development"]
  node_manager["SDK manager"]
  node_sdk["C++ app SDK<br/>[application.hpp]"]
  node_app["Guest app<br/>[storage_demo.cpp]"]
end

subgraph group_guest["Guest runtime"]
  node_abi["Guest ABI<br/>[micropixel_abi.h]"]
  node_guestapp["Guest application runtime<br/>[application.cpp]"]
  node_binding["Service binding"]
  node_gueststorage["Guest storage API<br/>[storage.cpp]"]
end

subgraph group_host["Host services"]
  node_firmware["Firmware app lifecycle<br/>[firmware_app.cpp]"]
  node_registry["Device registry"]
  node_storage_service["App storage service"]
  node_blockstore["Block storage<br/>[block_storage.hpp]"]
end

subgraph group_display["Graphics and display"]
  node_graphics_contract["Graphics contract<br/>[graphics.hpp]"]
  node_graphics_engine["Guest graphics engine"]
  node_display_pipeline["Display pipeline contract"]
end

subgraph group_hardware["Board hardware"]
  node_audio_engine["Audio engine<br/>[audio_engine.cpp]"]
  node_board["Board implementations"]
  node_nand["SPI NAND storage"]
end

node_developer(("App developer"))
node_device(("Microcontroller device"))

node_developer -->|"uses CLI"| node_manager
node_manager -->|"runs app"| node_app
node_developer -->|"uses SDK"| node_sdk
node_app -.->|"uses APIs"| node_sdk
node_sdk -->|"runs handler"| node_guestapp
node_guestapp -->|"calls services"| node_binding
node_sdk -.->|"defines service interface"| node_abi
node_gueststorage -->|"calls service"| node_binding
node_binding -->|"encodes requests"| node_abi
node_firmware -.->|"hosts isolated app"| node_guestapp
node_firmware -.->|"uses device registry"| node_registry
node_gueststorage -.->|"requests storage"| node_storage_service
node_storage_service -.->|"implements service protocol"| node_abi
node_storage_service -.->|"uses storage capability"| node_blockstore
node_blockstore -.->|"implemented by"| node_nand
node_guestapp -.->|"requests graphics"| node_graphics_contract
node_graphics_engine -->|"implements contract"| node_graphics_contract
node_graphics_engine -.->|"presents frames"| node_display_pipeline
node_display_pipeline -.->|"board-specific transport"| node_board
node_audio_engine -->|"uses audio sink"| node_board
node_board -.->|"drives hardware"| node_device
node_firmware -->|"manages hardware"| node_device

click node_manager "https://github.com/78/micropixel/blob/main/tools/manager/micropixel_manager.py"
click node_sdk "https://github.com/78/micropixel/blob/main/guest/sdk/application.hpp"
click node_app "https://github.com/78/micropixel/blob/main/guest/apps/sdk-demo/pages/storage_demo.cpp"
click node_abi "https://github.com/78/micropixel/blob/main/guest/abi/micropixel_abi.h"
click node_guestapp "https://github.com/78/micropixel/blob/main/guest/runtime/application.cpp"
click node_binding "https://github.com/78/micropixel/blob/main/guest/runtime/service_binding.hpp"
click node_gueststorage "https://github.com/78/micropixel/blob/main/guest/runtime/storage.cpp"
click node_firmware "https://github.com/78/micropixel/blob/main/firmware/espressif/main/firmware_app.cpp"
click node_registry "https://github.com/78/micropixel/blob/main/firmware/espressif/main/device/device_registry.cpp"
click node_storage_service "https://github.com/78/micropixel/blob/main/firmware/espressif/main/runtime/services/storage_service.cpp"
click node_blockstore "https://github.com/78/micropixel/blob/main/firmware/espressif/main/device/contracts/block_storage.hpp"
click node_graphics_contract "https://github.com/78/micropixel/blob/main/firmware/espressif/main/device/contracts/graphics.hpp"
click node_graphics_engine "https://github.com/78/micropixel/blob/main/firmware/espressif/main/platform/lvgl/guest_graphics_engine.cpp"
click node_display_pipeline "https://github.com/78/micropixel/blob/main/firmware/espressif/main/platform/lvgl/display/display_pipeline.hpp"
click node_audio_engine "https://github.com/78/micropixel/blob/main/firmware/espressif/main/platform/audio/audio_engine.cpp"
click node_board "https://github.com/78/micropixel/tree/main/firmware/espressif/main/platform/boards"
click node_nand "https://github.com/78/micropixel/blob/main/firmware/espressif/main/platform/storage/spi_nand_block_storage.cpp"

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_manager,node_sdk,node_app toneBlue
class node_abi,node_guestapp,node_binding,node_gueststorage toneAmber
class node_firmware,node_registry,node_storage_service,node_blockstore toneMint
class node_graphics_contract,node_graphics_engine,node_display_pipeline toneRose
class node_audio_engine,node_board,node_nand,node_developer,node_device toneIndigo
```

## Components

### App development

- [SDK manager](https://github.com/78/micropixel/blob/main/tools/manager/micropixel_manager.py): `tools/manager/micropixel_manager.py`
- [C++ app SDK](https://github.com/78/micropixel/blob/main/guest/sdk/application.hpp): `guest/sdk/application.hpp`
- [Guest app](https://github.com/78/micropixel/blob/main/guest/apps/sdk-demo/pages/storage_demo.cpp): `guest/apps/sdk-demo/pages/storage_demo.cpp`

### Guest runtime

- [Guest ABI](https://github.com/78/micropixel/blob/main/guest/abi/micropixel_abi.h): `guest/abi/micropixel_abi.h`
- [Guest application runtime](https://github.com/78/micropixel/blob/main/guest/runtime/application.cpp): `guest/runtime/application.cpp`
- [Service binding](https://github.com/78/micropixel/blob/main/guest/runtime/service_binding.hpp): `guest/runtime/service_binding.hpp`
- [Guest storage API](https://github.com/78/micropixel/blob/main/guest/runtime/storage.cpp): `guest/runtime/storage.cpp`

### Host services

- [Firmware app lifecycle](https://github.com/78/micropixel/blob/main/firmware/espressif/main/firmware_app.cpp): `firmware/espressif/main/firmware_app.cpp`
- [Device registry](https://github.com/78/micropixel/blob/main/firmware/espressif/main/device/device_registry.cpp): `firmware/espressif/main/device/device_registry.cpp`
- [App storage service](https://github.com/78/micropixel/blob/main/firmware/espressif/main/runtime/services/storage_service.cpp): `firmware/espressif/main/runtime/services/storage_service.cpp`
- [Block storage](https://github.com/78/micropixel/blob/main/firmware/espressif/main/device/contracts/block_storage.hpp): `firmware/espressif/main/device/contracts/block_storage.hpp`

### Graphics and display

- [Graphics contract](https://github.com/78/micropixel/blob/main/firmware/espressif/main/device/contracts/graphics.hpp): `firmware/espressif/main/device/contracts/graphics.hpp`
- [Guest graphics engine](https://github.com/78/micropixel/blob/main/firmware/espressif/main/platform/lvgl/guest_graphics_engine.cpp): `firmware/espressif/main/platform/lvgl/guest_graphics_engine.cpp`
- [Display pipeline contract](https://github.com/78/micropixel/blob/main/firmware/espressif/main/platform/lvgl/display/display_pipeline.hpp): `firmware/espressif/main/platform/lvgl/display/display_pipeline.hpp`

### Board hardware

- [Audio engine](https://github.com/78/micropixel/blob/main/firmware/espressif/main/platform/audio/audio_engine.cpp): `firmware/espressif/main/platform/audio/audio_engine.cpp`
- [Board implementations](https://github.com/78/micropixel/tree/main/firmware/espressif/main/platform/boards): `firmware/espressif/main/platform/boards`
- [SPI NAND storage](https://github.com/78/micropixel/blob/main/firmware/espressif/main/platform/storage/spi_nand_block_storage.cpp): `firmware/espressif/main/platform/storage/spi_nand_block_storage.cpp`

### Other components

- **App developer**
- **Microcontroller device**

## Connections

- App developer → SDK manager: uses CLI (evidence: `README.md`)
- SDK manager → Guest app: runs app (evidence: `README.md`)
- App developer → C++ app SDK: uses SDK (evidence: `README.md`)
- Guest app → C++ app SDK: uses APIs
- C++ app SDK → Guest application runtime: runs handler (evidence: `guest/runtime/application.cpp`)
- Guest application runtime → Service binding: calls services (evidence: `guest/runtime/application.cpp`)
- C++ app SDK → Guest ABI: defines service interface
- Guest storage API → Service binding: calls service (evidence: `guest/runtime/storage.cpp`)
- Service binding → Guest ABI: encodes requests (evidence: `guest/runtime/service_binding.hpp`)
- Firmware app lifecycle → Guest application runtime: hosts isolated app (evidence: `README.md`)
- Firmware app lifecycle → Device registry: uses device registry
- Guest storage API → App storage service: requests storage
- App storage service → Guest ABI: implements service protocol (evidence: `firmware/espressif/main/runtime/services/storage_service.cpp`)
- App storage service → Block storage: uses storage capability
- Block storage → SPI NAND storage: implemented by
- Guest application runtime → Graphics contract: requests graphics
- Guest graphics engine → Graphics contract: implements contract (evidence: `firmware/espressif/main/platform/lvgl/guest_graphics_engine.cpp`)
- Guest graphics engine → Display pipeline contract: presents frames
- Display pipeline contract → Board implementations: board-specific transport (evidence: `firmware/espressif/main/platform/boards/ksdiy-p4c5/display_pipeline.hpp`)
- Audio engine → Board implementations: uses audio sink (evidence: `firmware/espressif/main/platform/audio/audio_engine.cpp`)
- Board implementations → Microcontroller device: drives hardware (evidence: `README.md`)
- Firmware app lifecycle → Microcontroller device: manages hardware (evidence: `README.md`)
