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:

  1. New deploy-bundle endpoint + PageDeploymentService + Deploy step Cloudflare target
  2. Direct Cloudflare API call from frontend
  3. 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


🔗 Related


Auto-generated by MCP Smart Consolidation