Skip to main content
Birthday Wall stores wish wall messages, page visibility settings, admin users, and registration codes in a Supabase Postgres database. This page walks you through creating a project, running the migration SQL, and locating the credentials you will add to your environment variables.
1

Create a Supabase project

  1. Go to supabase.com and sign in (or create a free account).
  2. Click New project from your organization dashboard.
  3. Give the project a name (e.g. birthday-wall), choose a database password, and select the region closest to your users.
  4. Click Create new project and wait for provisioning to finish — this typically takes about 30 seconds.
2

Run the database migration

All three required tables are created by a single SQL script. In your Supabase project:
  1. Click SQL Editor in the left sidebar.
  2. Click New query.
  3. Paste the entire migration below and click Run.
Change ADMIN123 to a unique, hard-to-guess value before running this SQL. Anyone with this code can register an admin account.
After the query succeeds you should see all four tables — messages, page_configs, users, and registration_codes — in the Table Editor.
3

Retrieve your API credentials

Your Next.js app needs three values from Supabase. Navigate to Project Settings → API in the Supabase dashboard:Copy all three values — you will need them in the next step.
4

Add credentials as environment variables

Add the three Supabase values to your environment. See the environment variables page for the full list of required variables and a ready-to-paste .env.local template.

Row Level Security

The migration SQL automatically enables Row Level Security (RLS) policies on all three tables. Here is what each policy enforces:
The service_role key bypasses all RLS policies and has unrestricted access to your entire database. Never expose it in browser code or commit it to your repository. Birthday Wall only uses this key inside server-side API routes — it is never sent to the browser.
The anon key, by contrast, is intentionally public. It is embedded in your frontend bundle via the NEXT_PUBLIC_ prefix and is safe to expose — RLS policies enforce what it can and cannot access.

Creating the first admin user

Once your tables exist you need a seed admin account to access /admin:
  1. In the Supabase dashboard, go to Authentication → Users → Add user.
  2. Enter an email and a strong password, then click Create user.
  3. Copy the UUID shown in the users list.
  4. Open the SQL Editor and run:
Alternatively, you can register through the /admin/login UI using the registration code you seeded in the SQL above — any account created with a valid registration code is automatically assigned the admin role.