# mastershort/neonplan3d architecture

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

- Interactive diagram: https://gitdiagram.com/mastershort/neonplan3d
- Repository: https://github.com/mastershort/neonplan3d

## Overview

NeonPlan 3D is a Home Assistant integration with a browser-based home planner and interactive 3D dashboard. Users configure the integration, create or import a building plan, link Home Assistant entities to devices, and view and control the home in 3D; the integration persists plans and serves them to the frontend. Major branches include imports, energy and solar, time travel, furniture packs and optional Pro features. Some frontend-to-backend wiring and unsampled subsystems are documented but not visible in excerpts, so those links are omitted or marked unverified.

Main entry points: [`frontend/src/viewer/viewer3d.ts`](https://github.com/mastershort/neonplan3d/blob/main/frontend/src/viewer/viewer3d.ts) (3D renderer), [`frontend/src/components/view3d.ts`](https://github.com/mastershort/neonplan3d/blob/main/frontend/src/components/view3d.ts) (3D interaction view), [`frontend/src/building-controller.ts`](https://github.com/mastershort/neonplan3d/blob/main/frontend/src/building-controller.ts) (Building controller), [`frontend/src/timetravel/entry.ts`](https://github.com/mastershort/neonplan3d/blob/main/frontend/src/timetravel/entry.ts) (Time travel)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ha["Home Assistant integration"]
  node_setup["Integration setup<br/>[config_flow.py]"]
  node_ws["WebSocket API<br/>[websocket.py]"]
  node_store[("Plan storage<br/>[storage.py]")]
end

subgraph group_plan["Planning and data"]
  node_schema["Plan schema<br/>[schema.py]"]
  node_editor["Plan editor<br/>[editor.ts]"]
  node_model["Building model<br/>[model.ts]"]
  node_import["Plan import<br/>[app.ts]"]
  node_api["Frontend API<br/>[api.ts]"]
  node_controller["Building controller"]
  node_roof["Roof sections<br/>[roof-sections.ts]"]
end

subgraph group_view["3D experience"]
  node_card["Dashboard card<br/>[card.ts]"]
  node_view3d["3D interaction view<br/>[view3d.ts]"]
  node_viewer["3D renderer<br/>[viewer3d.ts]"]
  node_furniture["Furniture models<br/>[furniture.ts]"]
  node_geo["Geometry buffers<br/>[geo.ts]"]
  node_walk["3D navigation<br/>[walk.ts]"]
  node_devices["Device state<br/>[devices.ts]"]
  node_alerts["Tablet alerts<br/>[alerts.ts]"]
  node_kiosk["Kiosk mode<br/>[kiosk.ts]"]
end

subgraph group_history["Energy and history"]
  node_energy["Energy features<br/>[energy.ts]"]
  node_solar["Solar features<br/>[solar.ts]"]
  node_time["Time travel<br/>[entry.ts]"]
  node_events["History events<br/>[events.ts]"]
  node_summary["History summaries<br/>[summary.ts]"]
end

subgraph group_extensions["Packs and extensions"]
  node_packs["Furniture packs<br/>[packs.py]"]
  node_pack_registry["Pack registry<br/>[packs.ts]"]
  node_license["License service<br/>[license.py]"]
end

node_user(("Home user"))
node_ha["Home Assistant"]
node_shop["NeonPlan shop"]

node_user -->|"configures"| node_setup
node_user -->|"draws plan"| node_editor
node_user -->|"imports plan"| node_import
node_editor -.->|"edits through"| node_controller
node_controller -->|"loads and saves"| node_api
node_controller -->|"normalizes"| node_model
node_import -->|"builds plan"| node_model
node_api -.->|"requests data"| node_ws
node_ws -->|"reads and writes"| node_store
node_store -->|"validates plan"| node_schema
node_ha -->|"hosts API"| node_ws
node_card -.->|"loads building"| node_controller
node_card -->|"shows dashboard"| node_view3d
node_view3d -->|"loads renderer"| node_viewer
node_viewer -->|"renders plan"| node_model
node_viewer -->|"renders models"| node_furniture
node_viewer -->|"builds geometry"| node_geo
node_viewer -->|"supports navigation"| node_walk
node_view3d -->|"reads device state"| node_devices
node_view3d -->|"reads power"| node_energy
node_viewer -->|"updates solar"| node_solar
node_user -->|"reviews history"| node_time
node_time -->|"classifies events"| node_events
node_time -->|"builds summaries"| node_summary
node_time -->|"reads recorder"| node_ha
node_ws -->|"serves packs"| node_packs
node_controller -->|"loads packs"| node_pack_registry
node_model -->|"resolves pack items"| node_pack_registry
node_user -->|"enters key"| node_license
node_license -->|"checks updates"| node_shop
node_license -->|"refreshes purchases"| node_packs
node_viewer -->|"renders roof"| node_roof
node_view3d -.->|"shows warnings"| node_alerts
node_card -.->|"supports kiosk"| node_kiosk

click node_setup "https://github.com/mastershort/neonplan3d/blob/main/custom_components/neonplan3d/config_flow.py"
click node_ws "https://github.com/mastershort/neonplan3d/blob/main/custom_components/neonplan3d/websocket.py"
click node_store "https://github.com/mastershort/neonplan3d/blob/main/custom_components/neonplan3d/storage.py"
click node_schema "https://github.com/mastershort/neonplan3d/blob/main/custom_components/neonplan3d/schema.py"
click node_editor "https://github.com/mastershort/neonplan3d/blob/main/frontend/src/components/editor.ts"
click node_model "https://github.com/mastershort/neonplan3d/blob/main/frontend/src/model.ts"
click node_import "https://github.com/mastershort/neonplan3d/blob/main/frontend/src/import/app.ts"
click node_api "https://github.com/mastershort/neonplan3d/blob/main/frontend/src/api.ts"
click node_controller "https://github.com/mastershort/neonplan3d/blob/main/frontend/src/building-controller.ts"
click node_card "https://github.com/mastershort/neonplan3d/blob/main/frontend/src/card.ts"
click node_view3d "https://github.com/mastershort/neonplan3d/blob/main/frontend/src/components/view3d.ts"
click node_viewer "https://github.com/mastershort/neonplan3d/blob/main/frontend/src/viewer/viewer3d.ts"
click node_furniture "https://github.com/mastershort/neonplan3d/blob/main/frontend/src/viewer/furniture.ts"
click node_geo "https://github.com/mastershort/neonplan3d/blob/main/frontend/src/viewer/geo.ts"
click node_walk "https://github.com/mastershort/neonplan3d/blob/main/frontend/src/viewer/walk.ts"
click node_devices "https://github.com/mastershort/neonplan3d/blob/main/frontend/src/devices.ts"
click node_energy "https://github.com/mastershort/neonplan3d/blob/main/frontend/src/energy.ts"
click node_solar "https://github.com/mastershort/neonplan3d/blob/main/frontend/src/solar.ts"
click node_time "https://github.com/mastershort/neonplan3d/blob/main/frontend/src/timetravel/entry.ts"
click node_events "https://github.com/mastershort/neonplan3d/blob/main/frontend/src/timetravel/events.ts"
click node_summary "https://github.com/mastershort/neonplan3d/blob/main/frontend/src/timetravel/summary.ts"
click node_packs "https://github.com/mastershort/neonplan3d/blob/main/custom_components/neonplan3d/packs.py"
click node_pack_registry "https://github.com/mastershort/neonplan3d/blob/main/frontend/src/packs.ts"
click node_license "https://github.com/mastershort/neonplan3d/blob/main/custom_components/neonplan3d/license.py"
click node_roof "https://github.com/mastershort/neonplan3d/blob/main/frontend/src/roof-sections.ts"
click node_alerts "https://github.com/mastershort/neonplan3d/blob/main/frontend/src/alerts.ts"
click node_kiosk "https://github.com/mastershort/neonplan3d/blob/main/frontend/src/kiosk.ts"

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_setup,node_ws,node_store,node_user toneBlue
class node_schema,node_editor,node_model,node_import,node_api,node_controller,node_roof toneAmber
class node_card,node_view3d,node_viewer,node_furniture,node_geo,node_walk,node_devices,node_alerts,node_kiosk toneMint
class node_energy,node_solar,node_time,node_events,node_summary toneRose
class node_packs,node_pack_registry,node_license,node_ha,node_shop toneIndigo
```

## Components

### Home Assistant integration

- [Integration setup](https://github.com/mastershort/neonplan3d/blob/main/custom_components/neonplan3d/config_flow.py): `custom_components/neonplan3d/config_flow.py`
- [WebSocket API](https://github.com/mastershort/neonplan3d/blob/main/custom_components/neonplan3d/websocket.py): `custom_components/neonplan3d/websocket.py`
- [Plan storage](https://github.com/mastershort/neonplan3d/blob/main/custom_components/neonplan3d/storage.py): `custom_components/neonplan3d/storage.py`

### Planning and data

- [Plan schema](https://github.com/mastershort/neonplan3d/blob/main/custom_components/neonplan3d/schema.py): `custom_components/neonplan3d/schema.py`
- [Plan editor](https://github.com/mastershort/neonplan3d/blob/main/frontend/src/components/editor.ts): `frontend/src/components/editor.ts`
- [Building model](https://github.com/mastershort/neonplan3d/blob/main/frontend/src/model.ts): `frontend/src/model.ts`
- [Plan import](https://github.com/mastershort/neonplan3d/blob/main/frontend/src/import/app.ts): `frontend/src/import/app.ts`
- [Frontend API](https://github.com/mastershort/neonplan3d/blob/main/frontend/src/api.ts): `frontend/src/api.ts`
- [Building controller](https://github.com/mastershort/neonplan3d/blob/main/frontend/src/building-controller.ts): `frontend/src/building-controller.ts`
- [Roof sections](https://github.com/mastershort/neonplan3d/blob/main/frontend/src/roof-sections.ts): `frontend/src/roof-sections.ts`

### 3D experience

- [Dashboard card](https://github.com/mastershort/neonplan3d/blob/main/frontend/src/card.ts): `frontend/src/card.ts`
- [3D interaction view](https://github.com/mastershort/neonplan3d/blob/main/frontend/src/components/view3d.ts): `frontend/src/components/view3d.ts`
- [3D renderer](https://github.com/mastershort/neonplan3d/blob/main/frontend/src/viewer/viewer3d.ts): `frontend/src/viewer/viewer3d.ts`
- [Furniture models](https://github.com/mastershort/neonplan3d/blob/main/frontend/src/viewer/furniture.ts): `frontend/src/viewer/furniture.ts`
- [Geometry buffers](https://github.com/mastershort/neonplan3d/blob/main/frontend/src/viewer/geo.ts): `frontend/src/viewer/geo.ts`
- [3D navigation](https://github.com/mastershort/neonplan3d/blob/main/frontend/src/viewer/walk.ts): `frontend/src/viewer/walk.ts`
- [Device state](https://github.com/mastershort/neonplan3d/blob/main/frontend/src/devices.ts): `frontend/src/devices.ts`
- [Tablet alerts](https://github.com/mastershort/neonplan3d/blob/main/frontend/src/alerts.ts): `frontend/src/alerts.ts`
- [Kiosk mode](https://github.com/mastershort/neonplan3d/blob/main/frontend/src/kiosk.ts): `frontend/src/kiosk.ts`

### Energy and history

- [Energy features](https://github.com/mastershort/neonplan3d/blob/main/frontend/src/energy.ts): `frontend/src/energy.ts`
- [Solar features](https://github.com/mastershort/neonplan3d/blob/main/frontend/src/solar.ts): `frontend/src/solar.ts`
- [Time travel](https://github.com/mastershort/neonplan3d/blob/main/frontend/src/timetravel/entry.ts): `frontend/src/timetravel/entry.ts`
- [History events](https://github.com/mastershort/neonplan3d/blob/main/frontend/src/timetravel/events.ts): `frontend/src/timetravel/events.ts`
- [History summaries](https://github.com/mastershort/neonplan3d/blob/main/frontend/src/timetravel/summary.ts): `frontend/src/timetravel/summary.ts`

### Packs and extensions

- [Furniture packs](https://github.com/mastershort/neonplan3d/blob/main/custom_components/neonplan3d/packs.py): `custom_components/neonplan3d/packs.py`
- [Pack registry](https://github.com/mastershort/neonplan3d/blob/main/frontend/src/packs.ts): `frontend/src/packs.ts`
- [License service](https://github.com/mastershort/neonplan3d/blob/main/custom_components/neonplan3d/license.py): `custom_components/neonplan3d/license.py`

### Other components

- **Home user**
- **Home Assistant**
- **NeonPlan shop**

## Connections

- Home user → Integration setup: configures
- Home user → Plan editor: draws plan
- Home user → Plan import: imports plan
- Plan editor → Building controller: edits through
- Building controller → Frontend API: loads and saves (evidence: `frontend/src/building-controller.ts`)
- Building controller → Building model: normalizes (evidence: `frontend/src/building-controller.ts`)
- Plan import → Building model: builds plan (evidence: `frontend/src/import/app.ts`)
- Frontend API → WebSocket API: requests data
- WebSocket API → Plan storage: reads and writes (evidence: `custom_components/neonplan3d/websocket.py`)
- Plan storage → Plan schema: validates plan (evidence: `custom_components/neonplan3d/storage.py`)
- Home Assistant → WebSocket API: hosts API
- Dashboard card → Building controller: loads building
- Dashboard card → 3D interaction view: shows dashboard
- 3D interaction view → 3D renderer: loads renderer (evidence: `frontend/src/components/view3d.ts`)
- 3D renderer → Building model: renders plan (evidence: `frontend/src/viewer/viewer3d.ts`)
- 3D renderer → Furniture models: renders models (evidence: `frontend/src/viewer/viewer3d.ts`)
- 3D renderer → Geometry buffers: builds geometry (evidence: `frontend/src/viewer/preview.ts`)
- 3D renderer → 3D navigation: supports navigation (evidence: `frontend/src/viewer/viewer3d.ts`)
- 3D interaction view → Device state: reads device state (evidence: `frontend/src/components/view3d.ts`)
- 3D interaction view → Energy features: reads power (evidence: `frontend/src/components/view3d.ts`)
- 3D renderer → Solar features: updates solar (evidence: `frontend/src/viewer/viewer3d.ts`)
- Home user → Time travel: reviews history
- Time travel → History events: classifies events (evidence: `frontend/src/timetravel/entry.ts`)
- Time travel → History summaries: builds summaries (evidence: `frontend/src/timetravel/entry.ts`)
- Time travel → Home Assistant: reads recorder (evidence: `frontend/src/timetravel/entry.ts`)
- WebSocket API → Furniture packs: serves packs (evidence: `custom_components/neonplan3d/websocket.py`)
- Building controller → Pack registry: loads packs (evidence: `frontend/src/building-controller.ts`)
- Building model → Pack registry: resolves pack items (evidence: `frontend/src/model.ts`)
- Home user → License service: enters key
- License service → NeonPlan shop: checks updates (evidence: `custom_components/neonplan3d/license.py`)
- License service → Furniture packs: refreshes purchases (evidence: `custom_components/neonplan3d/license.py`)
- 3D renderer → Roof sections: renders roof (evidence: `frontend/src/viewer/viewer3d.ts`)
- 3D interaction view → Tablet alerts: shows warnings (evidence: `frontend/src/components/view3d.ts`)
- Dashboard card → Kiosk mode: supports kiosk
