# devopstem/plna_os architecture

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

- Interactive diagram: https://gitdiagram.com/devopstem/plna_os
- Repository: https://github.com/devopstem/plna_os

## Overview

PLNA OS is a security-focused OS for retail, smart-home, and Game Club devices. The principal user flow is an installed app launched in a sandbox, which uses the SDK to request mediated services; ipcd checks capability permissions and routes requests to brokers that access device or system resources. The planogram app syncs aisle and beacon data, then presents it through the shell’s Wayland UI, with a headless mode. The graph preserves documented package, update, hardware, and security capabilities. Some subsystem links are documented or inferred rather than shown in sampled call sites, and are marked dashed or left out.

Main entry points: [`system/ipcd/src/main.cpp`](https://github.com/devopstem/plna_os/blob/main/system/ipcd/src/main.cpp) (IPC permission router), [`apps/retail_planogram/src/main.cpp`](https://github.com/devopstem/plna_os/blob/main/apps/retail_planogram/src/main.cpp) (Planogram app), [`libs/plna_manifest/src/manifest.cpp`](https://github.com/devopstem/plna_os/blob/main/libs/plna_manifest/src/manifest.cpp) (Package manifest), [`libs/plna_hal/src/sysfs.cpp`](https://github.com/devopstem/plna_os/blob/main/libs/plna_hal/src/sysfs.cpp) (Hardware abstraction)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_apps["Apps and UI"]
  node_planogram["Planogram app<br/>[main.cpp]"]
  node_sdk["PLNA SDK<br/>[client.cpp]"]
  node_shell["System shell<br/>[wayland_shell.cpp]"]
end

subgraph group_security["Package and security"]
  node_packager["Package tools<br/>[main.cpp]"]
  node_manifest["Package manifest<br/>[manifest.cpp]"]
  node_packaged["Package installer<br/>[main.cpp]"]
  node_spawner["App launcher<br/>[main.cpp]"]
  node_sandbox["Sandbox controls<br/>[spawn.cpp]"]
  node_securityd["Security service<br/>[main.cpp]"]
  node_crypto["Signing and hashes<br/>[ed25519.cpp]"]
end

subgraph group_ipc["IPC and brokers"]
  node_ipcd["IPC permission router<br/>[main.cpp]"]
  node_ipcprotocol["IPC protocol<br/>[protocol.hpp]"]
  node_datad["Data broker<br/>[main.cpp]"]
  node_database[("Database store<br/>[db_store.cpp]")]
  node_notifd["Notification broker<br/>[main.cpp]"]
  node_netd["Network broker<br/>[main.cpp]"]
  node_camerad["Camera broker<br/>[main.cpp]"]
  node_mqttd["MQTT broker<br/>[main.cpp]"]
end

subgraph group_hardware["Hardware services"]
  node_hal["Hardware abstraction<br/>[sysfs.cpp]"]
  node_devicebrokers["Device brokers"]
end

subgraph group_platform["Platform services"]
  node_update["Update service<br/>[main.cpp]"]
  node_init["System initialization<br/>[main.cpp]"]
  node_power["Power service<br/>[main.cpp]"]
end

node_user(("Device user"))

node_user -->|"uses"| node_planogram
node_planogram -->|"calls"| node_sdk
node_sdk -.->|"requests services"| node_ipcd
node_ipcd -->|"parses and forwards"| node_ipcprotocol
node_ipcd -->|"routes requests"| node_datad
node_ipcd -->|"routes requests"| node_netd
node_ipcd -->|"routes requests"| node_camerad
node_ipcd -->|"routes requests"| node_notifd
node_ipcd -->|"routes requests"| node_mqttd
node_datad -->|"uses store"| node_database
node_planogram -->|"syncs aisle data"| node_datad
node_planogram -->|"sends notification"| node_notifd
node_planogram -.->|"presents UI"| node_shell
node_packager -->|"creates package metadata"| node_manifest
node_packaged -->|"parses metadata"| node_manifest
node_packaged -->|"verifies package"| node_crypto
node_spawner -->|"loads app manifest"| node_manifest
node_spawner -->|"launches sandbox"| node_sandbox
node_spawner -.->|"launches installed app"| node_planogram
node_securityd -->|"reads permissions"| node_manifest
node_securityd -.->|"mints signed claims"| node_crypto
node_init -.->|"runs self-check"| node_securityd
node_devicebrokers -.->|"probes devices"| node_hal
node_power -->|"reads battery state"| node_hal
node_netd -->|"probes interfaces"| node_hal
node_camerad -->|"probes video devices"| node_hal
node_update -.->|"uses service IPC"| node_ipcd

click node_planogram "https://github.com/devopstem/plna_os/blob/main/apps/retail_planogram/src/main.cpp"
click node_sdk "https://github.com/devopstem/plna_os/blob/main/libs/plna_sdk/src/client.cpp"
click node_shell "https://github.com/devopstem/plna_os/blob/main/system/plna-shell/src/wayland_shell.cpp"
click node_packager "https://github.com/devopstem/plna_os/blob/main/tools/mkplna/src/main.cpp"
click node_manifest "https://github.com/devopstem/plna_os/blob/main/libs/plna_manifest/src/manifest.cpp"
click node_packaged "https://github.com/devopstem/plna_os/blob/main/system/packaged/src/main.cpp"
click node_spawner "https://github.com/devopstem/plna_os/blob/main/system/plna-spawn/src/main.cpp"
click node_sandbox "https://github.com/devopstem/plna_os/blob/main/libs/plna_sandbox/src/spawn.cpp"
click node_securityd "https://github.com/devopstem/plna_os/blob/main/system/securityd/src/main.cpp"
click node_crypto "https://github.com/devopstem/plna_os/blob/main/libs/plna_crypto/src/ed25519.cpp"
click node_ipcd "https://github.com/devopstem/plna_os/blob/main/system/ipcd/src/main.cpp"
click node_ipcprotocol "https://github.com/devopstem/plna_os/blob/main/libs/plna_ipc/include/plna/ipc/protocol.hpp"
click node_datad "https://github.com/devopstem/plna_os/blob/main/system/datad/src/main.cpp"
click node_database "https://github.com/devopstem/plna_os/blob/main/system/datad/src/db_store.cpp"
click node_notifd "https://github.com/devopstem/plna_os/blob/main/system/notifd/src/main.cpp"
click node_netd "https://github.com/devopstem/plna_os/blob/main/system/netd/src/main.cpp"
click node_camerad "https://github.com/devopstem/plna_os/blob/main/system/camerad/src/main.cpp"
click node_mqttd "https://github.com/devopstem/plna_os/blob/main/system/mqttd/src/main.cpp"
click node_hal "https://github.com/devopstem/plna_os/blob/main/libs/plna_hal/src/sysfs.cpp"
click node_devicebrokers "https://github.com/devopstem/plna_os/tree/main/system"
click node_update "https://github.com/devopstem/plna_os/blob/main/system/updated/src/main.cpp"
click node_init "https://github.com/devopstem/plna_os/blob/main/system/plna-init/src/main.cpp"
click node_power "https://github.com/devopstem/plna_os/blob/main/system/powerd/src/main.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_planogram,node_sdk,node_shell,node_user toneBlue
class node_packager,node_manifest,node_packaged,node_spawner,node_sandbox,node_securityd,node_crypto toneAmber
class node_ipcd,node_ipcprotocol,node_datad,node_database,node_notifd,node_netd,node_camerad,node_mqttd toneMint
class node_hal,node_devicebrokers toneRose
class node_update,node_init,node_power toneIndigo
```

## Components

### Apps and UI

- [Planogram app](https://github.com/devopstem/plna_os/blob/main/apps/retail_planogram/src/main.cpp): `apps/retail_planogram/src/main.cpp`
- [PLNA SDK](https://github.com/devopstem/plna_os/blob/main/libs/plna_sdk/src/client.cpp): `libs/plna_sdk/src/client.cpp`
- [System shell](https://github.com/devopstem/plna_os/blob/main/system/plna-shell/src/wayland_shell.cpp): `system/plna-shell/src/wayland_shell.cpp`

### Package and security

- [Package tools](https://github.com/devopstem/plna_os/blob/main/tools/mkplna/src/main.cpp): `tools/mkplna/src/main.cpp`
- [Package manifest](https://github.com/devopstem/plna_os/blob/main/libs/plna_manifest/src/manifest.cpp): `libs/plna_manifest/src/manifest.cpp`
- [Package installer](https://github.com/devopstem/plna_os/blob/main/system/packaged/src/main.cpp): `system/packaged/src/main.cpp`
- [App launcher](https://github.com/devopstem/plna_os/blob/main/system/plna-spawn/src/main.cpp): `system/plna-spawn/src/main.cpp`
- [Sandbox controls](https://github.com/devopstem/plna_os/blob/main/libs/plna_sandbox/src/spawn.cpp): `libs/plna_sandbox/src/spawn.cpp`
- [Security service](https://github.com/devopstem/plna_os/blob/main/system/securityd/src/main.cpp): `system/securityd/src/main.cpp`
- [Signing and hashes](https://github.com/devopstem/plna_os/blob/main/libs/plna_crypto/src/ed25519.cpp): `libs/plna_crypto/src/ed25519.cpp`

### IPC and brokers

- [IPC permission router](https://github.com/devopstem/plna_os/blob/main/system/ipcd/src/main.cpp): `system/ipcd/src/main.cpp`
- [IPC protocol](https://github.com/devopstem/plna_os/blob/main/libs/plna_ipc/include/plna/ipc/protocol.hpp): `libs/plna_ipc/include/plna/ipc/protocol.hpp`
- [Data broker](https://github.com/devopstem/plna_os/blob/main/system/datad/src/main.cpp): `system/datad/src/main.cpp`
- [Database store](https://github.com/devopstem/plna_os/blob/main/system/datad/src/db_store.cpp): `system/datad/src/db_store.cpp`
- [Notification broker](https://github.com/devopstem/plna_os/blob/main/system/notifd/src/main.cpp): `system/notifd/src/main.cpp`
- [Network broker](https://github.com/devopstem/plna_os/blob/main/system/netd/src/main.cpp): `system/netd/src/main.cpp`
- [Camera broker](https://github.com/devopstem/plna_os/blob/main/system/camerad/src/main.cpp): `system/camerad/src/main.cpp`
- [MQTT broker](https://github.com/devopstem/plna_os/blob/main/system/mqttd/src/main.cpp): `system/mqttd/src/main.cpp`

### Hardware services

- [Hardware abstraction](https://github.com/devopstem/plna_os/blob/main/libs/plna_hal/src/sysfs.cpp): `libs/plna_hal/src/sysfs.cpp`
- [Device brokers](https://github.com/devopstem/plna_os/tree/main/system): `system`

### Platform services

- [Update service](https://github.com/devopstem/plna_os/blob/main/system/updated/src/main.cpp): `system/updated/src/main.cpp`
- [System initialization](https://github.com/devopstem/plna_os/blob/main/system/plna-init/src/main.cpp): `system/plna-init/src/main.cpp`
- [Power service](https://github.com/devopstem/plna_os/blob/main/system/powerd/src/main.cpp): `system/powerd/src/main.cpp`

### Other components

- **Device user**

## Connections

- Device user → Planogram app: uses (evidence: `README.md`)
- Planogram app → PLNA SDK: calls (evidence: `apps/retail_planogram/src/main.cpp`)
- PLNA SDK → IPC permission router: requests services
- IPC permission router → IPC protocol: parses and forwards (evidence: `system/ipcd/src/main.cpp`)
- IPC permission router → Data broker: routes requests (evidence: `system/ipcd/src/main.cpp`)
- IPC permission router → Network broker: routes requests (evidence: `system/ipcd/src/main.cpp`)
- IPC permission router → Camera broker: routes requests (evidence: `system/ipcd/src/main.cpp`)
- IPC permission router → Notification broker: routes requests (evidence: `system/ipcd/src/main.cpp`)
- IPC permission router → MQTT broker: routes requests (evidence: `system/ipcd/src/main.cpp`)
- Data broker → Database store: uses store (evidence: `system/datad/src/main.cpp`)
- Planogram app → Data broker: syncs aisle data (evidence: `apps/retail_planogram/src/main.cpp`)
- Planogram app → Notification broker: sends notification (evidence: `apps/retail_planogram/src/main.cpp`)
- Planogram app → System shell: presents UI (evidence: `README.md`)
- Package tools → Package manifest: creates package metadata (evidence: `tools/mkplna/src/main.cpp`)
- Package installer → Package manifest: parses metadata (evidence: `system/packaged/src/main.cpp`)
- Package installer → Signing and hashes: verifies package (evidence: `system/packaged/src/main.cpp`)
- App launcher → Package manifest: loads app manifest (evidence: `system/plna-spawn/src/main.cpp`)
- App launcher → Sandbox controls: launches sandbox (evidence: `system/plna-spawn/src/main.cpp`)
- App launcher → Planogram app: launches installed app (evidence: `README.md`)
- Security service → Package manifest: reads permissions (evidence: `system/securityd/src/main.cpp`)
- Security service → Signing and hashes: mints signed claims
- System initialization → Security service: runs self-check (evidence: `system/plna-init/src/main.cpp`)
- Device brokers → Hardware abstraction: probes devices (evidence: `README.md`)
- Power service → Hardware abstraction: reads battery state (evidence: `system/powerd/src/main.cpp`)
- Network broker → Hardware abstraction: probes interfaces (evidence: `system/netd/src/main.cpp`)
- Camera broker → Hardware abstraction: probes video devices (evidence: `system/camerad/src/main.cpp`)
- Update service → IPC permission router: uses service IPC
