Skip to Content
LaunchfastDocs

Manual setup

Set up every service by hand instead of running npm run setup.

Prefer not to use the script, or need to fix one value? Copy the example file and fill it in:

cp .env.example .env.local

See Environment variables for every variable.

Database

Create a project at console.neon.tech. On the project dashboard, click Connect, copy the connection string, and paste it into DATABASE_URL.

Auth secret

openssl rand -base64 32

Paste the result into BETTER_AUTH_SECRET. On Windows without OpenSSL, use node -e "console.log(require('crypto').randomBytes(32).toString('base64'))".

Dodo Payments

In app.dodopayments.com, in Test mode:

  1. Developer → API Keys → Add API Key (with write access). Paste it into DODO_PAYMENTS_API_KEY and set DODO_PAYMENTS_ENVIRONMENT=test_mode.
  2. Products → Create product for each plan in src/config.ts: same price and currency; a subscription for plans with an interval, one-time for interval: null. Paste each product ID (pdt_…) into that plan's productEnv variable, such as DODO_PRODUCT_PRO.
  3. Developer → Webhooks → Add endpoint with https://<your-domain>/api/webhooks/dodo. Paste its signing secret into DODO_PAYMENTS_WEBHOOK_SECRET. For local testing, see Testing payments locally.

Social sign-in (optional)

Create a Google and/or GitHub OAuth app with the URLs in Google and GitHub sign-in, and fill in the client IDs and secrets.

Email (optional locally)

Add a domain at resend.com/domains, add its DNS records, and wait until it's verified. Then set RESEND_API_KEY and EMAIL_FROM, for example EMAIL_FROM="Your Product <hello@yourdomain.com>".

Create the tables and start

npm run db:migrate
npm run dev

Deploying by hand

  1. Import the repository at vercel.com/new.
  2. Add every variable from .env.local under Settings → Environment Variables, with NEXT_PUBLIC_APP_URL set to your real address.
  3. Run npm run db:migrate against the production database, if it's not the one you use locally.
  4. Register https://<your-domain>/api/webhooks/dodo as a webhook in Dodo, in the same mode as your API key, and set DODO_PAYMENTS_WEBHOOK_SECRET.
  5. Optionally add { "regions": ["sin1"] } (your database's region) to vercel.json. See Function region.
  6. Redeploy.

On this page