Architecture: How should the Deploy step send generated code to Cloudflare...
Documentation for Sessions
🏗️ Architecture: How should the Deploy step send generated code to Cloudflare...
Date: 2026-02-06
Time: 02:19:01 UTC
Session: editor2-95.6
Agent: angular
Confidence: 90%
Status: ✅ Documented
📋 Decision Context
Question:
How should the Deploy step send generated code to Cloudflare Pages?
Task: P0-B: Wire Page Builder export → Deployment upload API
🎯 Decision Made
Chosen:
New POST /:tenantId/deploy-bundle endpoint on backend-api accepts pre-built {name, html, css, js, manifest, environment} bundles. DeploymentService.deployBundle() creates MongoDB record, emits WebSocket progress, uploads to Cloudflare. Frontend PageDeploymentService wraps the HTTP call. Deploy step component adds Cloudflare Pages as a target alongside NX Library, Local, Download. Generates index.html landing page if not present in bundle.
Options Considered:
- New deploy-bundle endpoint + PageDeploymentService + Deploy step Cloudflare target
- Direct Cloudflare API call from frontend
- Extend existing deployment config flow
💭 Reasoning
The existing DeploymentService already handles Cloudflare uploads and MongoDB tracking. Rather than duplicating that logic, we created a new entry point (deploy-bundle) that accepts pre-built bundles directly (as opposed to the existing flow which builds from a deployment config). This keeps the existing deployment infrastructure intact while adding the new code-to-deployment path. The frontend PageDeploymentService is a thin HTTP wrapper that matches the existing service patterns in page-builder.
📁 Files Involved
apis/backend-api/src/app/deployment/deployment.controller.tsapis/backend-api/src/app/deployment/deployment.service.tslibs/libs-structural/page-builder/src/lib/services/page-deployment.service.tslibs/libs-structural/modularity-lib/src/lib/components/steps/deploy-step/deploy-step.component.ts
🔗 Related
- Decision ID:
dev_1770344341276_0g6okbx - Session: 95
- Workspace: editor2
Auto-generated by MCP Smart Consolidation