Launch time!
Complete guide to deploying your Next.js application.
Deployment Checklist
1. Google Authentication Setup
- Google Cloud Console: Create OAuth 2.0 Client IDs for web applications.
- Credentials: Obtain
GOOGLE_CLIENT_ID
andGOOGLE_CLIENT_SECRET
. - Environment Variables: Add
GOOGLE_CLIENT_ID
andGOOGLE_CLIENT_SECRET
to your Vercel project's environment variables (Production, Preview, Development). - Authorized redirect URIs: Set the correct redirect URI in Google Cloud Console (e.g.,
https://yourdomain.com/api/auth/callback/google
). Ensure this matchesNEXTAUTH_URL
.
2. Stripe Deployment Checklist
- Turn OFF Test Mode in your Stripe Dashboard
- In your [Developers], copy your public & private keys and add them to
STRIPE_SECRET_KEY
&STRIPE_PUBLIC_KEY
in your production environment variables. In developers/webhook
- Add Enpoint
- Set your domain
- Set
/api/webhook/
. Select [checkout.session.completed] event, copy the signing secret and add it toSTRIPE_WEBHOOK_SECRET
in your production environment variables. - In settings/customers-emails, activate emails for successful payments & refunds
3. Vercel Setup
We'll only deploy to Vercel in this, since it's just work the best.
- Create a project with the associated git repository.
- Go to your project and
settings/environment variables
and copy your.env
file- Replace
STRIPE_SECRET_KEY
with your production stripe key. - Replace
STRIPE_WEBHOOK_SECRET
with your production stripe key. - Replace
RESEND_API_KEY
with your production stripe key. - Replace
NEXT_PUBLIC_GOOGLE_CLIENT_ID
with your production google app. - Replace
GOOGLE_CLIENT_SECRET
with your google secret app. - Replace
DATABASE_URL
with your Production Database URLs - Replace
DIRECT_URL
with your Production database URLs - Go over
Build and Deployment
and override the build command withbunx prisma generate && bunx prisma migrate deploy && next build
- Replace
- Re-deploy your app and everything should work!
This checklist provides a basic overview. Refer to specific service documentation for detailed instructions.