Skip to content
Documentation

Getting started

This guide takes you from an empty GitHub repository to a running site with an admin account. Plan on about five minutes once you have a Supabase project ready.

What you need

ToolVersion
Node.js22.12 or newer (see .nvmrc)
npmComes with Node
SupabaseA hosted project, or the Supabase CLI with Docker for local development
Vercel accountFor deployment

1. Create your repository

Start each client site from a fresh copy of the starter. Clone it into a new folder and move into it:

BASH
git clone https://github.com/jahzlariosa/jed.git my-site
cd my-site

You can name the folder anything you like. my-site is just an example.

2. Install dependencies

BASH
npm ci

Using Windows PowerShell 5.1? Run each command on its own line. It doesn't support chaining commands with &&.

3. Configure the environment

BASH
npm run setup

Setup creates .env.local from .env.example and asks for the Supabase URL, publishable key, and the other required settings. It checks that Supabase accepts the publishable key, and it does not print secret values. For a hosted project, copy the URL and keys from Project Settings > API. For local Supabase, start the stack first (next step), run npx supabase status, then run npm run setup again.

See Environment variables for what each value does.

4. Apply the database schema

The schema lives in supabase/migrations/. Apply it with the Supabase CLI if you can.

Local, with Docker:

BASH
npx supabase start
npx supabase db reset

Hosted project:

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

If you can't use the CLI, open the Supabase SQL Editor and run each file from supabase/migrations/ in filename order, one at a time. Don't skip any. Once you have an admin account, the SQL templates screen lists the same files with a copy button and shows which ones are applied. supabase/seed.sql is optional and mostly useful for local sample data.

5. Create the first admin

New accounts get the member role. The first admin has to be granted in SQL.

  1. Make sure email signups are on in Supabase under Authentication > Providers > Email.
  2. Sign up at http://localhost:3000/signup, or invite yourself from the Supabase dashboard.
  3. In the Supabase SQL Editor, run this once with your email:
SQL
insert into public.user_roles (user_id, role_code)
select user_id, 'admin'
from public.profiles
where lower(email) = lower('you@example.com')
on conflict do nothing;
  1. Sign in and open /admin.

After this, you can give other people the admin role from Admin > Users.

6. Run the dev server

BASH
npm run dev

Open http://localhost:3000. When setup is still incomplete, the dev server opens /setup instead. That page is only available while you are running the app locally. When you run Supabase locally, confirmation and password reset emails land in Inbucket at http://127.0.0.1:54324.

7. Check the setup

BASH
npm run doctor

Doctor checks the environment, Supabase connectivity, the latest migration when the key can read it, and the Node.js version. It exits with an error if a check fails.

8. Brand the site

Go to Admin > Settings and set:

  • Site name, used in the header, page titles, and sign-in screens.
  • Accent color, used for buttons, links, and focus rings across the site and admin.
  • Logo URL, used wherever the site shows public branding.
  • Contact email, which turns on the contact form.

Scripts

CommandWhat it does
npm run setupWrite .env.local and check the Supabase publishable key
npm run doctorCheck env, Supabase, migrations, and Node.js
npm run devDev server on port 3000
npm run buildProduction build (Vercel output in .vercel/output)
npm run previewServe the production build locally
npm run typecheckTypeScript 7 native tsc --noEmit (@typescript/native; JS API via @typescript/typescript6 for Vite and tooling)
npm run checkBiome lint and format check
npm run formatFormat with Biome
npm testVitest unit tests
npm run test:watchVitest in watch mode
npm run test:mfa-e2eMFA flow script (needs env and a running app)
npm run generate-routesRegenerate the TanStack Router route tree
npm run verify:bundleCheck the server bundle for forbidden dependencies

Pulling in starter updates

Client sites cloned from the starter don't sync on their own. To bring improvements from the starter into a client site:

BASH
git remote add starter https://github.com/jahzlariosa/jed.git
git fetch starter
git log HEAD..starter/main --oneline
git diff HEAD starter/main

Merge or cherry-pick what you need. Expect conflicts in branding, AGENTS.md, and client routes. If new migrations came in, apply them to each environment with npx supabase db push, then run npm ci, npm run check, npm test, and npm run build before you deploy.

Common problems

SymptomLikely causeFix
Email links point to the wrong hostAPP_URL missing or wrongSet APP_URL in Vercel Production and check the Supabase Site URL
"Invalid API key" or always signed outWrong Supabase URL or keyMatch the dashboard values and restart npm run dev
/admin sends you to sign in after the SQL grantRole not applied or wrong emailRun the admin SQL again and check user_roles for an admin row
Admin user actions failService role key missingSet SUPABASE_SERVICE_ROLE_KEY on the server
/contact says messages aren't availableNo contact emailSet Contact email in Admin > Settings
Search returns nothingSearch migration not appliedRun npx supabase db push
Every SQL template shows "not applied"RPC migration missing or wrong projectApply 20261015161000_admin_schema_migrations_rpc.sql and check the linked project
Sign-in fails on preview deploysRedirect URL not allowedAdd the preview URL plus /auth/callback in Supabase
npm run build fails on VercelNode versionUse Node 22.x in project settings