Thanks to visit codestin.com
Credit goes to github.com

Skip to content

kagehq/brail

Repository files navigation

Brail

Modern deployment platform with zero downtime and instant rollbacks. Deploy anywhere, no vendor lock-in.

Brail is like FileZilla for the modern web - push your sites to your own servers, cloud storage, or platforms like Vercel and Cloudflare. Full control, maximum flexibility.

Why Brail?

Most deployment platforms force you to choose between simplicity or flexibility:

Simple but locked-in (Vercel, Netlify)

  • ✅ Great developer experience
  • ❌ Vendor lock-in - can't easily switch
  • ❌ Limited to their infrastructure
  • ❌ Can't deploy to your own servers

Flexible but complex (Manual SSH/FTP)

  • ✅ Deploy anywhere you want
  • ❌ No safety guarantees or rollbacks
  • ❌ Manual processes, error-prone
  • ❌ No modern DevOps features

Brail gives you both

Deploy anywhere - Your servers, cloud storage, or any platform
Zero downtime - Atomic deployments with health checks
Instant rollbacks - One command to undo any deployment
Live patching - Update single files in seconds (unique to Brail)
No vendor lock-in - Switch platforms anytime, same workflow
Three interfaces - Web dashboard, CLI, or programmatic SDK

Start on Vercel, move to Cloudflare, then to your own SSH server - same commands, same workflow. Your deployment strategy stays flexible as your needs evolve.

Features

  • 13 Deployment Adapters - SSH, FTP, S3, Vercel, Cloudflare, Railway, Fly.io, Render, Netlify, GitHub Pages, and more
  • Zero Downtime - Atomic deployments with instant rollbacks
  • Live Patching - Update individual files without full redeployment
  • Programmatic SDK - Deploy in 3 lines of JavaScript/TypeScript
  • Templates - Pre-built sites ready to deploy (landing pages, portfolios)
  • Visual Adapter Builder - Create custom adapters in your browser
  • Sandboxes - Cloudflare & Vercel sandboxes for dynamic apps
  • Auto-Build - Detect and build Next.js, Astro, Vite, Nuxt, SvelteKit
  • Custom Domains - Auto-SSL via Let's Encrypt
  • Three Interfaces - Web dashboard, CLI, and SDK

Community & Support

Join our Discord community for discussions, support, and updates:

Discord

Quick Start

Local Development

# Install dependencies
pnpm install

# Start infrastructure (Postgres + MinIO)
docker compose up -d

# Generate encryption key for secrets
node scripts/generate-key.js
# Add to apps/api/.env: SECRET_KEY_256=<your-key>

# Run database migrations
pnpm db:migrate

# Start everything
pnpm dev

Open http://localhost:3001 to use the web interface.

Production Deployment

  • Database: Supabase (PostgreSQL)
  • Storage: DigitalOcean Spaces (S3-compatible)
  • Hosting: Railway (Dockerized)
  • Email: Resend (magic link authentication)

Installation

Brail is available as npm packages:

# CLI - Deploy from command line
npm install -g @brailhq/cli

# SDK - Programmatic deployments
npm install @brailhq/sdk

# Adapter Kit - Build custom adapters
npm install @brailhq/adapter-kit

# Scaffolder - Create new adapters
npx create-br-adapter my-adapter

Deploy Your Site

1. Web Interface (Easiest)

  1. Open http://localhost:3001
  2. Create a site
  3. Drag & drop your build folder
  4. Deploy! ✨

2. CLI

# Install
npm install -g @brailhq/cli

# Deploy
brail drop ./dist --site my-site --yes

3. SDK (Programmatic)

import { Brail } from '@brailhq/sdk';

const brail = new Brail({ apiKey: 'your-api-key' });

// Deploy a site
await brail.deploy({
  siteId: 'my-site',
  path: './dist',
  adapter: 'vercel',
  config: { token: 'xxx' }
});

// Or spin up a sandbox
const sandbox = await brail.createSandbox({
  provider: 'vercel-sandbox',
  path: './my-app',
  config: {
    token: 'vercel-token',
    runtime: 'node22'
  }
});
console.log('Sandbox URL:', sandbox.url);

→ See packages/sdk/README.md for full docs

Templates

Deploy pre-built sites in seconds:

# CLI
br templates use landing-page --name "My Site"

# SDK
await brail.deployTemplate({
  template: 'landing-page',
  siteName: 'my-site'
});

Available: Landing Page, Portfolio, Coming Soon

→ Web: http://localhost:3001/templates | Docs: templates/README.md

Configuration

Ignore Files

Create .dropignore to exclude files:

node_modules/
.git/
*.log

Environment Variables

Add via web interface (Environment tab) or CLI:

br env add --site my-site --key API_KEY --value secret

Available Adapters (13)

Traditional & Self-Hosted:

  • SSH/Rsync (zero-downtime, health checks)
  • FTP/FTPS

Storage & CDN:

  • S3 (AWS, MinIO, DigitalOcean Spaces)

Managed Platforms:

  • Vercel
  • Cloudflare Pages
  • Netlify
  • Railway
  • Fly.io
  • Render
  • GitHub Pages

Serverless & Edge:

  • Cloudflare Workers
  • Vercel Sandbox (Node.js, Python)
  • Cloudflare Sandbox (edge computing)

Build Your Own Adapter

Visual Builder (No Code): http://localhost:3001/adapter-builder

CLI:

npm create br-adapter

→ See docs/ADAPTER_SDK.md for guide

Live Patching

Update files instantly without redeployment:

br replace ./app.css --site my-site --dest /css/app.css --yes
br watch --site my-site --root ./dist --auto

Or use the Files tab in the web interface.

Development Tools

FlowScope Integration (Optional)

Debug API traffic with FlowScope - a visual HTTP request/response viewer:

# 1. Install FlowScope (one-time)
git clone https://github.com/kagehq/flowscope.git
cd flowscope && docker-compose up -d

# 2. Enable in Brail
echo "FLOWSCOPE_ENABLED=true" > apps/web/.env

# 3. View requests at http://localhost:4320

Documentation

Contributing

We welcome contributions! Fork, create a feature branch, and submit a PR.

License

FSL-1.1-MIT - See LICENSE for details.