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:

  1. libs-renderable - Fresh plug-and-play templates for layouts and navigation (Angular + Flutter)
  2. layout-builder - New visual tool for creating layouts with dual-target export
  3. singularity → modularity-lib - Merge flow builder into module generator for unified CRUD
  4. Type cleanup - Remove deprecated cosmic types (widget/data/flow/page)
  5. 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

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

Phase 4: Update Cosmic Module Types

Phase 5: Eliminate Duplicate Interfaces

Phase 6: Merge Singularity into Modularity-lib

Phase 7-10: Tool Updates

Phase 11-13: Cleanup


Current State Analysis

UniversalModule Duplicates Found (3)

  1. Canonical: libs/libs-foundational/core-models/src/lib/types/modules/universal-module.types.ts
  2. Duplicate: libs/libs-foundational/core-angular/src/lib/services/backend-module-api.service.ts:60
  3. 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

  1. Build verification: nx build for each new libs-renderable template
  2. Type checking: nx run-many --target=lint --all
  3. Tool sync test: Changes in universe-explorer reflect in live-preview
  4. AI generation test: vibe-universe generates correct new structure
  5. Layout builder test: Export Angular + Flutter, apply to galaxy
  6. Modularity integration test: Generate module with custom action flow

Related Sessions


Session Started: January 16, 2026 Agent: Claude Code (Claude Opus 4.5) Status: In Progress