Skip to content

Document the database, the seed and signing in locally - #132

Merged
davidtaing merged 1 commit into
mainfrom
docs/setup-supabase-and-seed
Aug 23, 2026
Merged

Document the database, the seed and signing in locally#132
davidtaing merged 1 commit into
mainfrom
docs/setup-supabase-and-seed

Conversation

@davidtaing

Copy link
Copy Markdown
Collaborator

The getting-started instructions were written when the stack came up empty and nothing read it. They still told a contributor to boot Supabase and then stopped — no mention of what a reset seeds, no way to sign in, and two paragraphs asserting that no page queries the database.

What this adds

The seed. What supabase/seed.sql loads and why two different kinds of thing share one file: the 24 real credentials, canonical in supabase/seed/credential-catalogue.json, and the invented population #110 added. So a reset leaves a directory with something in it and stable handles at /p/seed0001/p/seed0008. And the part that bites — the loader is additive, so an edit to it reaches a stack through pnpm db:reset and by no other route.

Signing in. The three seeded addresses and what each one is for, and Mailpit as where the link arrives. Worth its own section because "magic link only" reads like a missing step until you know there is no password to be given: there is nothing to type and nothing to commit.

A Tests section, which the README did not have. It listed pnpm test:e2e under Scripts and neither Vitest project.

The point that prompted this: pnpm test:db uses the same database pnpm dev does. There is no second stack, and it is not a read-only suite — it writes fixtures, signs accounts up and deletes them, and revokes a column grant to prove the trigger refuses the write without it. A clean run puts all of that back; an interrupted one leaves a stray profile in your directory or a privilege your next query is missing. So resetting often is the workflow rather than a recovery step, and the section says so.

Two failures that send you to the wrong file go with it:

  • the suite reports skipped rather than failed when the stack is not answering, so read the exit code and not the summary line;
  • Kong keeps routing to the auth container's pre-reset address, which 502s every sign-up — and breaks sign-in from pnpm dev too, so the Signing in section points at the same one-line fix.

Corrections carried along

"The placeholder home page", and "Nothing in the app queries any of it yet" / "What has not happened yet is a read" — all three were false once the above went in. The migration enumeration was already stale at six of eight, and is now a pointer to supabase/migrations/ and AGENTS.md rather than a count that rots on the next one.

Note

AGENTS.md still says seven migrations and carries neither the shared-database nor the Kong note. Left alone deliberately — this is the setup document, and AGENTS.md is a separate edit that would collide with the branch it is currently being changed on.

Docs only, so no Schema run.

The setup instructions predated Supabase carrying anything. They told a
contributor how to boot the stack and then left them looking at an empty
directory with no way to sign in, while asserting in two places that
nothing in the app queried the database at all.

Three things a new contributor now needs and could not find. What the
seed loads, and that its additive loader means an edit to it reaches a
stack through `pnpm db:reset` and by no other route. How to sign in,
which is the three seeded addresses and Mailpit, because magic link
means there is no password to hand over and none to commit. And a Tests
section, which the README did not have — it listed `test:e2e` under
Scripts and neither Vitest project at all.

The part worth stating plainly is that `pnpm test:db` uses the same
database `pnpm dev` does. It writes fixtures, signs accounts up, and
revokes a column grant to prove the trigger holds without it; a clean
run puts that back and an interrupted one does not, so resetting often
is the workflow rather than a recovery step. Two failures that misdirect
go with it: the suite reporting skipped rather than failed when the
stack is not answering, and Kong routing to the auth container's old
address after a reset, which breaks sign-in from the dev server too.

Also drops the migration enumeration, which was already stale at six of
eight, in favour of pointing at the directory and AGENTS.md.
@davidtaing
davidtaing marked this pull request as ready for review August 23, 2026 01:50
@davidtaing
davidtaing merged commit 5addfdc into main Aug 23, 2026
2 checks passed
@davidtaing
davidtaing deleted the docs/setup-supabase-and-seed branch August 23, 2026 01:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant