|
| 1 | +# Milestone 5: Beta Onboarding, Internal Admin Auth, and Invitation Code Management |
| 2 | + |
| 3 | +## Goal |
| 4 | +Deliver the closed-beta onboarding and service-native identity workflow on top of the existing auth, books, clubs, threads, shelves, and reviews foundation, while adding an internal-only admin panel for invitation-code management: |
| 5 | + |
| 6 | +- require completed signup after OAuth before public app access |
| 7 | +- collect a stable nickname, gender, country, favorite genres, and an invitation code |
| 8 | +- use nickname as the public app identity across profile, shelves, clubs, threads, and reviews |
| 9 | +- change public shelf sharing to nickname-based URLs |
| 10 | +- change private-club invite targeting from email to nickname-resolved user identity |
| 11 | +- add internal admin auth and admin UI for DB-backed invitation-code management |
| 12 | + |
| 13 | +## Current Baseline |
| 14 | +- `bookapp.users` currently stores provider metadata only and Google login immediately creates a usable app user. |
| 15 | +- Milestones 2 through 4 already provide clubs, discussions, shelves, and reviews on top of the current auth foundation. |
| 16 | +- The app has no internal-admin auth path, no admin route tree, and no credentials-based sign-in. |
| 17 | +- Beta access is currently documented as a shared env-backed code rather than a database-managed domain. |
| 18 | +- Private club invites are email-targeted and invite acceptance still matches by email or user id. |
| 19 | +- Public shelf routes are keyed by `userId`, not nickname. |
| 20 | + |
| 21 | +## Planning Assumptions |
| 22 | +- Internal admins are manually created in Supabase UI and stored with `provider = 'internal'`. |
| 23 | +- Internal admins use email/password only and do not participate in public signup or the public product routes. |
| 24 | +- Invitation codes are future-ready through `purpose`, optional expiry, and optional max uses, but only `BETA_SIGNUP` redemption is implemented in Milestone 5. |
| 25 | +- Nickname is immutable in Milestone 5 and is validated as a lowercase URL-safe handle. |
| 26 | +- Private club invites remain a separate domain from admin-managed invitation codes. |
| 27 | +- Milestone 5 does not add a public profile route, nickname change UI, or in-app admin-user bootstrap flow. |
| 28 | + |
| 29 | +## Delivery Order |
| 30 | +1. [Task 01: User and Admin Identity Foundation](./task-01-user-and-admin-identity-foundation.md) |
| 31 | +2. [Task 02: Signup Completion and Public App Auth Gating](./task-02-signup-completion-and-public-app-auth-gating.md) |
| 32 | +3. [Task 03: Internal Admin Auth and Invitation Code Management](./task-03-internal-admin-auth-and-invitation-code-management.md) |
| 33 | +4. [Task 04: Nickname Profile, Public Shelf Sharing, and Club Invites](./task-04-nickname-profile-public-shelf-sharing-and-club-invites.md) |
| 34 | +5. [Task 05: Quality Gates and Regression Coverage](./task-05-quality-gates-and-regression-coverage.md) |
| 35 | + |
| 36 | +## Milestone Exit Criteria |
| 37 | +- OAuth-authenticated public users cannot reach the reader app until they complete Book by Book signup. |
| 38 | +- Completing signup persists nickname, gender, country, favorite genres, and signup completion state, and atomically redeems a valid `BETA_SIGNUP` invitation code. |
| 39 | +- Internal admins can sign in through `/admin/signin` and manage invitation codes from `/admin/invitation-codes`. |
| 40 | +- Invitation codes are stored hashed, support active/inactive state, and can optionally expire or cap uses. |
| 41 | +- Nickname becomes the default user-facing identity across `/me`, shelves, clubs, threads, reviews, and invite pages. |
| 42 | +- Public shelf sharing works by nickname route while preserving the existing signed-in-only public shelf access model. |
| 43 | +- Private club invites are created by nickname and accepted only by the targeted signed-in public user. |
| 44 | +- Milestone 5 passes `pnpm lint`, `pnpm build`, `pnpm test`, `pnpm test:integration`, and required Playwright coverage for onboarding, admin auth, invitation-code management, nickname routing, and invite flows. |
0 commit comments