Session 48 - Platform Builder Architecture Refactor
Comprehensive refactor of platform builder architecture with libs-renderable, layout-builder, and unified module generation
Session 48: Platform Builder Architecture Refactor
Overview
This session implements a comprehensive refactor of the platform builder architecture:
- libs-renderable - Fresh plug-and-play templates for layouts and navigation (Angular + Flutter)
- layout-builder - New visual tool for creating layouts with dual-target export
- singularity → modularity-lib - Merge flow builder into module generator for unified CRUD
- Type cleanup - Remove deprecated cosmic types (widget/data/flow/page)
- Interface consolidation - Single source of truth for UniversalModule
Key Architectural Decisions
| Decision | Choice | Rationale |
|---|---|---|
| CRUD Generation | Merge singularity-lib INTO modularity-lib | Singularity became isolated; integrating it enables unified module generation with custom/complex CRUD |
| Layout Scope | Both Angular and Flutter | Support web and mobile from the start |
| Migration Style | Create fresh implementations | New libs-renderable components perfectly adjusted to new structure, not migrated legacy code |
Implementation Phases
Phase 1: Session Setup
- Create session manifest (
session-48.json) - Create documentation folder
- Log initial decisions to MCP
Phase 2: libs-renderable Structure (Fresh Implementation)
Target structure:
libs/libs-renderable/
├── layout-templates/
│ ├── split-sidebar/
│ ├── header-content-footer/
│ ├── dashboard/
│ ├── two-column-equal/
│ └── three-column-equal/
├── navigation-templates/
│ ├── sidebar-nav/
│ ├── top-nav/
│ ├── footer/
│ └── breadcrumb-nav/
├── shell-components/
│ ├── page-renderer/
│ └── routes-manager/
└── shared/
├── models/
├── angular/
└── flutter/
Phase 3: Layout-Builder Tool
- Create new library:
libs/libs-structural/layout-builder/ - Components: LayoutBuilder, LayoutCanvas, LayoutPropertiesPanel, LayoutTemplateLibrary
- Dual export: Angular standalone components + Flutter widget definitions
- Integration with unified-builder
Phase 4: Update Cosmic Module Types
- Remove deprecated types:
widget,data,flow,page - Final CoreModuleType:
universe-root | galaxy | world | page-module | layout | navigation | feature | custom - Add layout property to StructureNodeConfig
Phase 5: Eliminate Duplicate Interfaces
- Remove duplicate from
backend-module-api.service.ts - Remove duplicate from
universal-modules.controller.ts - Single source:
@libs-foundational/core-models
Phase 6: Merge Singularity into Modularity-lib
- Move flow builder services into modularity-lib
- Integrate action flow generation with module generation
- Unified tool for module structure AND action logic
Phase 7-10: Tool Updates
- Update vibe-universe generator for new structure
- Update universe-explorer node types
- Update live-preview rendering
- Add layout-builder to unified-builder
Phase 11-13: Cleanup
- Deprecate/archive legacy modules
- Update feature modules (user-management, ecommerce, blog, saas)
- Update documentation
Current State Analysis
UniversalModule Duplicates Found (3)
- Canonical:
libs/libs-foundational/core-models/src/lib/types/modules/universal-module.types.ts - Duplicate:
libs/libs-foundational/core-angular/src/lib/services/backend-module-api.service.ts:60 - Duplicate:
apis/backend-api/src/app/modules/universal-modules.controller.ts:71
Type Definitions
| Location | Types | Status |
|---|---|---|
universe-structure.types.ts:66 |
universe-root, galaxy, world, page-module, layout, navigation, feature, widget, custom | Active |
modules.types.ts:10 |
Adds data, flow, page | Has deprecated types |
Files to be Modified
| Phase | Files |
|---|---|
| 2 | libs/libs-renderable/, tsconfig.base.json |
| 3 | libs/libs-structural/layout-builder/ (NEW) |
| 4 | libs/libs-foundational/core-models/src/lib/types/modules/modules.types.ts |
| 5 | libs/libs-foundational/core-angular/src/lib/services/backend-module-api.service.ts |
| 5 | apis/backend-api/src/app/modules/universal-modules.controller.ts |
| 6 | libs/libs-structural/modularity-lib/, libs/libs-structural/singularity-lib/ |
| 7 | libs/libs-ai/gograb-ai/src/lib/services/vibe-coding-orchestrator.service.ts |
| 8 | libs/libs-space/universe-explorer/ |
| 9 | libs/libs-space/universe-canvas/src/lib/components/live-preview/ |
| 10 | libs/libs-space/unified-builder/ |
Verification Plan
- Build verification:
nx buildfor each new libs-renderable template - Type checking:
nx run-many --target=lint --all - Tool sync test: Changes in universe-explorer reflect in live-preview
- AI generation test: vibe-universe generates correct new structure
- Layout builder test: Export Angular + Flutter, apply to galaxy
- Modularity integration test: Generate module with custom action flow
Related Sessions
- Session 46: Cosmic hierarchy finalization, tool integration, CrossToolSync improvements
- Session 43: AI generation pipeline, universe state isolation
- Session 40: Module tree sync, structure-view
Session Started: January 16, 2026 Agent: Claude Code (Claude Opus 4.5) Status: In Progress