Deployment
Deploy your NimBuild Starter app to production.
Prerequisites
Before deploying, ensure you have:
- PostgreSQL database
- Stripe account and API key
- Resend API key and verified sending domain
- Firebase project and service account credentials
- Volcengine API credentials for AI tools
- (Optional) Cloudflare R2 or S3-compatible storage
Deploy
1. Database Migration
After first deploy:
pnpm db:push2. Configure Webhook
In Stripe Dashboard, set webhook URL:
https://your-domain.com/api/payments/stripe/webhook3. Set Up Cron Job
For annual subscription credit grants, configure a cron job to call hourly:
curl -H "Authorization: Bearer YOUR_CRON_SECRET" \
https://your-domain.com/api/cron/subscription-grantsFor expiring credit buckets, configure a second cron job:
curl -H "Authorization: Bearer YOUR_CRON_SECRET" \
https://your-domain.com/api/cron/credit-expiry4. Create Admin Account
ADMIN_EMAIL=admin@example.com pnpm admin:setup5. Verify Environment
Make sure production .env has correct values for:
NEXT_PUBLIC_APP_URL— Your actual domainNEXT_PUBLIC_FIREBASE_AUTH_DOMAIN— Your Firebase Auth domainFIREBASE_CLIENT_EMAILandFIREBASE_PRIVATE_KEY— Firebase Admin service account credentialsRESEND_API_KEY— Resend API keyRESEND_FROM_EMAIL— Verified sender address for transactional emailRESEND_REPLY_TO— Optional default reply-to addressVOLCENGINE_API_KEY,VOLCENGINE_BASE_URL, andVOLCENGINE_MODEL— AI tool provider settingsCRON_SECRETorCRON_JOBS_USERNAME+CRON_JOBS_PASSWORD— Cron authentication
Post-Deploy Checklist
- Database migrated
- Webhook URL configured in Stripe
- Cron jobs set up for subscription grants and credit expiry
- Admin account created
- Resend sending domain verified for production email
- Firebase authorized domains include the production domain
- Volcengine AI provider credentials configured
- Analytics keys configured if used