State & Data Flow
Application state in both portals is managed with NgRx 19, and all of it lives in the shared
library (projects/ft-common/store/src, imported as @ft/common/store).
NgRx building blocks
| Package | Role |
|---|---|
|
Central, immutable application state (reducers, selectors, actions). |
|
Side effects — API calls to the UI Backend and other async work. |
|
Normalised collections (entity adapters) for list-heavy feature state. |
|
Connects Angular Router state into the store. |
|
Shared RxJS operators for effects ( |
|
Redux DevTools integration in development builds. |
Store layout
projects/ft-common/store/src is split into actions/, reducers/, effects/ and selectors/,
with one file (or folder) per feature slice:
| Slice | Holds |
|---|---|
|
Token, current user, login and change-password state. |
|
UI state: navigation entries, open tabs, list paging and toast notifications. |
|
Device profile definitions and device update operations. |
|
Bulk operations and stored firmware/configuration files. |
|
Automation rules. |
|
Monitoring data and report definitions. |
|
Platform settings (including |
|
Backend reachability state used by the connectivity indicator. |
Data flow (high level)
-
A component dispatches an action.
-
A reducer updates the store, and/or an effect calls the UI Backend through
ApiService. -
The effect dispatches a success/failure action; the reducer stores the result. Failures also pass through
ErrorHandlerInterceptor, which raises a notification. -
Components select the data via selectors and render it.
Because the store lives in ft-common, a feature slice written once is available to both portals;
only the routed feature modules differ.