Skip to content
This repository was archived by the owner on Sep 25, 2026. It is now read-only.

Phase 1 design: Foundation spec - #3

Merged
tommyqhoang merged 1 commit into
mainfrom
phase-1/design-spec
Jul 29, 2026
Merged

tommyqhoang merged 1 commit into
mainfrom
phase-1/design-spec

Conversation

@tommyqhoang

Copy link
Copy Markdown
Contributor

Design spec for Phase 1 (Foundation), produced via the brainstorming skill and approved section-by-section with the user.

Covers: multi-tenant data model (Membership join table), database sessions with activeBusinessId, Resend pulled forward for auth emails, Auth.js CSRF + origin-check pattern for custom routes, centralized Zod schema modules, soft-gate unverified users (read-only + banner, not lockout), /health semantics, and the Railway staging plan.

Doc only — no application code yet. Next: spec self-review, then writing-plans for the implementation plan.

🤖 Generated with Claude Code

Brainstormed and approved: multi-tenant data model (Membership join
table for many-to-many User<->Business, unblocking Phase 5 without a
breaking migration), database sessions with activeBusinessId, Resend
pulled forward for auth emails, Auth.js CSRF + origin-check pattern,
centralized Zod schema modules, soft-gate unverified users.

Co-Authored-By: Claude <noreply@anthropic.com>
@tommyqhoang
tommyqhoang merged commit 96bf8f3 into main Jul 29, 2026
2 checks passed
@tommyqhoang
tommyqhoang deleted the phase-1/design-spec branch July 29, 2026 00:48
tommyqhoang added a commit that referenced this pull request Jul 29, 2026
Task-by-task plan for Phase 1 (Foundation) derived from the approved
design spec (PR #3). Covers Next.js scaffold, Prisma multi-tenant model,
Auth.js database sessions, registration/login/verify/reset, Zod boundary
validation, Vitest/RTL/Playwright, pino+Sentry, /health, Railway staging
deploy.

Self-review fixed three correctness issues before committing:
- Task 1: hand-write the Next.js scaffold instead of `create-next-app`
  (unreliable in a non-empty dir; would clobber Phase 0's package.json).
- Route-group conflict: `app/(public)/page.tsx` and `app/(app)/page.tsx`
  both resolve to `/` in Next.js. Dashboard moved to `/dashboard`; Task 1
  uses a temporary `app/page.tsx` that Task 13 deletes when `(public)` lands.
- E2E capture gate: `__capturedEmails` is gated on `CAPTURE_EMAILS=1`
  (explicit flag) not `NODE_ENV !== "production"`, because Playwright runs
  a production build where the NODE_ENV gate would disable capture. Added
  `MOCK_EMAIL_SEND=1` so E2E runs without a configured Resend sending
  domain. Prisma `generate` added to CI before typecheck.

Co-authored-by: Claude <noreply@anthropic.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant