Skip to content

Latest commit

 

History

History
72 lines (50 loc) · 2.44 KB

File metadata and controls

72 lines (50 loc) · 2.44 KB

Runbook

Operational quick reference for live nipcode.xyz.

Surfaces

Surface URL Provider
Landing + docs + account https://nipcode.xyz Vercel
Production API https://nipcode.xyz/api/* Vercel functions
Auth + DB Supabase project ygsgmhuxqjnwzgzzjrke Supabase
Domain nipcode.xyz NameSilo

Incident triage

Symptom: landing 5xx

  1. Check Vercel deployment status: vercel inspect https://nipcode.xyz
  2. Roll back if needed: vercel rollback
  3. Check DNS: dig +short A nipcode.xyz @1.1.1.1. Should return 216.150.1.1

Symptom: /api/decision returns 500 or empty best

  1. Check OpenAI status (gpt-4o-mini outage is the most common cause)
  2. Decision endpoint falls back to heuristic ranking if LLM is unavailable; verify by curl with q=react&sources=npm&limit=1
  3. Check Vercel function logs

Symptom: login fails with Invalid or expired code

  1. Check Supabase auth.users. Was the user even created? select * from auth.users order by created_at desc limit 5;
  2. Check rate limit. Free tier: 4 emails/hour built-in SMTP.
  3. Confirm OTP length matches: Supabase Auth → Providers → Email → OTP Length should match what's in user's email.
  4. If Email Confirmation is ON, signInWithOtp uses signup-confirm flow not magic-link OTP. Disable it for the OTP UX we want.

Symptom: /api/auth/verify 401 with valid code

The verify.js tries email, magiclink, recovery, signup types in order. If all fail, the token is genuinely expired or wrong. Ask user to request a fresh code.

Redeploy

cd ~/Projects/nipcode
vercel --prod --yes

Cache: Vercel edge caches /api/* for 60s public, 300s s-maxage. Force-bust by varying query params or wait.

Database

# accounts count
curl -s "https://ygsgmhuxqjnwzgzzjrke.supabase.co/rest/v1/accounts?select=count" \
  -H "apikey: $SUPABASE_SERVICE_KEY" \
  -H "Prefer: count=exact" \
  -H "Range: 0-0" -I | grep -i content-range

# recent signups
curl -s "https://ygsgmhuxqjnwzgzzjrke.supabase.co/rest/v1/accounts?select=email,created_at&order=created_at.desc&limit=10" \
  -H "apikey: $SUPABASE_SERVICE_KEY"

Migrations are in supabase/migrations/. Apply via Supabase SQL Editor.

Domain

Registrar: NameSilo. Apex A 216.150.1.1, www CNAME cname.vercel-dns.com, TTL 3600.

# verify DNS
dig +short A nipcode.xyz @1.1.1.1
dig +short CNAME www.nipcode.xyz @1.1.1.1