Files
EVOLV/.claude/rules/node-architecture.md
znetsixe 6a6c04d34b Migrate to new Gitea instance (gitea.wbd-rd.nl)
- Update all submodule URLs from gitea.centraal.wbd-rd.nl to gitea.wbd-rd.nl
- Add settler as proper submodule in .gitmodules
- Add agent skills, function anchors, decisions, and improvements
- Add Docker configuration and scripts
- Add manuals and third_party docs
- Update .gitignore with secrets and build artifacts
- Remove stale .tgz build artifact

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-04 21:07:04 +01:00

1.3 KiB

paths
paths
nodes/*/src/**

Node Architecture Rules

3-Tier Structure

Every node follows entry → nodeClass → specificClass:

  1. Entry file (nodes/<nodeName>/<nodeName>.js): Registers with Node-RED via RED.nodes.registerType, exposes admin HTTP endpoints.
  2. nodeClass (nodes/<nodeName>/src/nodeClass.js): Handles Node-RED runtime concerns — message routing, output formatting, tick loops, status updates, RED.* API calls.
  3. specificClass (nodes/<nodeName>/src/specificClass.js): Pure domain logic — physics, control algorithms, state machines.

Separation Rules

  • specificClass must never call RED.* directly — all Node-RED interaction goes through nodeClass.
  • specificClass is the source of truth for domain behavior.
  • nodeClass is the adapter between Node-RED and domain logic.
  • Entry file is minimal — registration and admin endpoints only.

Output Port Convention

  • Port 0: Process data (control outputs, state, setpoints)
  • Port 1: InfluxDB telemetry payload
  • Port 2: Registration/control plumbing (parent-child handshakes)

Admin Endpoints

  • GET /<nodeName>/menu.js — Dynamic menu configuration for editor
  • GET /<nodeName>/configData.js — Runtime configuration for editor

Submodule Awareness

Most nodes/* directories are git submodules. Keep edits scoped to the target node's directory.