Why Vercel is the most natural path
KilatKoding uses Next.js App Router without a custom server requirement. Because of that, Vercel is usually the fastest deployment path, especially if you want preview deployments, custom domains, and clean env management.Before you begin
Make sure these are already true:- the repo can build locally,
npm run env:checklooks correct for the active features,- the production domain is already chosen,
- provider accounts such as Supabase, Midtrans, Doku, Resend, and the AI provider are ready if used.
Deployment steps
1
Create a Vercel project
Import the KilatKoding repo into Vercel. The default Next.js build command and output are usually detected automatically.
2
Fill environment variables
Copy the relevant env values from
.env.local or another secure source into Vercel. Focus only on the features that stay active.3
Set NEXT_PUBLIC_APP_URL to the production domain
Do not leave it as
http://localhost:3000. This value is used for metadata, callbacks, and order URLs.4
Run the first deployment
Deploy and make sure the build succeeds.
5
Attach the production domain
After the domain is active, redeploy if needed so the live URL is fully consistent.
Env groups that are usually needed
After deployment, do not forget provider-side config
Supabase
Supabase
Add these production URLs in redirect configuration:
Midtrans
Midtrans
Register the production webhook:Make sure the user return URL still points to your order page.
Doku
Doku
Register the production webhook:
Resend
Resend
Verify the sender domain and make sure
EMAIL_FROM uses a verified domain.Post-deploy validation
At minimum, check:- the homepage loads,
- login and signup work,
/dashboardopens for a logged-in user,/dashboard/billingworks if payments are active,/adminis reachable for admins if admin is active,GET /api/healthmatches expectations,- one sandbox payment and one webhook test succeed if payments are active.
Most common gotchas
Preview deployment vs production
Preview deployments are great for UI review, but:- do not use a preview URL as the final auth callback,
- do not use a preview URL as the final payment webhook target,
- use previews for layout and copy review, not as permanent integration endpoints.