Shared Library (ft-common)
ft-common provides the reusable components, services, models, state, guards, interceptors and the
AI module shared by the Support Portal and the Management Portal. Both applications consume it as
@ft/common (file:dist/ft-common), so it must be built first:
ng build --project=ft-common # once
npm run dev # or: watch-build while developing
Secondary entry points
Most top-level folders under projects/ft-common/ are ng-packagr secondary entry points, each
imported by its own path. The primary entry point @ft/common (public-api.ts) exports the
workspace modules, ft-core.module and app-material.module among them.
| Import | Content |
|---|---|
|
Shared and feature UI components. |
|
API access, authentication, configuration, permissions and per-feature services. |
|
Interfaces, enums and data models. |
|
NgRx actions, reducers, effects and selectors. |
|
Route guards. |
|
HTTP interceptors. |
|
Template helpers and utilities. |
|
The AI assistant module (components, services, interfaces, styles). |
Components
Location: projects/ft-common/components/src.
| Area | Folder |
|---|---|
Base and shared building blocks |
|
Layout |
|
Authentication |
|
Device management |
|
Bulk operations |
|
Automation |
|
Monitoring and analytics |
|
System and settings |
|
Services
Location: projects/ft-common/services/src.
| Service | File |
|---|---|
|
|
|
|
|
|
|
|
|
|
Feature services |
|
UI and session services |
|
Models
Location: projects/ft-common/models/src — data models, enums and a large interfaces/
collection re-exported through public-api.ts (users, authentication, permissions, device frame
parameters, filter conditions, Grafana paths, settings, and so on).
Store
Location: projects/ft-common/store/src, split into actions/, reducers/, effects/ and
selectors/. Feature slices include authentication, automation, connectivity, device profiles,
device update, file management, group update, menu, monitoring, notification, pagination, reports,
settings, system and tabs. See State & Data Flow.
Guards
Location: projects/ft-common/guards/src.
| Guard | Purpose |
|---|---|
|
Redirects between |
|
Blocks routes the current user group is not allowed to open. |
|
The same check at tab level inside a feature page. |
|
Filters the navigation menu to the permitted items. |
Interceptors
Location: projects/ft-common/interceptors/src.
-
TokenInterceptor— attachesAuthorization: Bearer <token>fromsessionStorage, skips a whitelist of unauthenticated endpoints (login, password reset,assets,app-config.json, selected settings endpoints) and aborts other calls when no token is present. -
ErrorHandlerInterceptor— turns HTTP failures into store notifications and handles authentication errors centrally.
AI module
Location: projects/ft-common/ai. Provides the assistant chat UI and AIService, whose connection
URL comes from the backend setting AIServiceConnectionURL; requests go to <url>ai-agent/…,
which the container proxies (see Nginx
Routes). The button is rendered only when the URL is configured and the user group holds the
AI assistant permission.