Skip to main content

Start with these two checks

Before you debug further, run:
npm run env:check
and inspect:
GET /api/health
Those two checks are usually enough to tell you whether the issue comes from env config, feature toggles, or database connectivity.

Common issues

Check NEXT_PUBLIC_SUPABASE_URL and NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY.If auth is intentionally not part of the product yet, set:
NEXT_PUBLIC_ENABLE_AUTH=false
This usually means SUPABASE_SERVICE_ROLE_KEY is missing. Billing, webhooks, signed avatar URLs, audit logs, admin reporting, and persistent rate limits all depend on it.
Check:
  • NEXT_PUBLIC_ENABLE_PAYMENTS
  • PAYMENT_PROVIDER
  • your Midtrans or Doku credentials
  • the payments and subscriptions migrations
This usually means the webhook never arrived, the webhook URL is wrong, or signature verification failed. Check the correct webhook route and confirm the production domain is set correctly.
Check RESEND_API_KEY, EMAIL_FROM, and optionally CONTACT_EMAIL. Make sure the sender domain is verified in Resend.
503 usually means the provider is not configured. 429 usually means a usage limit or request rate limit has been reached.
Make sure the user exists in user_roles with the admin role. ADMIN_EMAILS only helps with the initial bootstrap.
Install the browser first:
npx playwright install chromium

AI prompt you can use right away

Help me diagnose this KilatKoding issue:

Symptoms:
[describe the error, failing endpoint, or incorrect behavior]

Context:
- Environment: [local / staging / production]
- Active features: [describe the active toggles]
- Payment provider: [midtrans / doku / not used]
- AI provider: [openai / anthropic / not used]
- Recent changes: [describe what you changed]

Please give me:
1. The 3 to 5 most likely root-cause hypotheses
2. The fastest inspection order
3. Which files, env vars, tables, or routes I should inspect
4. How to separate the main root cause from side symptoms
5. The safest fix path

Fast diagnosis checklist

SymptomFirst thing to check
Many features show disabled or fallback states.env.local and npm run env:check
Login redirects behave strangelySupabase redirect URLs and auth callback configuration
Admin data is emptyService role env and admin role assignment
Payments never finalizeWebhook URL and signature verification
Avatar uploads failStorage migration and service role env
Contact form failsResend key and verified sender domain

When to check the database directly

Look at the database directly if the issue involves:
  • user roles,
  • subscription status,
  • payment records,
  • audit trail,
  • webhook event logs.
The most likely tables to inspect are user_roles, subscriptions, payments, audit_logs, and webhook_events.

When to inspect code

Go into the code if:
  • env values look correct but the behavior is still wrong,
  • you recently changed config/*,
  • you edited a route handler or dashboard component,
  • you added a new integration on top of the existing patterns.
If you are doing a large rebrand, some issues that look like bugs are really just copy, navigation, or feature-toggle mismatches that have not been aligned yet.