SDKsBackend & Authentication
Supabase is your backend-in-a-box.
This repo already includes a Supabase client wrapper + an example Edge Function (used by the AI feature). This guide explains how the backend side is structured and how to extend it safely.
What Supabase gives you
- Postgres database (with Row Level Security)
- Auth (email/password, OAuth, magic links, etc.)
- Storage (buckets for files)
- Edge Functions (server-side code on the edge)
Official docs: Supabase docs
Where the code lives (in this repo)
- Supabase client:
src/shared/libs/supabase.tssupabaseclient instanceisSupabaseConfigured()/getSupabaseConfigError()guards
- Example usage (Storage + Functions):
src/features/ai/services/ai.service.ts- uploads images to Storage (
chat-imagesbucket) - calls a Supabase Edge Function for AI chat
- uploads images to Storage (
- Edge Functions code:
supabase/functions/- currently:
supabase/functions/ai/
- currently:
- Local Supabase config:
supabase/config.toml
Configure Supabase credentials (required)
Create a Supabase project, then copy credentials from Project Settings → API into your .env:
EXPO_PUBLIC_SUPABASE_URLEXPO_PUBLIC_SUPABASE_ANON_KEY
Why:
- The app uses
isSupabaseConfigured()to avoid runtime crashes and to show a helpful error. - The client is created with “safe” placeholder values when missing, so imports don’t explode, but requests will fail.
