Money Management Setup & Deployment Guide ENID

Supabase Cloud + Vercel, start to live URL.

No backend to write, no server to manage. This walks a fresh clone through a working Supabase project and a public Vercel deployment — about 15 minutes end to end.

req

Prerequisites

01

Create the Supabase project

  1. Go to database.new and create a new project. Pick any region close to your users; note the database password.
  2. Wait for provisioning (~2 min), then open Project Settings → API.
  3. Copy the Project URL and the anon public key — you'll need both in Step 4.

Use the anon key only. The service_role key bypasses Row Level Security and must never ship in frontend code or the .env file.

02

Run the migrations

Open SQL Editor in the Supabase dashboard and run each file from supabase/migrations/, in order, pasting one at a time:

FileSets up
20260904090001_schema.sqlEnums, tables, indexes
20260904090002_rls_policies.sqlRow Level Security — isolates each user's data
20260904090003_views_functions.sqlPeriod-index helper and summary views
20260904090004_triggers.sqlAuto-provisions profile, categories & defaults on sign-up
20260904090005_rpc_onboarding.sqlcomplete_onboarding() RPC for the onboarding wizard
20260911000001_akun_saldo.sqlPer-account balance tracking
20260911000002_pecah_akun_gabungan.sqlSplits legacy combined-account rows

Prefer scripting it? The Supabase CLI applies the same folder in order:

npx supabase@latest login
npx supabase@latest link --project-ref <your-project-ref>
npx supabase@latest db push

Re-installing over an existing database? Run supabase/reset.sql first — it drops every table, type, function and user account in the project. Back up first; there is no undo.

03

Seed demo data — optional

For a populated account to demo or screenshot from, run one of these in the SQL Editor after the migrations. Each is idempotent and time-relative (data always ends "today").

supabase/seed_demo_idr.sql

demo@keuanganku.app / demo1234 — IDR, Bahasa Indonesia

supabase/seed_demo_usd.sql

demo.en@keuanganku.app / demo1234 — USD, English

Full breakdown of what each seed populates: docs/DEMO.md.

04

Local environment

cp .env.example .env

Fill in the two values from Step 1:

VITE_SUPABASE_URL=https://your-project-id.supabase.co
VITE_SUPABASE_ANON_KEY=your-anon-key
npm install
npm run dev

Open localhost:5173. Sign up a real account, or sign in with a seeded demo login from Step 3.

New sign-ups need to confirm their email by default. For quick local testing, turn it off at Authentication → Providers → Email → Confirm email in the Supabase dashboard — turn it back on before going live.

05

Deploy to Vercel

A — Dashboard (recommended)

Push the repo to GitHub/GitLab/Bitbucket → vercel.com/new → Import → Framework preset Vite → add the same two env vars from Step 4 → Deploy.

B — CLI

npm i -g vercel
vercel login
vercel env add VITE_SUPABASE_URL
vercel env add VITE_SUPABASE_ANON_KEY
vercel --prod

vercel.json already rewrites every route to index.html, so client-side routing (React Router) works on refresh and direct links — nothing to configure there.

06

Post-deploy checklist

?

Troubleshooting

"VITE_SUPABASE_URL dan VITE_SUPABASE_ANON_KEY harus disetel di file .env" at startup — the env vars are missing or misnamed. Vite only exposes vars prefixed VITE_, and it reads them at build time: after editing .env, restart npm run dev, or trigger a new deploy on Vercel.

Blank dashboard after sign-up — the trigger in 20260904090004_triggers.sql seeds default categories and master data on new-user creation. If it wasn't run, re-run migrations 1–5 in order against a clean database.

404 on page refresh in production — confirm vercel.json shipped in the deployed build; it's what makes deep links fall back to index.html.