Skip to content

Deployment

Launch on your database, domain and hosting account.

Supported deployment target

The documented target is Node 24, Next.js on Vercel, and Neon PostgreSQL. Local PostgreSQL also supports development and CI. This is a Node server application with interactive transactions; static export, edge-only execution, SQLite, and generalized database portability are unsupported.

Use your own hosting, database, provider projects, and domain. The FoundryLayer production project, connected accounts, secrets, and operational repository settings are not included.

Prepare your independent release

  1. Extract the verified source archive, initialize a private Git repository, and commit the delivered files. The archive has no Git history or Vercel project link.
  2. Create an independent empty Neon database. Use its pooled URL for the web runtime; use a direct URL for migration if your database policy requires it. Keep remote TLS verification enabled.
  3. Create a Vercel project from your repository. Set Root Directory to apps/web and include files outside the root directory so workspace packages and documentation are available.
  4. Use Node 24.x, install with pnpm install --frozen-lockfile, build with pnpm --filter @foundrylayer/web build, and retain the Next.js framework/output defaults. The lockfile pins the workspace toolchain.
  5. Configure the production environment values from configuration. Use FOUNDRYLAYER_SITE_MODE=application, your brand, and the final HTTPS BETTER_AUTH_URL. Production email needs your Resend domain, key, sender, and stable encryption key. Use separate secrets/databases for previews.

Migrate before serving traffic

From your release checkout, using an ignored file containing only your intended deployment database:

Code

pnpm exec dotenv -e .env.deploy -- pnpm --filter @foundrylayer/db migrate
pnpm exec dotenv -e .env.deploy -- pnpm --filter @foundrylayer/db migrate

Migrations are a separate controlled release step; application requests never migrate. Applied migrations are immutable. Do not deploy an application version expecting new tables before migrations finish. Back up your database before updating an existing application. A code rollback cannot undo an incompatible data migration automatically.

Configure the domain and providers

Set the exact final HTTPS origin in Better Auth, and configure the auth handler behind a proxy that overwrites its trusted client-IP header. Verify the deployment’s trusted-proxy/IP-header policy before public traffic. Without a usable IP, Better Auth shares a rate-limit bucket; that is fail-closed behavior, not per-customer acceptance.

Enable your own Stripe test webhook and portal if subscriptions are in scope. Complete each enabled Composio Connect flow from the final origin. Keep auth-token URLs out of application, proxy, and analytics logs. Never expose database/provider keys through browser variables.

Schedule .github/workflows/operational-recovery.yml in your new repository with RECOVERY_ORIGIN set to your exact HTTPS app origin and repository secret RECOVERY_CRON_SECRET matching runtime CRON_SECRET. It invokes the bounded AI/integrations/email endpoints about every 15 minutes. GitHub schedules can be delayed; choose an operator scheduler appropriate to your uptime needs. Configure the equivalent authenticated calls if you do not use GitHub Actions.

Verify the deployed application

Use a fresh account and synthetic data on your independent database:

  • Create an account, receive a real verification email, and sign in after verification.
  • Create an organization and confirm another account cannot access it.
  • Fund the personal test workspace through your operator command, run a real General task, and reload the same persisted answer and usage.
  • In Stripe test mode, buy your recurring workspace plan and observe exactly one signed webhook allowance. Cancel and check current subscription state and access. A redirect alone proves nothing.
  • For enabled integrations, connect, make a read-only request, inspect normalized sources, and disconnect/reconnect. Exercise a sensitive mutation only on a designated test account with an exact approval and explicit authorization.
  • Observe a real scheduled recovery invocation and persisted job results; ensure uncertain actions are not replayed.
  • Inspect mobile layout, session cookies, logs, and production build behavior.

Do not accept customers merely because Vercel produced a URL. Record these checks, classify fixture/sandbox/live evidence, and state every unverified gate. Validation of another deployment does not certify your installation.

Generic Node hosting

pnpm build then pnpm start runs the same Node application. Supply environment variables at runtime, configure HTTPS/proxy forwarding, and schedule recovery. No Docker image, production container acceptance, one-click installer, or non-Vercel hosted proof is included in this release.

Explore in context