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.localSee 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 32Paste 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:
- Developer → API Keys → Add API Key (with write access). Paste it into
DODO_PAYMENTS_API_KEYand setDODO_PAYMENTS_ENVIRONMENT=test_mode. - Products → Create product for each plan in
src/config.ts: same price and currency; a subscription for plans with aninterval, one-time forinterval: null. Paste each product ID (pdt_…) into that plan'sproductEnvvariable, such asDODO_PRODUCT_PRO. - Developer → Webhooks → Add endpoint with
https://<your-domain>/api/webhooks/dodo. Paste its signing secret intoDODO_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 devDeploying by hand
- Import the repository at vercel.com/new.
- Add every variable from
.env.localunder Settings → Environment Variables, withNEXT_PUBLIC_APP_URLset to your real address. - Run
npm run db:migrateagainst the production database, if it's not the one you use locally. - Register
https://<your-domain>/api/webhooks/dodoas a webhook in Dodo, in the same mode as your API key, and setDODO_PAYMENTS_WEBHOOK_SECRET. - Optionally add
{ "regions": ["sin1"] }(your database's region) tovercel.json. See Function region. - Redeploy.