Production Ready Improvements - Unified Schema v3

Comprehensive plan to unify module schemas across canvas, backend, and AI generation

🚀 Production Ready Improvements

Unified Module Schema v3

Date: November 30, 2025
Status: 🎯 COMPREHENSIVE PLAN
Purpose: Create a perfectly synchronized, AI-friendly, and performant module schema


📊 Current State Analysis

What We Have

Component Status Location
Canvas Types ✅ Working universe-canvas/models/canvas.types.ts
UniversalModule ✅ Working core-models/types/modules/universal-module.types.ts
Backend API ✅ Working backend-api/modules/universal-modules.controller.ts
Module Registry ✅ Working module-base/services/
Layout Templates ✅ Working canvas-builder-template.service.ts
Structural Modules ✅ Built modules/structural/*

Current Schema Issues

❌ Canvas uses: { label, type: "container", flex: {...} }
❌ MongoDB uses: { name, slug, type: "page", config: {...}, layout: {...} }
❌ Redundant layout data in multiple places
❌ Missing hierarchy context (Galaxy → World → Page)
❌ No AI awareness priority system
❌ Empty children (no actual content)

🌌 Space Language Hierarchy

We retain the cosmic branding that makes space-building fun:

┌─────────────────────────────────────────────────────────────┐
│                         UNIVERSE                             │
│  (The Project/Platform - deployed subdomain)                 │
│                                                              │
│  ┌─────────────────────────────────────────────────────────┐│
│  │                      GALAXY                              ││
│  │  (Route Group - e.g., /admin, /shop, /docs)             ││
│  │                                                          ││
│  │  ┌─────────────────────────────────────────────────────┐││
│  │  │                    WORLD                            │││
│  │  │  (Page Container - holds layout + modules)          │││
│  │  │                                                      │││
│  │  │  ┌──────────────────────────────────────────────┐   │││
│  │  │  │            PAGE-MODULE                       │   │││
│  │  │  │  (Visual page with widgets - /menu, /about)  │   │││
│  │  │  │                                              │   │││
│  │  │  │  ┌────────────┬────────────┬─────────────┐  │   │││
│  │  │  │  │  LAYOUT    │  WIDGETS   │  MODULES    │  │   │││
│  │  │  │  │  MODULES   │  (content) │  (nav,etc)  │  │   │││
│  │  │  │  └────────────┴────────────┴─────────────┘  │   │││
│  │  │  └──────────────────────────────────────────────┘   │││
│  │  └─────────────────────────────────────────────────────┘││
│  └─────────────────────────────────────────────────────────┘│
└─────────────────────────────────────────────────────────────┘

📁 Documentation Structure


🎯 Key Objectives

1. Single Source of Truth

One schema used by Canvas, MongoDB, Backend API, and AI generation.

2. Preserve Space Language

Keep Galaxy, World, Universe terminology for fun space-building experience.

3. Smart Layout Module Reuse

Layout modules (split-sidebar, two-column) usable at any level, not just root.

4. AI Awareness Priority System

AI looks for resources in this order:

  1. User's space-specific modules
  2. User's space-specific widgets
  3. User's space theme system
  4. Global GoGrab modules
  5. Global GoGrab widgets
  6. Singularity basic flows
  7. Singularity custom flows

5. Backend Sync Perfection

Canvas → MongoDB → Backend API → Canvas cycle works flawlessly.


📚 Related Documentation


🔄 Quick Links

Action Document
Understand the Plan nov-30-prod-ready.plan.md
Track Progress progress.md
Review Schema UNIFIED_MODULE_SCHEMA_V3.md

Last Updated: November 30, 2025 - 7:30 PM
Status: 🎯 Planning Complete, Implementation Starting
Maintainer: Architecture Team