-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsupabaseClient.js
More file actions
26 lines (22 loc) · 819 Bytes
/
supabaseClient.js
File metadata and controls
26 lines (22 loc) · 819 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import { createClient } from '@supabase/supabase-js'
import { SUPABASE_URL, SUPABASE_KEY } from '@env'
if (!SUPABASE_URL || !SUPABASE_KEY) {
console.warn('Supabase URL or KEY missing! Check your .env file.')
}
export const supabase = createClient(SUPABASE_URL, SUPABASE_KEY)
// Database table structure you'll need to create in Supabase:
/*
Table: entries
Columns:
- id (int8, primary key, auto-increment)
- title (text)
- content (text)
- sentiment (int2)
- created_at (timestamptz, default: now())
- user_id (uuid, references auth.users)
Enable Row Level Security (RLS) with policies:
- SELECT: authenticated users can read their own entries
- INSERT: authenticated users can create entries
- UPDATE: authenticated users can update their own entries
- DELETE: authenticated users can delete their own entries
*/