Deploy UI - Web Interface for Builds and Deployments

A web interface for starting builds and deployments from the browser.

URL

http://localhost:4000/auth/deploy.html

Features

1. Project Configuration

Field Description Required Default
Project Name Project name (slug format) Yes -
Target Platform www / ios / android Yes www

Build branch, license, and GraphQL schema min version are set automatically (branch from build-info, license always FREE, gqlSchemaMinVersion = 1).

2. Recipe JSON

Textarea for recipe JSON configuration:

{
  "components": {
    "header": {
      "type": "header",
      "config": {
        "title": "My App",
        "logo": "/logo.png"
      }
    },
    "footer": {
      "type": "footer",
      "config": {
        "copyright": "Copyright 2025"
      }
    }
  }
}

Validation:

3. GitHub Authorization (Optional)

Three modes are available:

Mode 1: No GitHub Deploy

Mode 2: Use Existing JWT Token

Example:

eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0eXBlIjoiZGVwbG95Ii...

Mode 3: Authorize with GitHub

Flow:

  1. Click "Authorize with GitHub OAuth"
  2. Popup opens /auth/github/start
  3. Complete GitHub authorization
  4. Select repository on /auth/success.html
  5. JWT is sent to the form via window.postMessage
  6. Popup closes automatically

Submit the Form

When you click "Start Build & Deploy":

  1. Validation

    • Recipe JSON is parsed
    • Required fields are checked
  2. Request creation

    POST /process
    Content-Type: application/json
    
    {
      "projectName": "my-app",
      "target": "www",
      "recipe": { ... },
      "githubJwt": "..." // optional
    }
    

    branch (current build branch), license: "FREE", and gqlSchemaMinVersion: 1 are inserted automatically.

  3. Result display

    • JSON response is shown
    • Status badge: queued / in-progress / canceling / canceled / done / error
    • Success or error messages are shown

Queue and Cancellation

Usage Examples

Example 1: Build without GitHub

  1. Set Project Name: my-awesome-app
  2. Select Target: www
  3. Paste recipe JSON
  4. Keep "No GitHub Deploy"
  5. Click "Start Build & Deploy"

Result: Tar archive download URL in the response

Example 2: Build with Existing JWT

  1. Fill project configuration
  2. Paste recipe JSON
  3. Select "Use Existing JWT Token"
  4. Paste JWT token into textarea
  5. Click "Start Build & Deploy"

Result: Build and publish to GitHub repository

Example 3: Build with OAuth

  1. Fill project configuration
  2. Paste recipe JSON
  3. Select "Authorize with GitHub"
  4. Click "Authorize with GitHub OAuth"
  5. In the popup:
    • Complete OAuth authorization
    • Select owner and repository
    • Adjust path if needed
    • Click "Generate JWT Token"
  6. JWT is inserted into the form
  7. Click "Start Build & Deploy"

Result: Build and publish to the selected GitHub repository

Technical Details

postMessage Integration

OAuth popup sends a message to the parent window:

window.opener.postMessage({
  type: 'github-jwt',
  jwt: 'eyJhbGci...'
}, window.location.origin);

Deploy form listens for messages:

window.addEventListener('message', (event) => {
  if (event.data.type === 'github-jwt') {
    document.getElementById('githubJwt').value = event.data.jwt;
    // Switch to JWT mode
    authJwt.checked = true;
    // Close popup automatically
    oauthWindow.close();
  }
});

Response Format

Successful build:

{
  "status": "done",
  "dataHash": "abc123...",
  "url": "abc123.42.pub",
  "publish": {
    "archive": {
      "status": "done",
      "url": "/dist/abc123/build.tar"
    },
    "github": {
      "status": "done",
      "repo": "owner/repo",
      "branch": "main",
      "commit": "def456..."
    }
  }
}

Error:

HTTP 400: Invalid recipe JSON

Security

URL Parameters

?example

Loads a sample recipe:

http://localhost:4000/auth/deploy.html?example

Integration with Other Pages

See Also