Skip to content

feat: Real Vercel deployment behind Publish button #55

@Delqhi

Description

@Delqhi

Problem

The Publish button in the workspace header (WorkspaceHeader component) is currently a no-op. Clicking it does nothing. The user expects to deploy the generated application to a live URL, just like v0 does.

Goal

Implement real Vercel deployment integration behind the Publish button. When a user clicks Publish, the system should:

  1. Build the target application (the one the agent is working on)
  2. Create a Vercel deployment
  3. Show deployment status in the UI
  4. Provide a live preview URL

Acceptance Criteria

  • Clicking Publish triggers a Vercel deployment
  • Deployment status is shown (building, ready, error)
  • Live URL is displayed and copyable
  • Deployment history is tracked per workspace
  • Environment variables can be configured per deployment
  • Production vs Preview deployments are distinguishable
  • Deploy button works from both Preview tab and Design mode

Files to modify / create

New files

lib/vercel/client.ts                # Vercel API client (REST API wrapper)
lib/vercel/deploy.ts                # Deployment logic: build → create deployment
app/api/workspace/deploy/route.ts   # POST /api/workspace/deploy — trigger deployment
app/api/workspace/deployments/route.ts # GET /api/workspace/deployments — list history
components/workspace/deploy-status.tsx # Deployment status indicator (spinner, progress, URL)
components/workspace/deploy-history.tsx # List of past deployments

Files to modify

components/workspace/workspace-header.tsx   # Wire onPublish to real deployment API
components/workspace/preview-panel.tsx      # Add deploy button or status overlay
components/workspace/workspace.tsx          # Pass deployment state through

Technical Notes

  • Vercel API requires VERCEL_TOKEN environment variable
  • Use the vercel npm package or direct REST API calls
  • Build process: The target app (in SIN_WORKSPACE_DIR) must be built (e.g., next build or npm run build)
  • Deployment target: Either Vercel CLI (vercel --yes) or API (POST /v13/deployments)
  • The deployment should include the built output, not the source code
  • Store deployment metadata (URL, status, createdAt) in .sin-webui/deployments.json

Out of Scope (per AGENTS.md)

This feature is explicitly listed as "out of scope" in AGENTS.md: "Real Vercel deploys go through Docker + Cloudflare Tunnel (see PLAN_DEPLOY.md)." This issue supersedes that decision for users who want Vercel integration.

Related

  • AGENTS.md §8: Real Vercel-Deploy is out of scope (Docker + Cloudflare Tunnel preferred)
  • PLAN_DEPLOY.md: Existing self-hosting guide
  • components/workspace/workspace-header.tsx: Publish button (currently no-op)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions