Deploy
Run MRRocket on Cloudflare Workers with a Neon Postgres, with Clerk for login. The first deploy starts with an empty workspace: no demo data, you add your products with the wizard.
The long version, with every provider webhook and the list of public addresses, is docs/deploy.md in the repository. This page is the short path.
What you create#
| Where | What |
|---|---|
| Neon | one project, branch main for production (optionally staging), the pooled connection string |
| Clerk | one application, its publishable and secret key |
| Cloudflare | an R2 bucket mrrocket-uploads, two Workers (mrrocket and mrrocket-docs), a custom domain for each |
Deploy the cockpit#
Create the database tables#
In Neon open Connect, tick Connection pooling and copy the connection string (the host contains
-pooler). Then inprototype/web:export DATABASE_URL='postgres://...-pooler.../neondb?sslmode=require' npm run db:migrateThis creates the tables and an empty workspace. Run it again after every schema change (
npm run db:migrationswrites the new migration first).Set up login#
Create a Clerk application and copy its keys. Choose who is the owner with one var:
MRROCKET_OWNER_EMAILS(comma list) orMRROCKET_CLERK_ORG_ID. Without the keys, every protected address answers 503 "Authentication is not configured".Create the bucket and the secrets#
npx wrangler login npx wrangler r2 bucket create mrrocket-uploads npx wrangler secret put DATABASE_URL npx wrangler secret put MRROCKET_SECRET # openssl rand -base64 48, never change it later npx wrangler secret put CLERK_SECRET_KEY npx wrangler secret put CRON_SECRET # openssl rand -hex 32Provider keys (
ZERNIO_API_KEY,COMPOSIO_API_KEY,DATAFORSEO_LOGIN,RESEND_API_KEYand so on) go in the same way; see Platform providers..env.examplelists every variable.Deploy#
Put
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY(andNEXT_PUBLIC_DOCS_URL,NEXT_PUBLIC_APP_URL) into.env.production.local, then:npm run deployOpen the printed
workers.devaddress: you land on the sign-in page.Add the domains and set the addresses#
In the Cloudflare dashboard add a custom domain to the Worker. Then set the vars
APP_URL,MRROCKET_PUBLIC_URL,MRROCKET_OWNER_EMAILSandNEXT_PUBLIC_DOCS_URLinwrangler.jsonc, finish Clerk's domain setup, and deploy again.Register the webhooks#
Each provider calls
https://<your app>/api/webhooks/<provider>:zernio,composio,close,dataforseo,resend,instantly,billing(MRRocket's own Stripe billing;npm run billing:stripe-setupregisters it, seedocs/billing.md), and per productstripe/<productId>,revenuecat/<productId>and the other revenue sources. Every one verifies its own secret; unsigned calls are refused.Check the cron triggers#
Workers >
mrrocket> Settings > Triggers shows three schedules (every 10 minutes, hourly, daily). The logs show a[cron]line per job.Go through the onboarding#
Sign in. Until a product is set up, every page of the cockpit opens the first-run setup at
/welcome: your name, what you run, how far along it is and what the team should take on, then your website, which an agent reads into the product's name, one-liner, audience and category for you to confirm, then the connections, more products, a few optional questions about you, the plan (where billing is on) and your team. Settings stays reachable the whole time. To count your own onboarding in MRRocket's analytics, setMRROCKET_SELF_KEYto the MRRocket product's public key (andMRROCKET_SELF_HOSTwhen that product lives in another MRRocket; then also the secretMRROCKET_SELF_SERVER_KEY, the product's server key from its Sign-in settings, since server events need it).
Deploy the docs#
In prototype/docs run npm run deploy, then npx wrangler secret put OPENROUTER_API_KEY (or ANTHROPIC_API_KEY) for the "Ask the docs" box. Staging for both apps is npm run deploy:staging.
Never run npm run db:regen once a database exists. It rewrites the first migration. It is only for the moment before the very first deploy.