Betterflow is a standard Next.js 16 application and can be deployed to any platform that supports Node.js. Vercel is the recommended target because it has native Next.js support — serverless functions, edge caching, and environment variable management are all handled out of the box with zero extra configuration. A Docker path is also supported for teams that need a self-hosted or containerized deployment.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/betterspacx/app/llms.txt
Use this file to discover all available pages before exploring further.
Vercel (Recommended)
Vercel detects Next.js projects automatically and applies optimal defaults for the App Router, server components, and API routes. No additionalvercel.json configuration is needed beyond
what ships in the repository.
Push your code to GitHub
Make sure the Betterflow repository (or your fork) is pushed to a GitHub, GitLab, or Bitbucket
account that Vercel can access.
Import the project in the Vercel dashboard
Log in to vercel.com, click Add New → Project, and select your
repository from the list. Vercel will automatically detect the Next.js framework.
Confirm build settings
Vercel auto-detects all three settings below. Verify they match before continuing:
| Setting | Value |
|---|---|
| Framework Preset | Next.js |
| Build Command | pnpm run build |
| Output Directory | .next |
The repository uses
pnpm. If Vercel does not detect it automatically, set the Install
Command to pnpm install in the project settings.Set environment variables
In the Environment Variables section of the import screen (or later under Settings →
Environment Variables), add every variable your deployment needs. At minimum:If you have R2 configured, add the full set:See the Environment Variable Reference for the
complete list including optional analytics and SEO variables.
Deploy
Click Deploy. Vercel will install dependencies with
pnpm, run pnpm run build, and
publish the result. Subsequent pushes to the main branch trigger automatic redeployments.Once the deploy finishes, open the assigned .vercel.app URL (or your custom domain) to
confirm the editor loads correctly.Function Timeouts
Thevercel.json in the repository configures a 10-second max duration and 1 024 MB memory
for the screenshot API route (app/api/screenshot/route.ts), which calls an external screenshot
service:
vercel.json with an
appropriate maxDuration value.
Docker
Betterflow supports containerized deployment for self-hosted environments. Build the production image from the repository root using the standard Next.js standalone output:Production Checklist
Before directing real traffic to your deployment, confirm the following:Required before going live:
- ✅
NEXT_PUBLIC_SITE_URLis set to your production domain (notlocalhost). - ✅ All Cloudflare R2 variables are set if you want the background gallery and Chrome extension uploads to work.
- ✅ R2 bucket CORS policy allows your production origin.
- ✅
NEXT_PUBLIC_POSTHOG_KEYis set (or intentionally left blank to disable analytics). - ✅ Build completes without errors (
pnpm run buildlocally before pushing).