Modular Universe

The Modular Universe is the central playground for space-builders to create, define navigation, and connect behavior for their platforms.

Modular Universe 🌌

The Modular Universe is the playground where space-builders put together the puzzle pieces to create complete platforms.

Overview

The Modular Universe (@libs-structural/modular-universe) is the central canvas where space-builders:

  1. Create Structure - Define the project's (universe) layout using sections, templates, and regions
  2. Implement Modules - Connect modularity-lib to add functionality
  3. Define Navigation - Create routes, pages, galaxies, and worlds
  4. Connect Behavior - Attach Singularity flows for event-driven functionality

Architecture

┌─────────────────────────────────────────────────────────────────┐
│                    MODULAR UNIVERSE CANVAS                       │
├─────────────────────────────────────────────────────────────────┤
│                                                                 │
│  ┌──────────────┐    ┌──────────────┐    ┌──────────────┐       │
│  │   Modules    │    │  Structure   │    │  Behavior    │       │
│  │    Panel     │    │    Panel     │    │    Panel     │       │
│  │ (Palette)    │    │ (Tree View)  │    │ (Singularity)│       │
│  └──────────────┘    └──────────────┘    └──────────────┘       │
│                                                                 │
│  ┌─────────────────────────────────────────────────────────┐   │
│  │                    CANVAS AREA                           │   │
│  │  ┌─────────────────────────────────────────────────┐     │   │
│  │  │  CanvasSection (Recursive)                      │     │   │
│  │  │  ├── Template Regions                           │     │   │
│  │  │  ├── Flexbox Children                           │     │   │
│  │  │  └── Module Content                             │     │   │
│  │  └─────────────────────────────────────────────────┘     │   │
│  └─────────────────────────────────────────────────────────┘   │
│                                                                 │
│  ┌──────────────┐    ┌──────────────┐    ┌──────────────┐       │
│  │   Routes     │    │   Preview    │    │    Config    │       │
│  │    Panel     │    │    Mode      │    │    Panel     │       │
│  └──────────────┘    └──────────────┘    └──────────────┘       │
│                                                                 │
└─────────────────────────────────────────────────────────────────┘

Key Components

Universe Canvas Builder

The main orchestrator component that manages:

Canvas Section

Recursive component for visual layout:

Module Manager

UI for managing UniversalModules:

Behavior Panel

Singularity integration:

Route Tree Viewer

Navigation visualization:

Data Flow

User Action → CanvasSection → CanvasBuilder → UniverseModuleService → Backend
                   ↓
           CanvasModuleConverter
                   ↓
           UniversalModule[]
                   ↓
           UniverseRouteService → Routes[]

Integration Points

modularity-lib

singularity-lib

storage-system

editor-web-lib

Related Documentation

Quick Start

// Navigate to modular-universe
// http://localhost:5200/space/{spaceId}/modular-universe/universe/{universeId}

// The canvas loads with:
// 1. Left sidebar: Module palette, templates
// 2. Center: Canvas editing area
// 3. Right sidebar: Configuration panel
// 4. Bottom: Route tree, preview, structure tabs

Session History

Session Date Focus
11.25.2.6 Nov 26, 2025 Routes, Behavior Panel, Mobile Controls
11.25.2.5 Nov 25, 2025 Page Management System
11.25.2.4 Nov 24, 2025 Nested Template System