Architecture: How to deploy compiled preview output to production without ...

Documentation for Sessions

🏗️ Architecture: How to deploy compiled preview output to production without ...

Date: 2026-03-11
Time: 23:37:10 UTC
Session: gspace1-205.4
Agent: backend
Confidence: 93%
Status: ✅ Documented


📋 Decision Context

Question:

How to deploy compiled preview output to production without a CI pipeline (instant publish)?

Task: Not specified


🎯 Decision Made

Chosen:

InstantPublishService reads BundlerService.compiledAssets() signal, converts Map<string, Uint8Array> to base64-encoded file array, POSTs to backend-vitto-api POST /studio/deploy/instant endpoint, which decodes and passes to existing CloudflarePagesService.uploadFiles(). Zero GitLab CI, zero ng build on server — compiled output goes directly from browser to Cloudflare Pages.

Options Considered:

  1. Git push + GitLab CI pipeline — standard but 3-5 min delay
  2. Backend ng build + Cloudflare upload — requires server compute
  3. Direct Cloudflare Pages API from browser — CORS issues, API key exposure
  4. InstantPublishService via backend proxy to Cloudflare — reuses existing CloudflarePagesService

💭 Reasoning

The user wants instant publish — clicking a button and getting a live URL in seconds. GitLab CI adds 3-5 minutes. Backend ng build adds server cost. Direct browser-to-Cloudflare has CORS issues and exposes API keys. The chosen approach reuses the existing CloudflarePagesService.uploadFiles() (already tested and working for S200 deployments) by adding a thin POST /studio/deploy/instant endpoint that accepts pre-compiled files. The frontend converts Uint8Array assets to base64, the backend decodes and passes to Cloudflare. Total latency: ~2-5 seconds for typical bundle sizes. Backend endpoint already created at APIs/backend-vitto-api/src/app/studio/studio-deploy.controller.ts.


📁 Files Involved


🔗 Related


Auto-generated by MCP Smart Consolidation