How sakazuki/node-red-desktop works
Node-RED Desktop wraps the Node-RED editor and runtime in an Electron application. The main process coordinates startup, editor/runtime lifecycle, file operations, settings, and optional integrations; users edit and deploy flows in the editor, which the runtime serves locally. The graph also preserves documented-in-source settings, project/palette, debug, update, tray, and ngrok capabilities. Some wiring is omitted because the excerpts do not show the relevant handlers or preload implementation.
Main entry points: main.ts App coordinator · node-red.ts Node-RED app · config-manager.ts App configuration · file-manager.ts Flow file manager
Components 20
Desktop app
- App coordinator
src/main/main.ts - Editor window
src/main/browser-window.ts - Editor interactions
src/renderer/renderer.js - Settings UI
src/renderer/settings.js - App event bus
src/main/app-event-bus.ts
Node-RED runtime
- Node-RED app
src/main/node-red.ts - Runtime commands
src/main/node-red-runtime-exec.ts
Files and settings
- Flow and user data
src/main/custom-storage.ts - App configuration
src/main/config-manager.ts - Flow file manager
src/main/file-manager.ts - Recent files
src/main/file-history.ts
Desktop integrations
- App menu
src/main/menu.ts - System tray
src/main/tray.ts - Auto updater
src/main/auto-update.ts - Tunnel manager
src/main/ngrok-manager.ts
Other components
- Desktop user
- ngrok service
- Electron settings store
- Node-RED runtime
- Local filesystem
Connections 31
- Desktop user → Editor window: uses editor
- App coordinator → App configuration: creates
- App coordinator → Flow file manager: creates
- App coordinator → Recent files: creates
- App coordinator → App menu: creates
- App coordinator → Node-RED app: creates
- App coordinator → Editor window: creates
- App coordinator → Node-RED app: starts runtime
- App coordinator → Auto updater: starts updater
- App coordinator → System tray: starts tray
- App coordinator → Recent files: loads history
- App coordinator → Tunnel manager: connects tunnel
- Tunnel manager → ngrok service: opens tunnel
- App configuration → Electron settings store: reads and writes
- Node-RED app → Node-RED runtime: initializes runtime
- Node-RED app → Flow and user data: configures storage
- Node-RED app → Runtime commands: patches commands
- Node-RED app → App event bus: emits lifecycle events
- App event bus → App coordinator: dispatches events
- Node-RED app → Local filesystem: serves and loads flows
- Flow and user data → Local filesystem: reads and writes data
- Flow file manager → Local filesystem: manages flow files
- Recent files → App configuration: persists recent files
- App coordinator → App configuration: saves settings
- App coordinator → Flow file manager: opens and saves flows
- App coordinator → Settings UI: sends settings
- Settings UI → App coordinator: submits settings
- Editor interactions → App coordinator: reports editor changes
- App coordinator → App menu: updates menu
- App coordinator → Auto updater: quits to install
- App coordinator → System tray: controls window