The app uses two connections:
Supabase client (apps/mobile/lib/supabase.ts) — auth session, user_history upserts, etc.
Needs: EXPO_PUBLIC_SUPABASE_URL + EXPO_PUBLIC_SUPABASE_ANON_KEY.
HTTP API (EXPO_PUBLIC_API_URL) — feed, dashboard, explore, podcast pages, playlists list, etc.
Each request sends Authorization: Bearer <your access token> so the backend can read your rows under RLS.
If either is wrong, or you’re not logged in, you’ll see an empty UI even though data exists in the database.
apps/mobile/.env.localCreate or edit apps/mobile/.env.local (this file is gitignored).
Copy values from Supabase Dashboard → Project Settings → API:
| Variable | Where to copy |
|---|---|
EXPO_PUBLIC_SUPABASE_URL |
Project URL (e.g. https://xxxx.supabase.co) |
EXPO_PUBLIC_SUPABASE_ANON_KEY |
anon public key (not the service_role key) |
Critical: The URL and anon key must be from the same Supabase project where your podcasts, subscriptions, and history actually live. If you created a new project or rotated keys, update both here.
Optional third line depends on how you run the app:
# Local dev API (dev-api-stub on your machine)
EXPO_PUBLIC_API_URL=http://localhost:3000
# OR your deployed site that serves /api/* (production / preview)
# EXPO_PUBLIC_API_URL=https://your-app.vercel.app
For Expo web on the same computer, http://localhost:3000 is fine.
For a physical phone, use your computer’s LAN IP, e.g. http://192.168.1.50:3000, and ensure the dev API is listening on 0.0.0.0 if needed (or use the deployed API URL instead).
If EXPO_PUBLIC_API_URL is http://localhost:3000, run the stub from the repo root so it can load env:
npm run api:dev
# or
npm run dev:mobile-web
scripts/dev-api-stub.mjs reads, in order:
apps/mobile/.env.local.env.local.envIt uses EXPO_PUBLIC_SUPABASE_URL and EXPO_PUBLIC_SUPABASE_ANON_KEY there too. If those are missing, the stub falls back to empty JSON — the app loads but shows no feed/library data.
The dev stub listens on 0.0.0.0:PORT so a phone on Wi‑Fi can use http://YOUR_PC_IP:3000 as EXPO_PUBLIC_API_URL.
| Capability | dev-api-stub (this repo) |
Deployed Next / Vercel API (old apps/web) |
|---|---|---|
| Feed, dashboard, explore, podcast detail, subscribe, hide | Reads/writes your Supabase | Same |
| Search | Uses DB RPCs search_podcasts / search_episodes (only rows already in Postgres) |
Same pattern if it matched production |
Add by RSS URL to fill podcasts + rss_episodes |
Implemented (requires SUPABASE_SERVICE_ROLE_KEY) |
Same |
So if podcasts is empty in Supabase, Explore and Search stay empty even when everything is “connected.” The pipeline that pulled RSS from the internet lived in the removed web app / workers. Fix: point EXPO_PUBLIC_API_URL at a deployment that still runs that ingestion, or reintroduce those jobs elsewhere, then data appears for the stub’s queries too.
EXPO_PUBLIC_* values are baked in at bundle time.
cd apps/mobile
npx expo start --clear
(Or stop Metro and start again with --clear.)
Data is tied to auth.users / user_id:
/api/explore → lists rows from podcasts (quality-ranked by episode count and recency when explore_podcasts RPC exists). Empty table ⇒ empty Explore (see §2b)./api/search → DB RPCs over podcasts / rss_episodes. Empty DB ⇒ empty results (not a live iTunes search in the stub).rss_episodes. No subscriptions ⇒ empty feed even if the DB is “connected.”/api/bookmarks and table episode_bookmarks — run pending migrations (supabase db push or your usual flow) if that table is missing./api/follows, profile Follow / Unfollow) use table user_follows — same migration requirement.lib/api/handle-request.ts fallbacks.Set:
EXPO_PUBLIC_API_URL=https://your-real-deployment.vercel.app
That deployment must implement the same /api/* routes and use the same Supabase project as your .env.local keys. A placeholder or old URL will load the shell but not your data.
apps/mobile/.env.local has correct URL + anon key for the project that has your dataEXPO_PUBLIC_API_URL matches how you run the API (local :3000 vs deployed)npm run api:dev (or dev:mobile-web) is runningapps/mobile/.env.local only)npx expo start --clear after any env change