FBT P
⌘K
β–Έ Plugin Architecture Master Reference

How This Changes Everything for FBTArticle Analysis β€” Jessica Patel Β· Type-Safe Plugin Architecture in React

This article isn't just theory β€” it's a direct blueprint for solving FBT's #1 engineering challenge: how do RentFlow, Zentra, CatchMoment, and FIROSE Group grow independently without becoming a tangled monolith? Plugin architecture is the answer.

4FBT Projects Impacted
7Concepts to Apply
HIGHStrategic Relevance
NowBest Time to Start
Next.js 15React 19TypeScriptPlugin ArchitectureModule Federation
πŸ“‹

Why This Article Matters for FBT

FBT is not a single-product company. You are building a platform ecosystem β€” RentFlow as the SaaS product, Zentra as the identity layer, CatchMoment as an AI video product, and FIROSE Group's digital suite. All of these need to evolve independently, share infrastructure, and integrate with each other without becoming entangled. This is precisely the problem the article addresses.

🏠
Multi-Tenant Feature Isolation

RentFlow has Owner, Manager, Resident, and Super-Admin roles β€” each with radically different UI needs. A plugin architecture means each role's dashboard can be a separate plugin, loaded only for that user. No more monolithic role-switch logic.

Article ConceptLazy Loading + Host API
FBT GainSmaller bundles per role
πŸ”
OAuth Provider as Plugin Host

Zentra is FBT's identity provider. It needs to serve multiple clients (RentFlow, CatchMoment, FIROSE apps). The Plugin API model maps perfectly β€” Zentra exposes a HostAPI that each client registers with, getting only the auth capabilities they're permitted to use.

Article ConceptSecurity + Permission Model
FBT GainScoped auth per client app
🎬
AI Pipeline as Plugin Extensions

CatchMoment's 8-repo polyrepo is a natural fit for plugin architecture. Video capture, highlight generation, social sharing, and storage are independent pipelines. Each can be a plugin with its own bundle, loaded on demand β€” perfectly matching the article's bundling strategy.

Article ConceptIndependent Bundling + Lifecycle
FBT GainDeploy pipelines independently
🏒
Multi-Division Digital Extensions

Neat & Fresh, The Femison, and AR Perfumes are separate divisions that share the FIROSE website infrastructure. Plugin architecture lets each division's product catalog, promotional modules, and campaign pages be independently deployable without redeploying the whole platform.

Article ConceptHot-loading + CI/CD
FBT GainDivision-level autonomy
πŸ—ΊοΈ

Article Concept β†’ FBT Application

Every concept in the article maps 1:1 to something FBT is already building or planning. Here's the complete translation table β€” what the article teaches vs. what FBT should implement, and where.

ARTICLE CONCEPT

Host API

Controlled interface between core app and plugins

FBT TRANSLATION

ARTICLE CONCEPT

Plugin Lifecycle

init β†’ mount β†’ update β†’ unmount lifecycle hooks

FBT TRANSLATION

ARTICLE CONCEPT

Independent Bundling

Each plugin compiled as its own Vite/esbuild bundle

FBT TRANSLATION

ARTICLE CONCEPT

Lazy Loading

Dynamic import() β€” load plugin only when user needs it

FBT TRANSLATION

ARTICLE CONCEPT

Security Model

Restricted API surface, permission boundaries

FBT TRANSLATION

ARTICLE CONCEPT

Hot-loading

Vite HMR for plugin live-reload during development

FBT TRANSLATION

ARTICLE CONCEPT

CI/CD for Plugins

GitHub Actions per plugin β€” lint, test, bundle, deploy

FBT TRANSLATION

πŸ’‘Key Insight: The article's HostAPI + Plugin pattern is architecturally identical to how Zentra already works β€” it's an OAuth provider that gives clients only what they're permitted. You've already implemented this principle. Now formalise it across the frontend with TypeScript interfaces.
πŸ—οΈ

Project-by-Project Plugin Plan

Each FBT project has a specific plugin architecture story. The following details show exactly what to build, what the plugin host exposes, and which article concepts apply directly.

🏠

RentFlow

πŸ”

Zentra

🎬

CatchMoment

🏒

FIROSE Group

πŸ’»

FBT Code Adaptations

Here's how to translate the article's code examples into FBT's actual Next.js 15 and React 19 stack, with Zentra security integration.

typescript
// fbt-shared/plugin-loader.ts β€” FBT Production Plugin Loader
import { use, cache } from 'react'; // React 19

// Strict allowlist β€” no arbitrary URLs
const PLUGIN_REGISTRY: Record Promise> = {
  'owner-dashboard':    () => import('@rentflow/plugin-owner'),
  'manager-dashboard':  () => import('@rentflow/plugin-manager'),
  'resident-dashboard': () => import('@rentflow/plugin-resident'),
  'superadmin-panel':   () => import('@rentflow/plugin-superadmin'),
};

// Cache plugin promises β€” deduplicate concurrent loads
const loadPlugin = cache(async (key: string, hostAPI: RentFlowHostAPI) => {
  const loader = PLUGIN_REGISTRY[key];
  if (!loader) throw new Error(`Unknown plugin: ${key}`);
  const { default: plugin } = await loader();
  await plugin.init(hostAPI);
  return plugin;
});

// React 19 β€” Suspense-native plugin component
export function PluginBoundary({ pluginKey }: { pluginKey: string }) {
  const plugin = use(loadPlugin(pluginKey, hostAPI)); // Throws promise β†’ Suspense
  const Component = plugin.getComponent('Dashboard');
  return ;
}
βš–οΈ

Before vs After for FBT

βœ— BEFORE (Monolith)
βœ—All RentFlow roles load all role code β€” every user downloads Owner + Manager + Resident + SuperAdmin bundles
βœ—Adding a new Manager feature requires touching the same files Resident uses β†’ merge conflicts
βœ—Zentra Admin UI modules share the same chunk β€” audit-logs loads even when only managing clients
βœ—CatchMoment's video processing logic is bundled with the landing page
βœ—FIROSE division campaigns require redeploying the entire Group website
βœ—A bug in the Owner dashboard forces a full RentFlow release cycle
βœ—Cowork-generated code for one feature can break another in the same bundle
βœ“ AFTER (Plugin Architecture)
βœ“Zentra token determines which plugin bundle loads β€” Resident never downloads Owner code
βœ“Manager plugin lives in @rentflow/plugin-manager β€” Resident team never touches it
βœ“Zentra admin loads audit-logs plugin on demand β€” initial load drops from 400kb to 80kb
βœ“CatchMoment video plugin loads only when an active event exists
βœ“Black Phynoline campaign deploys as a FIROSE plugin without touching homepage
βœ“Owner plugin hotfix deploys and hot-loads without Resident downtime
βœ“Cowork generates a complete self-contained plugin β€” zero risk to other modules
🎯The single biggest FBT win: Cowork's Claude Code workflow becomes dramatically safer. Each session targets one plugin. The generated code is type-checked against the HostAPI contract. You can hot-load Cowork's output in the host app without rebuilding anything else. Iteration speed multiplies.
πŸ›£οΈ

FBT Implementation Roadmap

The article gives all the technical pieces. Here's the FBT-specific sequence β€” ordered to deliver value fast without a big-bang rewrite.

1
Define the FBT HostAPI Interface Contracts

Start with Zentra. Write ZentraHostAPI and RentFlowHostAPI TypeScript interfaces. These are the foundation everything else builds on. No runtime code yet β€” just contracts. This is the article's "How to Define the Host API" applied to FBT's actual domain.

2
Extract Role Dashboards as Lazy-Loaded Plugins

Move OwnerDashboard, ManagerDashboard, and ResidentDashboard into separate packages under packages/. Each gets a plugin.ts with init/unmount. The main app/ dynamically imports based on Zentra JWT role claim. Immediate bundle size win.

3
Implement SecureHostAPI with Zentra Token Scopes

Create createSecureHostAPI(zentraToken) that derives plugin capabilities from live JWT claims. A Resident plugin that tries to register an Owner-only panel throws a typed error at init time. The security layer is Zentra-native, not custom-built.

4
Formalise Polyrepo Interfaces as Plugin Contracts

CatchMoment's 8 repos already have natural boundaries. Formalise each as a CatchMomentPlugin with typed capabilities (gpu-inference, storage-write, highlight-generate). The event-service becomes the HostAPI orchestrator β€” loading the right pipeline plugins for each event type.

5
Per-Plugin CI Pipelines on GitHub Actions

Add the GitHub Actions workflow the article describes β€” one per plugin package. Each runs type-check, lint, test, build, and a verify-contract script that confirms the plugin satisfies its HostAPI interface. Railway auto-deploys changed plugin bundles. Cowork sessions can target specific plugin packages with confidence.

6
Division Content as Independently Deployable Plugins

Neat & Fresh, Femison, and AR Perfumes each get a content plugin. The FIROSE Group website becomes a plugin host. Division teams deploy their product catalog updates without a website release. Hot-loading in development lets marketing see live changes in the host context instantly.

⚠️

When FBT Should NOT Use This

The article explicitly lists when plugin architecture is wrong. Let's map this honestly to FBT's situation.

⚠️Small / Single-Team Apps

Partly β€” early-stage features

FBT VERDICT

New EduConnect or early-stage features should not start as plugins. Build monolithic first, extract when boundaries are clear.

⚠️Tightly Coupled Features

Yes β€” some RentFlow flows

FBT VERDICT

The resident onboarding QR flow is tightly coupled to the property assignment logic. Don't plugin-ise this β€” the coupling is load-bearing. Keep it in core.

⚠️Performance-Critical Systems

Partly β€” CatchMoment GPU pipeline

FBT VERDICT

The GPU inference hot path itself should not use plugin dynamic import β€” too slow. Load it eagerly at event start. Only the UI components are plugin-lazy-loaded.

⚠️Limited Security Controls

Not applicable β€” Zentra handles it

FBT VERDICT

FBT is in the clear. Zentra's OIDC token scopes provide exactly the security layer the article recommends. You already have the infrastructure.

⚠️Early-Stage Products

Yes β€” new project kickoffs

FBT VERDICT

When starting a new FBT project with Cowork, build monolithic first for 4–6 weeks. Once domains are clear, extract plugins. The Kickoff Prompt should scaffold conventional structure.

βœ…

FBT Verdict

Start Immediately

Define HostAPI contracts for RentFlow and Zentra. These are TypeScript interfaces β€” zero runtime cost to start.

Biggest Quick Win

Lazy-load RentFlow role dashboards by Zentra JWT role claim. Instant bundle reduction, zero UX change.

Cowork Multiplier

Each Cowork session targets one plugin package. Safer generation, faster iteration, zero cross-module risk.

Host API DesignPlugin LifecycleIndependent BundlingDynamic import()Lazy LoadingVite Library ModeSecureHostAPIPermission Modeliframe SandboxingWeb WorkerspostMessage IPCHMR Hot-Reloadimport.meta.hotGitHub Actions per pluginTypeScript ContractsZentra Token ScopesRole-Based Plugin LoadTurborepo PackagesRentFlow Role ModulesCatchMoment GPU LifecycleFIROSE Division PluginsPlugin Registry AllowlistReact 19 use()Suspense Plugin BoundaryPlugin EventBusPlugin VersioningCowork Session IsolationRailway Plugin DeployContract Verification CI