This repository was archived by the owner on Sep 25, 2026. It is now read-only.
Repository navigation
Phase 1 design: Foundation spec - #3
Merged
Merged
Conversation
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
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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),/healthsemantics, 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