# arturr0k3r/akiraos architecture

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

- Interactive diagram: https://gitdiagram.com/arturr0k3r/akiraos
- Repository: https://github.com/arturr0k3r/akiraos

## Overview

AkiraOS is an embedded WebAssembly application platform: apps are uploaded or installed, registered by the app manager, then loaded into a sandboxed WAMR runtime with manifest-declared capabilities. Native APIs expose device services to apps, while connectivity and peripheral subsystems provide deployment, OTA, and hardware capabilities. The README documents these major product areas; sampled source supports the HTTP-install, app-storage, and OTA relationships shown. Other subsystem wiring is not inferred from the file tree alone.

Main entry points: [`src/runtime/app_manager/app_manager.c`](https://github.com/arturr0k3r/akiraos/blob/main/src/runtime/app_manager/app_manager.c) (App manager), [`src/runtime/akira_runtime.c`](https://github.com/arturr0k3r/akiraos/blob/main/src/runtime/akira_runtime.c) (WAMR runtime), [`src/runtime/security.c`](https://github.com/arturr0k3r/akiraos/blob/main/src/runtime/security.c) (Capability guard), [`src/api/akira_storage_api.c`](https://github.com/arturr0k3r/akiraos/blob/main/src/api/akira_storage_api.c) (Sandboxed storage API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app_lifecycle["App Lifecycle"]
  node_app_manager["App manager<br/>[app_manager.c]"]
  node_manifest_parser["Manifest parser<br/>[manifest_parser.c]"]
  node_app_loader["App loader<br/>[app_loader.c]"]
  node_app_events["App events<br/>[app_events.c]"]
end

subgraph group_runtime_security["Runtime Security"]
  node_wasm_runtime["WAMR runtime<br/>[akira_runtime.c]"]
  node_sandbox["WASM sandbox<br/>[sandbox.c]"]
  node_capability_guard{{"Capability guard<br/>[security.c]"}}
end

subgraph group_device_services["Device Services"]
  node_native_api["Native API modules<br/>[akira_api.h]"]
  node_ui_framework["UI framework<br/>[ui_framework.c]"]
  node_shell["Device shell<br/>[akira_shell.c]"]
  node_storage_api["Sandboxed storage API"]
end

subgraph group_connectivity["Connectivity"]
  node_http_server["HTTP server<br/>[http_server.c]"]
  node_http_routes["HTTP routes<br/>[http_routes.c]"]
  node_connectivity_services["Connectivity services<br/>[bt_manager.c]"]
  node_ota_manager["OTA manager<br/>[ota_manager.c]"]
  node_transport_interface["OTA transport"]
  node_cloud_client["Cloud client<br/>[cloud_client.c]"]
end

subgraph group_platform["Platform"]
  node_filesystem[("Filesystem manager<br/>[fs_manager.c]")]
  node_driver_registry["Driver registry<br/>[driver_registry.c]"]
  node_hardware_drivers["Hardware drivers<br/>[platform_hal.c]"]
end

node_operator(("Device operator"))
node_wasm_app["WASM app"]

node_operator -->|"uploads app"| node_http_server
node_http_server -->|"dispatches requests"| node_http_routes
node_http_routes -->|"installs app"| node_app_manager
node_app_manager -->|"parses manifest"| node_manifest_parser
node_app_manager -->|"stores app"| node_filesystem
node_app_manager -->|"loads app"| node_app_loader
node_app_loader -->|"instantiates module"| node_wasm_runtime
node_wasm_runtime -->|"runs isolated"| node_sandbox
node_wasm_app -->|"executes in"| node_wasm_runtime
node_wasm_runtime -->|"checks permissions"| node_capability_guard
node_capability_guard -->|"guards calls"| node_native_api
node_native_api -->|"accesses services"| node_driver_registry
node_driver_registry -->|"dispatches drivers"| node_hardware_drivers
node_storage_api -->|"checks storage access"| node_capability_guard
node_storage_api -->|"reads and writes sandbox"| node_filesystem
node_app_manager -->|"publishes lifecycle events"| node_app_events
node_operator -->|"manages device"| node_shell
node_shell -->|"controls apps"| node_app_manager
node_wasm_app -->|"renders interface"| node_ui_framework
node_connectivity_services -.->|"provides BLE services"| node_wasm_app
node_operator -->|"starts update"| node_ota_manager
node_ota_manager -->|"receives update data"| node_transport_interface
node_transport_interface -.->|"uses cloud transport"| node_cloud_client

click node_http_server "https://github.com/arturr0k3r/akiraos/blob/main/src/connectivity/http/http_server.c"
click node_http_routes "https://github.com/arturr0k3r/akiraos/blob/main/src/connectivity/http/http_routes.c"
click node_app_manager "https://github.com/arturr0k3r/akiraos/blob/main/src/runtime/app_manager/app_manager.c"
click node_manifest_parser "https://github.com/arturr0k3r/akiraos/blob/main/src/runtime/manifest_parser.c"
click node_app_loader "https://github.com/arturr0k3r/akiraos/blob/main/src/runtime/app_loader/app_loader.c"
click node_app_events "https://github.com/arturr0k3r/akiraos/blob/main/src/runtime/app_manager/app_events.c"
click node_wasm_runtime "https://github.com/arturr0k3r/akiraos/blob/main/src/runtime/akira_runtime.c"
click node_sandbox "https://github.com/arturr0k3r/akiraos/blob/main/src/runtime/security/sandbox.c"
click node_capability_guard "https://github.com/arturr0k3r/akiraos/blob/main/src/runtime/security.c"
click node_native_api "https://github.com/arturr0k3r/akiraos/blob/main/src/api/akira_api.h"
click node_ui_framework "https://github.com/arturr0k3r/akiraos/blob/main/src/ui/ui_framework.c"
click node_shell "https://github.com/arturr0k3r/akiraos/blob/main/src/shell/akira_shell.c"
click node_filesystem "https://github.com/arturr0k3r/akiraos/blob/main/src/storage/fs_manager.c"
click node_storage_api "https://github.com/arturr0k3r/akiraos/blob/main/src/api/akira_storage_api.c"
click node_driver_registry "https://github.com/arturr0k3r/akiraos/blob/main/src/drivers/driver_registry.c"
click node_hardware_drivers "https://github.com/arturr0k3r/akiraos/blob/main/src/drivers/platform_hal.c"
click node_connectivity_services "https://github.com/arturr0k3r/akiraos/blob/main/src/connectivity/bluetooth/bt_manager.c"
click node_ota_manager "https://github.com/arturr0k3r/akiraos/blob/main/src/connectivity/ota/ota_manager.c"
click node_transport_interface "https://github.com/arturr0k3r/akiraos/blob/main/src/connectivity/transport_interface.c"
click node_cloud_client "https://github.com/arturr0k3r/akiraos/blob/main/src/connectivity/cloud/cloud_client.c"

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_app_manager,node_manifest_parser,node_app_loader,node_app_events toneBlue
class node_wasm_runtime,node_sandbox,node_capability_guard toneAmber
class node_native_api,node_ui_framework,node_shell,node_storage_api toneMint
class node_http_server,node_http_routes,node_connectivity_services,node_ota_manager,node_transport_interface,node_cloud_client toneRose
class node_filesystem,node_driver_registry,node_hardware_drivers,node_operator,node_wasm_app toneIndigo
```

## Components

### App Lifecycle

- [App manager](https://github.com/arturr0k3r/akiraos/blob/main/src/runtime/app_manager/app_manager.c): `src/runtime/app_manager/app_manager.c`
- [Manifest parser](https://github.com/arturr0k3r/akiraos/blob/main/src/runtime/manifest_parser.c): `src/runtime/manifest_parser.c`
- [App loader](https://github.com/arturr0k3r/akiraos/blob/main/src/runtime/app_loader/app_loader.c): `src/runtime/app_loader/app_loader.c`
- [App events](https://github.com/arturr0k3r/akiraos/blob/main/src/runtime/app_manager/app_events.c): `src/runtime/app_manager/app_events.c`

### Runtime Security

- [WAMR runtime](https://github.com/arturr0k3r/akiraos/blob/main/src/runtime/akira_runtime.c): `src/runtime/akira_runtime.c`
- [WASM sandbox](https://github.com/arturr0k3r/akiraos/blob/main/src/runtime/security/sandbox.c): `src/runtime/security/sandbox.c`
- [Capability guard](https://github.com/arturr0k3r/akiraos/blob/main/src/runtime/security.c): `src/runtime/security.c`

### Device Services

- [Native API modules](https://github.com/arturr0k3r/akiraos/blob/main/src/api/akira_api.h): `src/api/akira_api.h`
- [UI framework](https://github.com/arturr0k3r/akiraos/blob/main/src/ui/ui_framework.c): `src/ui/ui_framework.c`
- [Device shell](https://github.com/arturr0k3r/akiraos/blob/main/src/shell/akira_shell.c): `src/shell/akira_shell.c`
- [Sandboxed storage API](https://github.com/arturr0k3r/akiraos/blob/main/src/api/akira_storage_api.c): `src/api/akira_storage_api.c`

### Connectivity

- [HTTP server](https://github.com/arturr0k3r/akiraos/blob/main/src/connectivity/http/http_server.c): `src/connectivity/http/http_server.c`
- [HTTP routes](https://github.com/arturr0k3r/akiraos/blob/main/src/connectivity/http/http_routes.c): `src/connectivity/http/http_routes.c`
- [Connectivity services](https://github.com/arturr0k3r/akiraos/blob/main/src/connectivity/bluetooth/bt_manager.c): `src/connectivity/bluetooth/bt_manager.c`
- [OTA manager](https://github.com/arturr0k3r/akiraos/blob/main/src/connectivity/ota/ota_manager.c): `src/connectivity/ota/ota_manager.c`
- [OTA transport](https://github.com/arturr0k3r/akiraos/blob/main/src/connectivity/transport_interface.c): `src/connectivity/transport_interface.c`
- [Cloud client](https://github.com/arturr0k3r/akiraos/blob/main/src/connectivity/cloud/cloud_client.c): `src/connectivity/cloud/cloud_client.c`

### Platform

- [Filesystem manager](https://github.com/arturr0k3r/akiraos/blob/main/src/storage/fs_manager.c): `src/storage/fs_manager.c`
- [Driver registry](https://github.com/arturr0k3r/akiraos/blob/main/src/drivers/driver_registry.c): `src/drivers/driver_registry.c`
- [Hardware drivers](https://github.com/arturr0k3r/akiraos/blob/main/src/drivers/platform_hal.c): `src/drivers/platform_hal.c`

### Other components

- **Device operator**
- **WASM app**

## Connections

- Device operator → HTTP server: uploads app
- HTTP server → HTTP routes: dispatches requests
- HTTP routes → App manager: installs app
- App manager → Manifest parser: parses manifest
- App manager → Filesystem manager: stores app
- App manager → App loader: loads app
- App loader → WAMR runtime: instantiates module
- WAMR runtime → WASM sandbox: runs isolated
- WASM app → WAMR runtime: executes in
- WAMR runtime → Capability guard: checks permissions
- Capability guard → Native API modules: guards calls
- Native API modules → Driver registry: accesses services
- Driver registry → Hardware drivers: dispatches drivers
- Sandboxed storage API → Capability guard: checks storage access
- Sandboxed storage API → Filesystem manager: reads and writes sandbox
- App manager → App events: publishes lifecycle events
- Device operator → Device shell: manages device
- Device shell → App manager: controls apps
- WASM app → UI framework: renders interface
- Connectivity services → WASM app: provides BLE services
- Device operator → OTA manager: starts update
- OTA manager → OTA transport: receives update data
- OTA transport → Cloud client: uses cloud transport
