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.Documentation Index
Fetch the complete documentation index at: https://help.helloazhenweb.top/llms.txt
Use this file to discover all available pages before exploring further.
Create a Supabase project
- Go to supabase.com and sign in (or create a free account).
- Click New project from your organization dashboard.
- Give the project a name (e.g.
birthday-wall), choose a database password, and select the region closest to your users. - Click Create new project and wait for provisioning to finish — this typically takes about 30 seconds.
Run the database migration
All three required tables are created by a single SQL script. In your Supabase project:After the query succeeds you should see all four tables —
- Click SQL Editor in the left sidebar.
- Click New query.
- Paste the entire migration below and click Run.
messages, page_configs, users, and registration_codes — in the Table Editor.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.
| Credential | Where to find it | Used in |
|---|---|---|
| Project URL | ”Project URL” field | NEXT_PUBLIC_SUPABASE_URL |
| anon / public key | ”Project API keys” → anon public | NEXT_PUBLIC_SUPABASE_ANON_KEY |
| service_role key | ”Project API keys” → service_role (click to reveal) | SUPABASE_SERVICE_ROLE_KEY |
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:| Table | Policy | Effect |
|---|---|---|
messages | Allow public read | Anyone can read wishes displayed on the home page |
messages | Service role full access | Only server-side API routes can insert or delete wishes |
page_configs | Allow public read | Anyone can read page visibility settings |
page_configs | Service role full access | Only server-side API routes can toggle page visibility |
users | Service role full access | Only server-side API routes can read or write user records |
registration_codes | Allow public read | Client-side code can verify a registration code before submitting |
registration_codes | Service role full access | Only server-side API routes can create or mark codes as used |
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:
- In the Supabase dashboard, go to Authentication → Users → Add user.
- Enter an email and a strong password, then click Create user.
- Copy the UUID shown in the users list.
- Open the SQL Editor and run:
/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.