Phase 0 - Gap Analysis Report
Comprehensive audit of existing module system and identification of precise gaps for hybrid integration
Phase 0: Gap Analysis Report
Executive Summary
The editor monorepo has a mature module foundation that is architecturally aligned with gograb-modules. The core module system (@libs-core/module-base) already supports:
ModuleManifestwith full metadataModuleEmbeddableComponentinterfaceBrowserModuleContractlifecycle@ModuleDecoratorfor auto-registration- AI metadata for intelligent composition
- Configuration schemas
The gaps are not architectural - they are in integration and depth.
Current Module Inventory
Complete Modules (Production Ready)
| Module | Location | Features | Status |
|---|---|---|---|
| new-user-management | modules/new-user-management/ |
Full CRUD, embeddables, actions, routes, state | Complete |
| sidebar-nav | modules/structural/sidebar-nav/ |
Rich config, AI metadata, themes | Complete |
| top-nav | modules/structural/top-nav/ |
Navigation component | Complete |
| footer | modules/structural/footer/ |
Footer component | Complete |
| page-renderer | modules/structural/page-renderer/ |
Page rendering | Complete |
| form-builder | modules/structural/form-builder/ |
Form component | Complete |
| routes-manager | modules/structural/routes-manager/ |
Route management | Complete |
Layout Template Modules (Production Ready)
| Module | Location | Status |
|---|---|---|
| split-sidebar | modules/layout/split-sidebar/ |
Complete |
| two-column-equal | modules/layout/two-column-equal/ |
Complete |
| three-column-equal | modules/layout/three-column-equal/ |
Complete |
| header-content-footer | modules/layout/header-content-footer/ |
Complete |
| dashboard | modules/layout/dashboard/ |
Complete |
| custom | modules/layout/custom/ |
Complete |
Stub Modules (Need Expansion)
| Module | Location | Current State | Gap |
|---|---|---|---|
| product-catalog | modules/product-catalog/ |
Single widget only | No routes, services, CRUD |
| blog | modules/blog/ |
Single widget only | No routes, services, CRUD |
| portfolio | modules/portfolio/ |
Single widget only | No routes, services, CRUD |
| saas | modules/saas/ |
Single widget only | No routes, services, CRUD |
| space-management | modules/space-management/ |
Partial | Needs completion |
Identified Gaps
Gap 1: Widget-to-Embeddable Bridge (CRITICAL)
Problem: The WidgetRegistryService and module embeddableComponents are completely disconnected.
Evidence from WidgetRegistryService:
// Current sources of widgets:
// 1. BasicWidgetRegistry (button, text, image, etc.)
// 2. Local storage user widgets
// 3. Backend API space widgets
// MISSING: Module embeddable components!
Impact:
- Module embeddables (e.g.,
UserListWidgetComponentfrom user-management) don't appear in the editor widget palette - Space builders can't drag-and-drop module components onto pages
- No automatic discovery of module widgets
Solution Required:
- Create
module-adapterlibrary with bridge service - Add
syncEmbeddablesFromModules()to WidgetRegistryService - Create
EmbeddableHostWidgetto render any embeddable
Gap 2: Business Module Depth (IMPORTANT)
Problem: Business modules (product-catalog, blog, portfolio, saas) are stubs with only a single widget.
Example - product-catalog current state:
// ONLY has:
embeddableComponents: [
{
id: 'product-catalog:list-widget',
componentType: ProductListWidgetComponent,
// ... single widget
}
]
// MISSING:
// - routes (product list, detail, cart, checkout)
// - services (ProductService, CartService)
// - actions (AddToCart, Checkout)
// - state management
// - backend integration
Solution Required:
- Expand product-catalog into full ecommerce module
- Or create new comprehensive ecommerce module
Gap 3: Module Route Integration (IMPORTANT)
Problem: Singularity renders visual pages, but module routes are separate.
Current behavior:
/space/:slug/page-name→ Singularity renders visual page- Module routes registered but not unified with space navigation
Solution Required:
- Unified routing strategy in Singularity
- Module routes appear in space navigation
- Seamless transition between visual pages and module pages
Gap 4: Configuration UI (MODERATE)
Problem: Modules have configuration schemas but no UI to configure them.
Example from sidebar-nav:
configuration: {
headerTitle: { type: 'string', label: 'Header Title', default: 'Navigation' },
theme: { type: 'select', options: ['minimal', 'rich', 'dark'] },
// ... 20+ configuration options
}
Current: No panel in Singularity to edit these configurations visually.
Solution Required:
- Module Configuration Panel component
- Dynamic form generation from schema
- Save configuration per module instance
Architecture Analysis
ModuleManifest Interface (Excellent)
Location: libs/core/module-base/src/lib/contracts/module-manifest.interface.ts
The interface is comprehensive with:
embeddableComponents- Array of embeddable UI componentspublicActions- Callable actions from other modulesroutes- Angular routes for the moduleconfiguration- Dynamic configuration schemanavigation- Menu items and navigation configmetadata- AI metadata for intelligent compositionrepositories- Data access repositoriesdataStrategy- Storage and sync configuration
Assessment: No changes needed to the interface.
ModuleEmbeddableComponent Interface (Excellent)
Location: libs/core/module-base/src/lib/contracts/embeddable-component.interface.ts
export interface ModuleEmbeddableComponent {
readonly id: string;
readonly componentType: Type<unknown>;
readonly displayName: string;
readonly description?: string;
readonly category: ModuleEmbeddableComponentCategory;
readonly permissions?: readonly string[];
readonly inputs?: readonly ModuleParameterMetadata[];
readonly thumbnail?: string;
}
Assessment: Complete. Matches gograb-modules pattern.
WidgetRegistryService (Needs Update)
Location: libs/libs-structural/editor-web-lib/src/lib/services/widget-registry.service.ts
Current widget sources:
BasicWidgetRegistryService- Built-in widgets (button, text, etc.)- Local storage - User-created composite widgets
- Backend API - Space-specific widgets
Missing: Module embeddable components
Required Addition:
// NEW METHOD NEEDED:
syncEmbeddablesFromModules(): void {
const modules = inject(ModuleRegistryService).getAllModules();
for (const module of modules) {
for (const embeddable of module.manifest.embeddableComponents || []) {
this.registerFromEmbeddable(embeddable);
}
}
}
Comparison with gograb-modules
What gograb-modules has that we should adopt:
- WidgetDataBinding Pattern - Data binding built into widget base class
- BaseWidgetComponent - Common lifecycle helpers for widgets
- DynamicPageComponent - Renders pages from widget configuration
What editor has that gograb-modules should adopt:
- Comprehensive Storage System - Flash persistence, offline-first
- Real Backend API - MongoDB, real-time sync
- Theme Runtime - Advanced theming with persistence
- AI Metadata - Richer AI composition support
- Singularity - Powerful orchestration layer
Implementation Priority
Phase 1: Widget-Embeddable Bridge (Weeks 2-3)
- Create
libs/core/module-adapter/library - Update WidgetRegistryService to discover module embeddables
- Create EmbeddableHostWidget component
Phase 2: Reference Implementation (Week 4)
- Verify user-management module works end-to-end
- Test embeddable appears in widget palette
- Test drag-and-drop to Singularity pages
Phase 3: Ecommerce Module (Weeks 5-10)
- Create comprehensive ecommerce module
- Full services, routes, UI, embeddables
- Backend API integration
Phase 4: Singularity Integration (Weeks 11-12)
- Module route rendering in Singularity
- Module configuration panel
- Module store/installer
Files to Create
| File | Purpose |
|---|---|
libs/core/module-adapter/src/lib/bridge.service.ts |
Widget-embeddable bridge |
libs/core/module-adapter/src/lib/bridge.types.ts |
Bridge interfaces |
libs/core/module-adapter/src/lib/embeddable-converter.ts |
Convert embeddables to widgets |
libs/libs-widgets/widgets/src/lib/components/embeddable-host/ |
Host component for embeddables |
Files to Modify
| File | Change |
|---|---|
libs/libs-structural/editor-web-lib/src/lib/services/widget-registry.service.ts |
Add syncEmbeddablesFromModules() |
apps/gograb-space/src/app/app.config.ts |
Initialize bridge after module registration |
Conclusion
The editor monorepo has an excellent architectural foundation. The hybrid integration requires:
- Bridge layer to connect module embeddables to widget system
- Business module depth to provide real functionality (ecommerce)
- Route integration to unify visual pages and module pages
- Configuration UI to make modules configurable visually
Estimated effort: 12-14 weeks as planned.
Status: Gap Analysis Complete
Next Step: Phase 1 - Create module-adapter library