Architecture: How to make platform builder generated code actually work (f...

Documentation for Sessions

🏗️ Architecture: How to make platform builder generated code actually work (f...

📋 Decision Context

Question:

How to make platform builder generated code actually work (forms save, actions execute, data persists)?

Task: Session 45.1: Complete Platform Builder Integration - Make generated code actually work


🎯 Decision Made

Chosen:

Created a comprehensive data layer with 8 new services: UniverseDataService, EntityStateService, ActionExecutorService, RealtimeEntityService, PreviewRuntimeService, OfflineQueueService, ConflictResolutionService, and updated module-code-generator to generate working actions

Options Considered:

  1. Generate new backend APIs per module
  2. Create frontend services using existing Data Controller
  3. Use external BaaS (Firebase/Supabase)

💭 Reasoning

The backend infrastructure already existed (Data Controller, WebSocket gateway, MongoDB) but generated code wasn't using it. Rather than generate new backend code for each module, the solution creates frontend services that leverage existing backend APIs. This approach: 1) Uses existing /data/:collection endpoints for all entity CRUD, 2) Integrates flash persistence for offline-first caching, 3) Provides sandbox/live preview modes for safe testing, 4) Auto-generates working CRUD actions instead of TODO stubs, 5) Supports offline queue with conflict resolution for enterprise use cases.


📁 Files Involved


🔗 Related


Auto-generated by MCP Smart Consolidation