Setup guide

Deploy Flint in 20 minutes

Everything you need to go from clone to a live SaaS on Cloudflare.

1. Clone & install

  1. git clone https://github.com/flint-dev/flint.git my-app
  2. cd my-app && npm install

2. Cloudflare setup

  1. 1.Create a free Cloudflare account at cloudflare.com
  2. 2.Create a D1 database: wrangler d1 create flint-db
  3. 3.Create an R2 bucket: wrangler r2 bucket create flint-storage
  4. 4.Create a KV namespace: wrangler kv namespace create CACHE
  5. 5.Update wrangler.toml with your database_id and kv namespace id
  6. 6.Run migrations: npm run db:migrate

3. Environment secrets

  1. wrangler secret put BETTER_AUTH_SECRET # random 32-char string
  2. wrangler secret put GOOGLE_CLIENT_ID
  3. wrangler secret put GOOGLE_CLIENT_SECRET
  4. wrangler secret put STRIPE_SECRET_KEY
  5. wrangler secret put STRIPE_WEBHOOK_SECRET
  6. wrangler secret put RESEND_API_KEY

4. Stripe configuration

  1. 1.Create three products in the Stripe dashboard: Pro ($29/mo), Lifetime ($249 one-time), and Flint kit ($149 one-time)
  2. 2.Copy the price IDs into wrangler.toml [vars] as NEXT_PUBLIC_STRIPE_PRO_PRICE_ID, NEXT_PUBLIC_STRIPE_LIFETIME_PRICE_ID, NEXT_PUBLIC_STRIPE_KIT_PRICE_ID, and STRIPE_KIT_PRICE_ID
  3. 3.Set up a webhook endpoint pointing to https://your-domain.com/api/stripe/webhook
  4. 4.Enable events: checkout.session.completed, customer.subscription.created/updated/deleted

5. Package the sellable kit

  1. npm run package:kit
  2. npx wrangler r2 object put flint-storage/kit/flint-latest.zip --file dist/flint-latest.zip
  3. Keep KIT_DOWNLOAD_KEY set to kit/flint-latest.zip unless you upload to a different R2 key

6. Google OAuth

  1. 1.Go to console.cloud.google.com → APIs & Services → Credentials
  2. 2.Create an OAuth 2.0 client ID (Web application)
  3. 3.Add authorized redirect URI: https://your-domain.com/api/auth/callback/google
  4. 4.Copy Client ID and Secret → wrangler secret put GOOGLE_CLIENT_ID / GOOGLE_CLIENT_SECRET

7. Deploy

  1. npm run check
  2. npm run build:cloudflare
  3. npm run deploy # deploys to Cloudflare Workers
  4. Your app is live — no servers, no monthly bill until you scale

Need help? Join the Discord community or open a GitHub issue.