# rogandawes/p4wnp1_aloa architecture

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

- Interactive diagram: https://gitdiagram.com/rogandawes/p4wnp1_aloa
- Repository: https://github.com/rogandawes/p4wnp1_aloa

## Overview

P4wnP1 A.L.O.A. is a Raspberry Pi–based offensive appliance, configured through a CLI or browser client. Both clients issue gRPC requests to the core service; the service applies settings across USB, HID, WiFi, Bluetooth, networking, and automation, while templates and events support persistence and live state updates. The graph preserves README-documented capabilities even where implementation excerpts are unavailable; those links are cited to the README rather than presented as inspected source calls.

Main entry points: [`service/rpc_server.go`](https://github.com/rogandawes/p4wnp1_aloa/blob/master/service/rpc_server.go) (gRPC server), [`service/service.go`](https://github.com/rogandawes/p4wnp1_aloa/blob/master/service/service.go) (Service coordinator), [`service/SubSysNetworkManager.go`](https://github.com/rogandawes/p4wnp1_aloa/blob/master/service/SubSysNetworkManager.go) (Network interfaces), [`web_client/mvuexGlobalState.go`](https://github.com/rogandawes/p4wnp1_aloa/blob/master/web_client/mvuexGlobalState.go) (Web state and views)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_clients["Configuration clients"]
  node_cli["CLI commands<br/>[cmd_root.go]"]
  node_cli_rpc["CLI RPC client<br/>[rpc_client.go]"]
  node_web_app["Web application<br/>[main.go]"]
  node_web_state["Web state and views"]
  node_web_rpc["Web RPC client<br/>[rpcClient.go]"]
end

subgraph group_core["Core control service"]
  node_service_entry["Service process<br/>[P4wnP1_service.go]"]
  node_service["Service coordinator<br/>[service.go]"]
  node_rpc["gRPC server<br/>[rpc_server.go]"]
end

subgraph group_device["Device capabilities"]
  node_usb["USB gadget<br/>[SubSysUSB.go]"]
  node_hid["HID scripting<br/>[controller.go]"]
  node_wifi["WiFi<br/>[wifi.go]"]
  node_bluetooth["Bluetooth<br/>[controller.go]"]
  node_network["Network interfaces"]
  node_dhcp["DHCP services<br/>[dhcp.go]"]
  node_gpio["GPIO<br/>[p4wnp1gpio.go]"]
end

subgraph group_state["State and automation"]
  node_triggers["Trigger actions"]
  node_events["Event manager<br/>[Event.go]"]
  node_store[("Persistent templates<br/>[store.go]")]
end

node_operator(("Operator"))
node_browser(("Web browser"))
node_host(("USB host"))
node_bluez["BlueZ stack"]
node_linux_net["Linux networking"]

node_operator -->|"configures"| node_cli
node_cli -->|"invokes"| node_cli_rpc
node_cli_rpc -->|"calls gRPC"| node_rpc
node_browser -->|"opens"| node_web_app
node_web_app -->|"initializes"| node_web_state
node_web_state -.->|"requests state"| node_web_rpc
node_web_rpc -->|"calls WebSocket gRPC"| node_rpc
node_service_entry -->|"starts"| node_service
node_service -->|"starts server"| node_rpc
node_rpc -.->|"configures"| node_usb
node_rpc -.->|"runs scripts"| node_hid
node_rpc -.->|"configures"| node_wifi
node_rpc -.->|"configures"| node_bluetooth
node_rpc -.->|"configures"| node_network
node_network -->|"starts DHCP"| node_dhcp
node_network -->|"configures links"| node_linux_net
node_bluetooth -->|"controls stack"| node_bluez
node_host -.->|"connects to"| node_usb
node_usb -->|"uses HID"| node_hid
node_service -->|"opens store"| node_store
node_rpc -->|"reads and writes"| node_store
node_service -->|"starts"| node_events
node_service -->|"starts listener"| node_triggers
node_triggers -.->|"reacts to events"| node_events
node_gpio -.->|"enables physical actions"| node_triggers
node_events -.->|"pushes updates"| node_web_state

click node_cli "https://github.com/rogandawes/p4wnp1_aloa/blob/master/cli_client/cmd_root.go"
click node_cli_rpc "https://github.com/rogandawes/p4wnp1_aloa/blob/master/cli_client/rpc_client.go"
click node_web_app "https://github.com/rogandawes/p4wnp1_aloa/blob/master/web_client/main.go"
click node_web_state "https://github.com/rogandawes/p4wnp1_aloa/blob/master/web_client/mvuexGlobalState.go"
click node_web_rpc "https://github.com/rogandawes/p4wnp1_aloa/blob/master/web_client/rpcClient.go"
click node_service_entry "https://github.com/rogandawes/p4wnp1_aloa/blob/master/cmd/P4wnP1_service/P4wnP1_service.go"
click node_service "https://github.com/rogandawes/p4wnp1_aloa/blob/master/service/service.go"
click node_rpc "https://github.com/rogandawes/p4wnp1_aloa/blob/master/service/rpc_server.go"
click node_usb "https://github.com/rogandawes/p4wnp1_aloa/blob/master/service/SubSysUSB.go"
click node_hid "https://github.com/rogandawes/p4wnp1_aloa/blob/master/hid/controller.go"
click node_wifi "https://github.com/rogandawes/p4wnp1_aloa/blob/master/service/wifi.go"
click node_bluetooth "https://github.com/rogandawes/p4wnp1_aloa/blob/master/service/bluetooth/controller.go"
click node_network "https://github.com/rogandawes/p4wnp1_aloa/blob/master/service/SubSysNetworkManager.go"
click node_dhcp "https://github.com/rogandawes/p4wnp1_aloa/blob/master/service/dhcp.go"
click node_gpio "https://github.com/rogandawes/p4wnp1_aloa/blob/master/service/pgpio/p4wnp1gpio.go"
click node_triggers "https://github.com/rogandawes/p4wnp1_aloa/blob/master/service/SubSysTriggerAction.go"
click node_events "https://github.com/rogandawes/p4wnp1_aloa/blob/master/service/Event.go"
click node_store "https://github.com/rogandawes/p4wnp1_aloa/blob/master/service/datastore/store.go"

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_cli,node_cli_rpc,node_web_app,node_web_state,node_web_rpc,node_browser toneBlue
class node_service_entry,node_service,node_rpc toneAmber
class node_usb,node_hid,node_wifi,node_bluetooth,node_network,node_dhcp,node_gpio toneMint
class node_triggers,node_events,node_store toneRose
class node_operator,node_host,node_bluez,node_linux_net toneIndigo
```

## Components

### Configuration clients

- [CLI commands](https://github.com/rogandawes/p4wnp1_aloa/blob/master/cli_client/cmd_root.go): `cli_client/cmd_root.go`
- [CLI RPC client](https://github.com/rogandawes/p4wnp1_aloa/blob/master/cli_client/rpc_client.go): `cli_client/rpc_client.go`
- [Web application](https://github.com/rogandawes/p4wnp1_aloa/blob/master/web_client/main.go): `web_client/main.go`
- [Web state and views](https://github.com/rogandawes/p4wnp1_aloa/blob/master/web_client/mvuexGlobalState.go): `web_client/mvuexGlobalState.go`
- [Web RPC client](https://github.com/rogandawes/p4wnp1_aloa/blob/master/web_client/rpcClient.go): `web_client/rpcClient.go`

### Core control service

- [Service process](https://github.com/rogandawes/p4wnp1_aloa/blob/master/cmd/P4wnP1_service/P4wnP1_service.go): `cmd/P4wnP1_service/P4wnP1_service.go`
- [Service coordinator](https://github.com/rogandawes/p4wnp1_aloa/blob/master/service/service.go): `service/service.go`
- [gRPC server](https://github.com/rogandawes/p4wnp1_aloa/blob/master/service/rpc_server.go): `service/rpc_server.go`

### Device capabilities

- [USB gadget](https://github.com/rogandawes/p4wnp1_aloa/blob/master/service/SubSysUSB.go): `service/SubSysUSB.go`
- [HID scripting](https://github.com/rogandawes/p4wnp1_aloa/blob/master/hid/controller.go): `hid/controller.go`
- [WiFi](https://github.com/rogandawes/p4wnp1_aloa/blob/master/service/wifi.go): `service/wifi.go`
- [Bluetooth](https://github.com/rogandawes/p4wnp1_aloa/blob/master/service/bluetooth/controller.go): `service/bluetooth/controller.go`
- [Network interfaces](https://github.com/rogandawes/p4wnp1_aloa/blob/master/service/SubSysNetworkManager.go): `service/SubSysNetworkManager.go`
- [DHCP services](https://github.com/rogandawes/p4wnp1_aloa/blob/master/service/dhcp.go): `service/dhcp.go`
- [GPIO](https://github.com/rogandawes/p4wnp1_aloa/blob/master/service/pgpio/p4wnp1gpio.go): `service/pgpio/p4wnp1gpio.go`

### State and automation

- [Trigger actions](https://github.com/rogandawes/p4wnp1_aloa/blob/master/service/SubSysTriggerAction.go): `service/SubSysTriggerAction.go`
- [Event manager](https://github.com/rogandawes/p4wnp1_aloa/blob/master/service/Event.go): `service/Event.go`
- [Persistent templates](https://github.com/rogandawes/p4wnp1_aloa/blob/master/service/datastore/store.go): `service/datastore/store.go`

### Other components

- **Operator**
- **Web browser**
- **USB host**
- **BlueZ stack**
- **Linux networking**

## Connections

- Operator → CLI commands: configures
- CLI commands → CLI RPC client: invokes
- CLI RPC client → gRPC server: calls gRPC
- Web browser → Web application: opens
- Web application → Web state and views: initializes (evidence: `web_client/main.go`)
- Web state and views → Web RPC client: requests state
- Web RPC client → gRPC server: calls WebSocket gRPC (evidence: `web_client/rpcClient.go`)
- Service process → Service coordinator: starts (evidence: `cmd/P4wnP1_service/P4wnP1_service.go`)
- Service coordinator → gRPC server: starts server (evidence: `service/service.go`)
- gRPC server → USB gadget: configures
- gRPC server → HID scripting: runs scripts
- gRPC server → WiFi: configures
- gRPC server → Bluetooth: configures
- gRPC server → Network interfaces: configures
- Network interfaces → DHCP services: starts DHCP (evidence: `service/SubSysNetworkManager.go`)
- Network interfaces → Linux networking: configures links (evidence: `service/SubSysNetworkManager.go`)
- Bluetooth → BlueZ stack: controls stack
- USB host → USB gadget: connects to
- USB gadget → HID scripting: uses HID (evidence: `service/SubSysUSB.go`)
- Service coordinator → Persistent templates: opens store (evidence: `service/service.go`)
- gRPC server → Persistent templates: reads and writes (evidence: `service/rpc_server.go`)
- Service coordinator → Event manager: starts (evidence: `service/service.go`)
- Service coordinator → Trigger actions: starts listener (evidence: `service/service.go`)
- Trigger actions → Event manager: reacts to events
- GPIO → Trigger actions: enables physical actions
- Event manager → Web state and views: pushes updates
