Back to home

Sua Pa AI — Setup diagnostics

Configure two things — NEXT_PUBLIC_SUPABASE_URL and NEXT_PUBLIC_SUPABASE_ANON_KEY — and Sua Pa AI runs.

Overall status

✗ Cannot reach Supabase

NEXT_PUBLIC_SUPABASE_URL / NEXT_PUBLIC_SUPABASE_ANON_KEY not set.

Open .env, paste your Supabase project URL and anon key, then restart the dev server.

The 30-second fix

Paste your Project URL and anon key

  1. Open your Supabase project → Project Settings → API.
  2. Copy the Project URL and the anon / public key.
  3. Open .env and set them as NEXT_PUBLIC_SUPABASE_URL and NEXT_PUBLIC_SUPABASE_ANON_KEY.
  4. Make sure the schema has been created — run docs/supabase-schema.sql in the SQL Editor once (see below).
  5. Stop the dev server (Ctrl+C) and run npm run dev again.
# .env — the two lines you actually need
NEXT_PUBLIC_SUPABASE_URL=https://xxxxxxxxxxxxx.supabase.co
NEXT_PUBLIC_SUPABASE_ANON_KEY=eyJ...

# Optional extras:
# OPENAI_API_KEY=sk-...
# SUPABASE_SERVICE_ROLE_KEY=eyJ...

Tables aren't created automatically — paste the contents of docs/supabase-schema.sql into the Supabase SQL Editor and click Run once, then reload this page.

Environment variables

  • NEXT_PUBLIC_SUPABASE_URLrequired

    set

  • NEXT_PUBLIC_SUPABASE_ANON_KEYrequired

    not set — required

  • OPENAI_API_KEY

    set

  • SUPABASE_SERVICE_ROLE_KEY

    set

Likely fixes for your error

  1. 1Double-check NEXT_PUBLIC_SUPABASE_URL and NEXT_PUBLIC_SUPABASE_ANON_KEY, then restart the dev server.

Full instructions in docs/SUPABASE.md.