- pnpm 10 workspace + TypeScript strict + ESLint flat + Prettier - CLAUDE.md as canonical brief - docs/tasks/ — 22 task briefs broken out by phase for sub-sessions - docs/decisions/ — ADR scaffold Implements task 01 (repo-init).
1.2 KiB
1.2 KiB
07 — Household seeding & session
Goal
On first boot, create the single household and attach Matt + wife to it. Every authenticated request resolves a householdId cheaply.
Depends on
- 06 (auth)
Scope
- Migration / seed script (
pnpm db:seed) that inserts one household named "Home" if none exists. - On first OIDC login, attach the user to the seeded household as
owner(Matt) ormember(everyone else). Idempotent. getCurrentSession()server helper returns{ user, household, role }. Throws if no household membership.- All later modules' queries take
householdIdas the scope key. /settings/householdpage showing household name, member list, and a "rename household" form (owner only).
Out of scope
- Multi-household UI (schema supports it; UI is single-household only).
- Invite flows (Authentik provisions accounts; we just attach them).
Acceptance criteria
pnpm db:seedis idempotent — running twice does not create duplicate households.- First user to sign in becomes
owner; subsequent users becomemember. getCurrentSession()returns a typed object withhousehold.id./settings/householdrenders for both roles; rename only works for owner.