⚠Use anon / public key only. Never enter service_role key in frontend.
1. Go to supabase.com → create project
2. Settings → API → copy Project URL and anon public key
3. Run the SQL schema below in your SQL Editor
📋 SQL Schema (run in Supabase SQL Editor)show/hide
create extension if not exists pgcrypto;
create table if not exists public.dca_trades (
id uuid primary key default gen_random_uuid(),
user_id uuid not null references auth.users(id) on delete cascade,
round integer not null default 1 check (round > 0),
bought_at timestamptz not null,
symbol text not null,
asset_name text not null default '',
asset_type text not null default 'ETF' check (asset_type in ('ETF','Stock','Crypto','Other')),
side text not null default 'Buy' check (side in ('Buy','Sell')),
avg_price numeric(20,8) not null check (avg_price >= 0),
shares numeric(24,10) not null check (shares >= 0),
trade_value numeric(20,4) not null check (trade_value >= 0),
fees numeric(20,4) not null default 0 check (fees >= 0),
total_cost numeric(20,4) not null check (total_cost >= 0),
order_id text default '',
notes text default '',
created_at timestamptz not null default now(),
updated_at timestamptz not null default now()
);
create index if not exists dca_trades_user_symbol_idx on public.dca_trades(user_id, symbol);
create index if not exists dca_trades_user_bought_at_idx on public.dca_trades(user_id, bought_at desc);
create index if not exists dca_trades_user_symbol_round_idx on public.dca_trades(user_id, symbol, round);
create unique index if not exists dca_trades_user_order_id_unique_idx
on public.dca_trades(user_id, order_id)
where order_id is not null and btrim(order_id) <> '';
alter table public.dca_trades enable row level security;
create policy "Users can read own DCA trades"
on public.dca_trades for select
to authenticated
using (auth.uid() = user_id);
create policy "Users can insert own DCA trades"
on public.dca_trades for insert
to authenticated
with check (auth.uid() = user_id);
create policy "Users can update own DCA trades"
on public.dca_trades for update
to authenticated
using (auth.uid() = user_id)
with check (auth.uid() = user_id);
create policy "Users can delete own DCA trades"
on public.dca_trades for delete
to authenticated
using (auth.uid() = user_id);
🔢 Enter PIN
📈
Private DCA tracker. No email or password required.