How frangoteam/fuxa works
1. What this repo is
- FUXA is a full-stack industrial SCADA/HMI platform with three execution forms: a browser-based app, an Electron desktop package, and a headless portable/server mode.
- The architecture is centered on a Node.js backend plus an Angular frontend, with shared runtime logic in the server and the bulk of the UI/editor in the client.
2. Top-level deployment boundary
- server/ is the main runtime host and API layer.
- client/ is the Angular SPA that provides the editor, dashboards, and admin screens.
- app/electron/ packages the same product as a desktop application.
- app/headless/ provides a non-GUI executable wrapper for embedded/server deployments.
- Docker and compose.yml are first-class deployment paths, with persistent volumes for app data, database/history, logs, and images.
3. Frontend subsystem: editor + runtime UI
- The Angular app is not just a thin UI; it contains the project editor, runtime views, administration screens, and many reusable HMI widgets.
- Key areas include:
- editor/ for building views, layouts, charts, cards, scripts, and widget configuration.
- gauges/, fuxa-view/, view/, cards-view/, iframe/, and maps/ for runtime visualization.
- device/, alarms/, reports/, scripts/, users/, plugins/, and settings-related screens for administration.
- Shared Angular services in _services/ act as the client-side integration layer to backend APIs and runtime updates.
4. Backend runtime: central orchestration layer
- server/main.js and server/runtime/ form the core application engine.
- This layer owns:
- project loading/saving
- authentication and authorization
- device orchestration
- alarms and notifications
- historian/data acquisition
- scheduler and scripts
- plugin management
- reporting jobs
- server/api/ exposes the HTTP API surface consumed by the Angular app and integrations.
5. Device acquisition subsystem
- Industrial connectivity is implemented as pluggable runtime drivers under server/runtime/devices/.
- Supported protocols/devices include Modbus, S7, OPC-UA, BACnet, MQTT, Ethernet/IP, ODBC, ADS, GPIO, WebCam, MELSEC, Redis, HTTP request, and a template/device abstraction.
- The client mirrors this with protocol-specific tag/property editors under client/src/app/device/tag-property/, so protocol choice is a major boundary in the model.
6. Data path: from devices to UI/history
- The main flow is: device drivers read/write tags → runtime stores current values and events → client views render live data and trends.
- Historian components under server/runtime/storage/ persist DAQ data to SQLite and optional time-series backends such as InfluxDB, QuestDB, and TDengine.
- The client charts, tables, gauges, and HMI widgets consume these values through the backend services rather than talking directly to devices.
7. Project/model persistence
- Projects are treated as first-class artifacts and appear to be stored as project files plus server-managed storage state.
- server/runtime/project/ and server/api/projects/ manage project lifecycle.
- The repo includes demo/default project files (server/project.default.json, server/project.demo.fuxap, client/src/assets/project.demo.fuxap) that show the project is portable and file-backed as well as service-backed.
8. Operations and control plane
- server/api/auth, users, apikeys, and JWT helper code define the security boundary.
- command, diagnose, alarms, scheduler, scripts, and reports are separate runtime control domains exposed through APIs and reflected in dedicated UI sections.
- The architecture is therefore split between “data acquisition” and “operations/control” rather than being only a visualization app.
9. Alarm, notification, and scheduler pipeline
- Alarms are handled in server/runtime/alarms/ and surfaced through the UI alarm screens.
- Notifications live in server/runtime/notificator/ and connect alarm/runtime events to user-facing alerts.
- Scheduler logic exists both server-side and in the client editor, indicating scheduled jobs/actions are designed as a runtime capability with editable configuration.
10. Scripts and automation
- server/runtime/scripts/ executes automation logic, while the Angular scripts/ area provides editing, permissions, and scheduling screens.
- This makes scripts another runtime subsystem, not just a UI feature.
- The repo also includes a Node-RED integration, which extends automation flows with FUXA-specific nodes for reading/writing tags, opening views/cards, sending messages, and manipulating devices.
11. Extensibility and resource model
- server/runtime/plugins/ and client/src/app/plugins/ form the plugin boundary.
- server/runtime/resources/ and client/src/app/resources/ manage reusable assets such as images, widgets, and kiosk-related content.
- The presence of SVG editor assets and shape libraries indicates the UI is heavily asset-driven and extensible through custom widgets/shapes.
12. Integration surface
- server/api/ is the public backend surface for the SPA and external automation clients.
- Node-RED custom nodes in node-red/node-red-contrib-fuxa/ and the mirrored copies under server/integrations/node-red/ expose FUXA operations to flow-based automation.
- There is also support for external DB connectivity via ODBC and time-series databases for historians.
13. Packaging and build ecosystem
- The repo is organized for multiple packaging targets: Docker images, Electron desktop builds, headless binaries, and source install.
- The Angular build output is embedded into server/app packaging, so the frontend is a compiled artifact served by the backend/desktop shell.
- Documentation is maintained as MkDocs content under docs/, and GitHub Actions automate docs, Docker, Electron, and headless packaging.
14. How to draw the architecture
- A good diagram should show:
- Client/editor SPA on the left
- Node.js server/runtime in the center
- Industrial devices/protocol drivers on the right
- Persistent stores below the runtime
- Optional integrations like Node-RED, plugins, and external time-series/ODBC databases around the runtime
- The key arrows are: user configuration flows from SPA to server; live tag/alarm/data flows from devices to runtime to SPA; persistence flows from runtime to project files/databases; automation flows from scripts/scheduler/Node-RED back into devices and UI.
Main entry points: main.js Server host · app Angular app · api HTTP API · project Project store
Components 23
Client SPA
Angular frontend for editor, runtime views, and admin screens.
- Angular app · Main browser application hosting editor, dashboards, and admin UI.
client/src/app - Editor · Builds views, layouts, charts, widgets, scripts, and setup flows.
client/src/app/editor - Runtime UI · Live operator screens and reusable visualization surfaces.
client/src/app/view - Widgets · Reusable gauges, tables, charts, shapes, iframes, and controls.
client/src/app/gauges - Device config · Client-side protocol-specific device and tag configuration screens.
client/src/app/device - Ops screens · Alarms, users, reports, scripts, plugins, resources, maps, notifications, logs, and settings.
client/src/app/alarms - API services · Angular services that call backend APIs and stream runtime updates.
client/src/app/_services
Server Runtime
Node.js backend, APIs, and operational runtime.
- Server host · Main application process and runtime bootstrap.
server/main.js - HTTP API · API boundary consumed by the SPA, Node-RED, and external clients.
server/api - Project store · Loads, saves, and serves project artifacts and defaults.
server/runtime/project - Security · JWT, API keys, users, and authorization controls.
server/api/auth - Drivers · Pluggable industrial device drivers for acquisition and control.
server/runtime/devices - Alarms · Alarm detection, storage, acknowledgment, and notification flow.
server/runtime/alarms - Historian · Current-value and historical persistence across SQLite and time-series backends.
server/runtime/storage - Scheduler · Scheduled actions and periodic automation jobs.
server/runtime/scheduler - Scripts · Executes server-side automation and script logic.
server/runtime/scripts - Plugins · Plugin loading and npm-backed runtime extensions.
server/runtime/plugins - Reports · Report generation and report-related services.
server/runtime/jobs/report.js - Notifications · Notification fan-out connected to alarms and runtime events.
server/runtime/notificator
Integrations
External automation and packaging entrypoints.
- Node-RED · Custom nodes expose FUXA data, devices, views, and messages to flows.
node-red/node-red-contrib-fuxa - Desktop/headless · Electron desktop packaging and headless server wrapper.
app
Persistence
Project files and historian backends.
- Project files · Demo/default project files used as portable and service-backed project state.
server/project.demo.fuxap - DB backends · SQLite plus optional InfluxDB, QuestDB, TDengine, and ODBC-connected stores.
server/runtime/storage/sqlite
Connections 25
- Angular app → Editor: contains · The SPA exposes the project editor and configuration workflows.
- Angular app → Runtime UI: contains · The SPA serves operator runtime views and dashboards.
- Angular app → Widgets: uses · Runtime views are assembled from reusable HMI widgets.
- Angular app → Device config: contains · Protocol-specific device and tag editors live in the client.
- Angular app → Ops screens: contains · Administrative screens cover alarms, users, reports, scripts, and more.
- Angular app → API services: calls · Client services bridge Angular screens to backend APIs and updates.
- API services → HTTP API: requests · The SPA uses the HTTP API for CRUD, runtime control, and live data.
- Server host → HTTP API: hosts · Main runtime process exposes the API surface.
- Server host → Project store: manages · Server bootstrap loads and persists project state.
- Server host → Drivers: orchestrates · Runtime coordinates device drivers and tag I/O.
- Server host → Alarms: runs · Alarm evaluation and event handling are central runtime duties.
- Server host → Historian: persists · Runtime writes current values and historian data to storage.
- Server host → Scheduler: schedules · Periodic jobs and timed actions are executed by the runtime.
- Server host → Scripts: executes · Automation scripts run inside the server runtime.
- Server host → Plugins: extends · Plugins augment the runtime and integrations.
- Server host → Reports: generates · Reporting jobs are produced by the server runtime.
- Alarms → Notifications: triggers · Alarm events feed the notification pipeline.
- Drivers → Historian: writes · Driver reads and writes populate live and historical data.
- Historian → DB backends: stores in · Historian data is persisted to SQLite or external time-series/databases.
- Project store → Project files: loads/saves · Projects are file-backed as portable artifacts.
- Node-RED → HTTP API: integrates with · Node-RED custom nodes call into FUXA services and data.
- Node-RED → Drivers: controls · Flows can read, write, and manipulate devices and tags.
- Desktop/headless → Server host: wraps · Electron and headless modes package the same server-centered product.
- Editor → Project store: edits · Editor workflows define and save project artifacts.
- Ops screens → HTTP API: administers · Operational screens manage alarms, users, scripts, reports, and settings via API.