Architecture: How should generated modules integrate with the visual edito...
Documentation for Sessions
🏗️ Architecture: How should generated modules integrate with the visual edito...
Date: 2026-02-25
Time: 14:48:10 UTC
Session: gspace1-138.10
Agent: backend
Confidence: 92%
Status: ✅ Documented
📋 Decision Context
Question:
How should generated modules integrate with the visual editor (modular-universe)?
Task: Visual editor integration architecture
🎯 Decision Made
Chosen:
Use page-renderer moduleId with Page documents in space_pages
Options Considered:
- Generate custom renderer components
- Use page-renderer moduleId with Page documents
- Direct component registration
💭 Reasoning
The visual editor uses UniversalModule trees where page-module nodes reference moduleId:'page-renderer' and config.pageId linking to Page documents in space_pages. The pipeline generates: (1) UniversalModule tree with galaxy>world>page-modules hierarchy, (2) Page documents matching the Page interface from page-builder.types.ts (WidgetInstance with type/config/positions/timestamps, PageLayout with grid settings, metadata with isPublished/tags), (3) Each page-module node has pageId referencing the created Page document. The page-renderer module loads pages via PagesService and renders widgets. No custom renderers needed.
📁 Files Involved
apis/backend-vitto-api/src/app/module-generation/phases/module-gen-phase.executor.tsapis/backend-vitto-api/src/app/module-generation/phases/backend-setup.phase.tslibs/libs-structural/page-builder/src/lib/types/page-builder.types.ts
🔗 Related
- Decision ID:
dev_1772030890017_pi57b19 - Session: 138
- Workspace: gspace1
Auto-generated by MCP Smart Consolidation