Demo Data Mode
Workspace Settings & Supabase
Configure your private authenticated PostgreSQL cloud storage with Row Level Security.
Cloud Storage Status
PostgreSQL backend connectivity
Your workspace is currently running in client demo mode using browser local storage. Trades logged here are private to this browser and clearly flagged as Demo Data.
Connecting Your Own Supabase Instance
To enable permanent cloud sync and multi-device authentication, create a free project at supabase.com and set the following public environment variables during your static build:
NEXT_PUBLIC_SUPABASE_URL=https://your-project.supabase.co
NEXT_PUBLIC_SUPABASE_ANON_KEY=your-public-anon-key
Security Guarantee: Never enter or expose your Supabase service-role key. Only your public client-safe
anon key belongs in frontend code.SQL Migration Script (Run in Supabase SQL Editor)
-- FINZOVA SUPABASE DATABASE SETUP & ROW LEVEL SECURITY (RLS)
CREATE TABLE public.trades (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
user_id UUID NOT NULL REFERENCES auth.users(id) ON DELETE CASCADE,
created_at TIMESTAMP WITH TIME ZONE DEFAULT timezone('utc'::text, now()) NOT NULL,
trade_date DATE NOT NULL,
pair TEXT NOT NULL,
direction TEXT NOT NULL CHECK (direction IN ('BUY', 'SELL')),
entry_price NUMERIC NOT NULL,
stop_loss NUMERIC NOT NULL,
take_profit NUMERIC NOT NULL,
lot_size NUMERIC NOT NULL,
risk_percent NUMERIC NOT NULL,
risk_amount NUMERIC NOT NULL,
result TEXT NOT NULL CHECK (result IN ('WIN', 'LOSS', 'BREAKEVEN', 'OPEN')),
pnl NUMERIC NOT NULL DEFAULT 0,
r_multiple NUMERIC NOT NULL DEFAULT 0,
setup TEXT NOT NULL,
session TEXT NOT NULL,
emotion TEXT NOT NULL,
notes TEXT
);
-- ENABLE ROW LEVEL SECURITY
ALTER TABLE public.trades ENABLE ROW LEVEL SECURITY;
-- RLS POLICIES (Users only ever access their own trades)
CREATE POLICY "Users can view own trades" ON public.trades
FOR SELECT USING (auth.uid() = user_id);
CREATE POLICY "Users can insert own trades" ON public.trades
FOR INSERT WITH CHECK (auth.uid() = user_id);
CREATE POLICY "Users can update own trades" ON public.trades
FOR UPDATE USING (auth.uid() = user_id);
CREATE POLICY "Users can delete own trades" ON public.trades
FOR DELETE USING (auth.uid() = user_id);