Supabase Setup Guide
Set up your own cloud database in minutes. Your data, your control.
Why Self-Hosted Cloud
Your Data
GPS data lives on your own database. We never see or store it.
No Vendor Lock-in
Supabase is open-source. Export your data anytime. Switch providers freely.
No Extra Cost
Supabase's free tier covers most personal use. No monthly fees on top of your Cloud Unlock.
Create a Supabase Project
- Go to supabase.com and sign up for a free account.
- Click "New Project" and give it a name (e.g. "jizailog-gps").
- Choose a region closest to you for lowest latency.
- Set a secure database password (you won't need to enter this in the app).
- Wait for the project to finish initializing (usually under a minute).


Run the Database Schema
- In your Supabase dashboard, go to SQL Editor (left sidebar).
- Click "New query".
- Copy and paste the entire SQL below into the editor.
- Click "Run" (or press Ctrl+Enter).
- You should see "Success. No rows returned" — that means all tables were created.
-- =============================================
-- JizaiLog GPS Database Schema
-- Run this in YOUR Supabase SQL Editor
-- =============================================
-- Sessions — one row per recorded walk
CREATE TABLE sessions (
id UUID PRIMARY KEY,
user_id UUID NOT NULL,
status TEXT NOT NULL DEFAULT 'stopped',
started_at TIMESTAMPTZ NOT NULL,
ended_at TIMESTAMPTZ,
point_count INTEGER DEFAULT 0,
discard_count INTEGER DEFAULT 0,
distance_m REAL DEFAULT 0,
duration_s INTEGER DEFAULT 0,
created_at TIMESTAMPTZ DEFAULT now()
);
CREATE INDEX idx_sessions_user ON sessions(user_id);
-- Points — raw GPS coordinates per session
CREATE TABLE points (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
session_id UUID NOT NULL REFERENCES sessions(id) ON DELETE CASCADE,
ts BIGINT NOT NULL,
lat DOUBLE PRECISION NOT NULL,
lng DOUBLE PRECISION NOT NULL,
alt DOUBLE PRECISION,
accuracy REAL,
speed REAL,
heading REAL,
UNIQUE(session_id, ts)
);
CREATE INDEX idx_points_session_ts ON points(session_id, ts);
-- Device debug logs
CREATE TABLE device_logs (
id BIGSERIAL PRIMARY KEY,
user_id UUID NOT NULL,
device_id TEXT NOT NULL,
platform TEXT NOT NULL,
ts BIGINT NOT NULL,
tag TEXT NOT NULL,
message TEXT NOT NULL,
app_version TEXT,
created_at TIMESTAMPTZ DEFAULT now()
);
CREATE INDEX idx_device_logs_user_ts ON device_logs(user_id, ts DESC);
CREATE INDEX idx_device_logs_device ON device_logs(device_id, ts DESC);
-- Session comments (chat)
CREATE TABLE session_comments (
id UUID PRIMARY KEY,
session_id UUID NOT NULL REFERENCES sessions(id) ON DELETE CASCADE,
user_id UUID NOT NULL,
content TEXT,
image_path TEXT,
created_at BIGINT NOT NULL
);
CREATE INDEX idx_comments_session ON session_comments(session_id, created_at);
-- Comment read tracking
CREATE TABLE comment_reads (
session_id UUID NOT NULL REFERENCES sessions(id) ON DELETE CASCADE,
user_id UUID NOT NULL,
last_read_at BIGINT NOT NULL,
PRIMARY KEY (session_id, user_id)
);
-- Enable Row Level Security on all tables
ALTER TABLE sessions ENABLE ROW LEVEL SECURITY;
ALTER TABLE points ENABLE ROW LEVEL SECURITY;
ALTER TABLE device_logs ENABLE ROW LEVEL SECURITY;
ALTER TABLE session_comments ENABLE ROW LEVEL SECURITY;
ALTER TABLE comment_reads ENABLE ROW LEVEL SECURITY;
-- RLS policies — allow anon access (Worker uses anon key)
CREATE POLICY "anon_all_sessions" ON sessions
FOR ALL TO anon USING (true) WITH CHECK (true);
CREATE POLICY "anon_all_points" ON points
FOR ALL TO anon USING (true) WITH CHECK (true);
CREATE POLICY "anon_all_device_logs" ON device_logs
FOR ALL TO anon USING (true) WITH CHECK (true);
CREATE POLICY "anon_all_comments" ON session_comments
FOR ALL TO anon USING (true) WITH CHECK (true);
CREATE POLICY "anon_all_comment_reads" ON comment_reads
FOR ALL TO anon USING (true) WITH CHECK (true);
-- Grant permissions to anon role
GRANT ALL ON sessions TO anon;
GRANT ALL ON points TO anon;
GRANT ALL ON device_logs TO anon;
GRANT ALL ON session_comments TO anon;
GRANT ALL ON comment_reads TO anon;
GRANT USAGE, SELECT ON SEQUENCE device_logs_id_seq TO anon;Organization admins: Run this SQL once when setting up your shared database. Members just join your organization in the app — they connect automatically.
Get Your Credentials
- In your Supabase dashboard, go to Settings > API.
- Copy the Project URL (looks like
https://xxxxx.supabase.co). - Copy the anon/public key (a long string starting with
eyJ...).

Important: Never share your service_role key. You only need the anon key for the app.
Configure in JizaiLog
- Open the JizaiLog app on your device.
- Go to Settings > Database Config.
- Paste your Project URL into the URL field.
- Paste your anon key into the Key field.
- Tap Save.
Verify Connection
- Record a short walk (even a minute around your room works).
- Stop the recording.
- Check that the session appears in both the Local and Cloud tabs.
- If you see it in both — you're all set!
If sync fails, double-check your URL and anon key. The most common issue is copying the wrong key.
Cost
Supabase Free Tier includes:
500 MB
Database storage
1 GB
File storage
50K
Monthly active users
More than enough for personal use. A typical dog walk session uses less than 50 KB of storage. Paid plans start at $25/month if you exceed these limits, but most individual users will never need to upgrade.
