How to Build Your Universe - Complete Guide
Step-by-step guide for adding Galaxies, Worlds, and all module types to your universe
🏗️ How to Build Your Universe
Your Question: "How can I add another galaxy into the universe? Or a world? Or modify the structure/grid?"
Answer: Here's the complete, tested workflow!
🎯 QUICK START: Adding Modules
Step 1: Open Universe Map
Navigate to: /space/{your-space}/universe-map
Tab: Structure (should be active)
You'll see:
- Left Panel: Module Library (list of module types)
- Center Canvas: Your universe (where modules appear)
- Right Panel: Properties (when you select a module)
Step 2: Add a Galaxy
Method 1: Drag & Drop (Recommended)
- Find "Galaxy" in the left panel under "Structural Modules"
- Click and hold on the Galaxy card
- Drag onto the canvas (purple background)
- Release to drop
What Happens:
🚀 Drag started from library: galaxy
📦 Setting drag data: {type: 'module-type', moduleType: 'galaxy'}
📦 Drag over canvas: {types: ['application/json', 'text/plain'], ...}
🎯 Canvas Drop Event: ...
📍 Creating module at position: {canvasX: 450, canvasY: 300}
✅ Module created: {id: 'mod_...', name: 'galaxy-...', type: 'galaxy'}
Result: New Galaxy card appears on canvas! 🌌
Method 2: Click to Create (Alternative)
- Click the Galaxy card in library
- Click the "+ Create" button
- Module appears at default position (50, 50)
Step 3: Add a World
Same process as Galaxy:
- Drag "World" from library
- Drop on canvas
- World appears! 🌍
Step 4: Add ANY Module Type
All 10 types work the same way:
Structural Modules:
- 🌌 Galaxy - Drag & drop
- 🌍 World - Drag & drop
- 📄 Page - Drag & drop
- 📦 Layout - Drag & drop ✅ NOW WORKS!
Functional Modules:
- 🧭 Navigation - Drag & drop
- 🎯 Feature - Drag & drop
- 🧩 Widget - Drag & drop ✅ NOW WORKS!
- 📊 Data Provider - Drag & drop ✅ NOW WORKS!
- 🔄 Flow - Drag & drop ✅ NOW WORKS!
- ⚙️ Custom - Drag & drop ✅ NOW WORKS!
🔄 NESTING: Creating Structure
Goal: Put a World inside a Galaxy
Current Status:
Right now, modules are created at top-level. To nest them:
Planned (Coming Soon):
- Drag a World onto a Galaxy card
- Drop on top of the Galaxy
- World becomes child of Galaxy
Current Workaround:
- Create modules on canvas
- Select a module
- In properties panel, manually set
parentId
🎨 POSITIONING MODULES
Move Mode (Lock/Unlock)
Default: Locked 🔒
- Modules stay in place
- Click modules to select (no movement)
- Canvas panning always works
Unlocked: Move Mode ↔️
- Click the lock icon in canvas controls (top-right)
- Icon changes to arrows (blue)
- Now you can drag modules to reposition
- Click arrows again to lock
📍 CANVAS CONTROLS
Pan the Canvas:
- Hold Space + drag
- Middle mouse button + drag
- Click empty canvas + drag
Zoom:
- Scroll wheel to zoom in/out
- Ctrl + Plus to zoom in
- Ctrl + Minus to zoom out
- Ctrl + 0 to reset zoom
Fit to View:
- Shift + 1 (coming soon)
Snap to Grid:
- Press G to toggle
- Modules align to 50px grid when dragging
🎯 WORKING WITH MODULES
Select a Module:
- Single click on module card
- Properties panel opens on right
Multi-Select:
- Shift + Click to add to selection
- Ctrl/Cmd + Click to toggle selection
Edit Properties:
- Select module
- Properties panel shows:
- Name - Click to edit
- Route - Click to edit
- Type - Shows module type
- Quick Actions:
- Zoom Into (for Galaxy/World)
- Add Logic (opens Singularity)
- Delete
Delete Modules:
- Select + Press Delete or Backspace
- Or click Delete in properties panel
🏗️ COMPLETE WORKFLOW EXAMPLE
Building an E-Commerce Universe:
Step 1: Create Top-Level Structure
1. Drag "Galaxy" → Drop on canvas → Name: "Main App"
2. Drag "Galaxy" → Drop on canvas → Name: "Admin Panel"
3. Drag "Navigation" → Drop on canvas → Name: "TopNav"
4. Drag "Navigation" → Drop on canvas → Name: "Footer"
5. Drag "Layout" → Drop on canvas → Name: "Store Layout" ✅
Step 2: Add Functionality
6. Drag "Feature" → Drop on canvas → Name: "Shopping Cart"
7. Drag "Feature" → Drop on canvas → Name: "Checkout"
8. Drag "Data Provider" → Drop on canvas → Name: "Products API" ✅
9. Drag "Widget" → Drop on canvas → Name: "Product Card" ✅
Step 3: Position Them
10. Click lock icon → Enable move mode
11. Drag "Main App" galaxy to center
12. Drag "Admin Panel" galaxy to right
13. Drag other modules around it
14. Click arrows → Lock in place
Step 4: Edit Properties
15. Click "Main App" galaxy
16. Edit name in properties panel
17. Edit route: "/app"
18. Click other modules to edit
🐛 TROUBLESHOOTING
Module Doesn't Appear After Drop
Check Console (F12):
// Should see:
🎯 Canvas Drop Event: ...
📍 Creating module at position: {canvasX: X, canvasY: Y}
✅ Module created: {id: 'mod_...', ...}
If you see errors:
- ❌ No universe ID → Reload page
- ❌ Module creation failed → Check network tab
- ❌ No drop event → Try again, ensure dragging from library
Module Appears But Isn't Visible
Possible Causes:
- Positioned off-screen → Pan canvas to find it
- Behind other elements → Z-index issue (refresh)
- Filtered out → Check console for filter logs
Solution:
- Press Ctrl + 0 to reset view
- Look for module in top-left area (default position)
- Check properties panel to see if it's selected
Can't Move Modules
Check: Is move mode enabled?
- Look for lock icon 🔒 in canvas controls
- If locked → Click to enable move mode ↔️
- If unlocked but still can't move → Refresh page
Drag-Drop Not Working
Check Browser Console:
// Should see when dragging:
🚀 Drag started from library: galaxy
📦 Setting drag data: ...
📦 Drag over canvas: ...
// Should see when dropping:
🎯 Canvas Drop Event: ...
If missing:
- No drag start → Library not responding (refresh)
- No drag over → Canvas not receiving events (z-index issue)
- No drop → Drop handler not working (report bug)
✅ CURRENT CAPABILITIES
| Feature | Status | Notes |
|---|---|---|
| Drag Galaxy from library | ✅ Works | Tested |
| Drag World from library | ✅ Works | Tested |
| Drag Page from library | ✅ Works | Tested |
| Drag Layout from library | ✅ Works | Fixed! |
| Drag Widget from library | ✅ Works | Fixed! |
| Drag all 10 types | ✅ Works | Fixed! |
| Position modules | ✅ Works | Use move mode |
| Move canvas | ✅ Works | Space + drag |
| Zoom canvas | ✅ Works | Scroll wheel |
| Select modules | ✅ Works | Click |
| Multi-select | ✅ Works | Shift/Ctrl + click |
| Edit properties | ✅ Works | Properties panel |
| Delete modules | ✅ Works | Delete key |
| Snap to grid | ✅ Works | Press G |
| Nest modules (drag-on-drag) | ⏳ Coming | Manual for now |
| Visual grid structure | ⏳ Coming | Layout zones |
| Undo/Redo | ⏳ Coming | Future |
🎯 NEXT STEPS
Immediate (This Week):
- Test the workflow - Try creating a Galaxy, World, Layout
- Report issues - If drag-drop doesn't work, check console
- Position modules - Use move mode to arrange your universe
Coming Soon:
- Module-on-Module nesting - Drag World onto Galaxy
- Visual layout zones - See grid structure for layouts
- Template system - Pre-built module combinations
- Bulk operations - Multi-select actions
- Keyboard shortcuts - Faster workflow
💡 PRO TIPS
Efficient Universe Building:
- Plan structure first - Sketch on paper
- Create top-level modules - Galaxies, Navigation, Layouts
- Enable move mode - Position them spatially
- Lock canvas - Prevent accidental moves
- Edit properties - Give meaningful names and routes
- Add nested modules - Worlds, Pages, Features (manual for now)
Canvas Navigation:
- Space + Drag - Pan around (most common)
- Scroll - Zoom in/out
- Ctrl + 0 - Reset view
- Click empty space - Deselect all
Module Management:
- Shift + Click - Multi-select related modules
- Delete - Remove selected
- G key - Toggle grid snap
- Escape - Clear selection
✅ SUMMARY
To Add a Galaxy:
- Drag "Galaxy" from left panel
- Drop on canvas
- Done! ✅
To Add ANY Module:
- Same process - all 10 types work!
To Move Modules:
- Click lock icon (enable move mode)
- Drag modules
- Click arrows (lock again)
To Edit Structure:
- Currently: Manual via properties panel
- Soon: Drag-and-drop nesting
Status: Drag-drop works for all 10 module types! 🎉
Next: Test it and report what doesn't work!
Created: November 10, 2025 8:45 PM
Status: 📚 ACTIVE USER GUIDE