QUICK REFERENCE
Documentation for Sessions
Session 16.1 Quick Reference
🚀 What Changed
New Routes
/space/:spaceSlug/universe/:universeSlug/vibe → AI Platform Builder (universe-scoped)
/space/:spaceSlug/universe/:universeSlug/canvas → Universe Canvas (universe-scoped)
New Component
IntelligentInputComponent - Real-time autocomplete for platform descriptions
- Location:
libs/libs-structural/modularity-lib/src/lib/components/vibe-universe-generator/intelligent-input/ - Usage: Integrated into VibeUniverseGenerator
- Features: Industry detection, module suggestions, keyboard navigation
Enhanced Services
ModuleSuggestionsService
- New:
PlatformSuggestioninterface - New:
generatePlatformSuggestions(input: string)method - Detects 6 industries: restaurant, retail, healthcare, fitness, education, services
PlatformStateService
- New:
syncToMongoDB()method - New:
autoSyncToMongoDB()method - Uses existing
Universeinterface andRealtimeSyncService
ToolNavigationService
- Fixed: All routes now space-aware
- New:
getCurrentSpaceSlug()method - Injects:
UniverseContextService
ModularityIntegrationService
- Fixed: All navigation paths space-aware
- New:
getSpaceSlug()method - Injects:
UniverseContextService
Backend API
New Endpoint: POST /workflow/suggest
Request:
{
"input": "restaurant management system",
"context": {
"spaceId": "space-123",
"universeId": "universe-456"
}
}
Response:
{
"industries": ["restaurant"],
"modules": [...],
"entities": [...],
"confidence": 0.95
}
🔄 Navigation Flow
From Vibe to Universe
// In VibeUniverseGenerator
deployToUniverse() {
// Resolves universe context
const universeId = queryParams['universeId']
|| routeParams['universeSlug']
|| universeContext.universeId()
|| createNewUniverse();
// Navigates with context
integration.proceedToUniverse(moduleId, universeId);
}
From Universe to Workbench
// In ModularityIntegrationService
refineInWorkbench(moduleId: string) {
// Adds return context
router.navigate(['/space', spaceSlug, 'modularity', 'workbench', moduleId], {
queryParams: { returnTo: 'modular-universe', universeId }
});
}
From Workbench Back to Universe
// In ModuleWorkbench
returnToPreviousTool() {
const context = returnContext(); // From query params
toolNavigation.navigateTo(context.tool, {
universeId: context.universeId
});
}
🎨 Using IntelligentInput
In Your Component
import { IntelligentInputComponent } from './intelligent-input/intelligent-input.component';
import { PlatformSuggestion } from '@libs-structural/universe-map';
@Component({
imports: [IntelligentInputComponent]
})
export class YourComponent {
readonly description = signal('');
handleSuggestion(suggestion: PlatformSuggestion): void {
console.log('Selected:', suggestion.industry);
console.log('Modules:', suggestion.suggestedModules);
console.log('Entities:', suggestion.suggestedEntities);
}
}
In Your Template
<lib-intelligent-input
[(userInput)]="description"
[placeholder]="'Describe your platform...'"
[minChars]="3"
[debounceMs]="300"
(suggestionSelected)="handleSuggestion($event)"
/>
💾 MongoDB Sync Usage
Sync Platform to MongoDB
import { PlatformStateService } from '@libs-structural/modularity-lib';
// Manual sync
const universe = await platformState.syncToMongoDB();
// Auto-sync (Observable)
platformState.autoSyncToMongoDB().subscribe(universe => {
console.log('Synced:', universe);
});
What Gets Synced
{
id: platform.id,
spaceId: spaceId,
name: platform.name,
slug: 'generated-slug',
description: platform.description,
deploymentStatus: 'draft' | 'building' | 'deployed',
modules: [...], // Converted to UniversalModule[]
createdAt: Date,
updatedAt: Date
}
🐛 Troubleshooting
Routing Error: NG04002
Symptom: Cannot match any routes
Fix: Ensure using space-aware paths:
// ❌ Wrong
['/tools/modularity/workbench', moduleId]
// ✅ Correct
['/space', spaceSlug, 'modularity', 'workbench', moduleId]
Suggestions Not Appearing
Checks:
- Input length > 3 characters?
- Waited 300ms (debounce)?
ModuleSuggestionsServiceinjected?- Console errors?
Context Lost
Checks:
- Query params include
returnToanduniverseId? UniverseContextServicehas spaceSlug?PlatformStateServicetracking context?
📚 Key Files Reference
Frontend
| File | Purpose |
|---|---|
intelligent-input.component.ts |
Real-time autocomplete |
tool-navigation.service.ts |
Space-aware routing |
modularity-integration.service.ts |
Tool integration |
platform-state.service.ts |
Shared state + MongoDB sync |
module-suggestions.service.ts |
Platform suggestions |
Backend
| File | Purpose |
|---|---|
suggest.controller.ts |
REST API endpoint |
suggestion.service.ts |
Suggestion logic |
workflow.module.ts |
Module registration |
Routes
| File | Purpose |
|---|---|
app.routes.ts |
Universe-scoped routes |
modularity.routes.ts |
Modularity tool routes |
modular-universe.routes.ts |
Universe canvas routes |
🎯 Testing Commands
# Start servers
yarn dev:gograb # Frontend on :5200
yarn serve:backend-ai # Backend on :3000
# Test routing
open http://localhost:5200/space/chrome-space-1/vibe
open http://localhost:5200/space/chrome-space-1/universe/test/vibe
# Test backend API
curl -X POST http://localhost:3000/workflow/suggest \
-H "Content-Type: application/json" \
-d '{"input": "restaurant management"}'
✅ Completion Checklist
- Routing errors fixed
- Universe slug-based routes added
- IntelligentInputComponent created
- ModuleSuggestionsService extended
- VibeUniverseGenerator enhanced
- Module Workbench return context added
- PlatformStateService MongoDB sync added
- Backend suggestion API created
- All existing interfaces reused (no duplication)
- Documentation complete
- MCP decisions logged
Session 16.1: COMPLETE ✅