From e286536ef85b5b1c7b33788f70da294b93b7b567 Mon Sep 17 00:00:00 2001 From: Chandler Copeland Date: Thu, 19 Mar 2026 13:04:31 -0600 Subject: [PATCH] docs(01): capture phase context --- .planning/phases/01-foundation/01-CONTEXT.md | 73 ++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 .planning/phases/01-foundation/01-CONTEXT.md diff --git a/.planning/phases/01-foundation/01-CONTEXT.md b/.planning/phases/01-foundation/01-CONTEXT.md new file mode 100644 index 0000000..bc378ca --- /dev/null +++ b/.planning/phases/01-foundation/01-CONTEXT.md @@ -0,0 +1,73 @@ +# Phase 1: Foundation - Context + +**Gathered:** 2026-03-19 +**Status:** Ready for planning + + +## Phase Boundary + +Next.js project scaffold, Neon database with auth schema, Vercel Blob storage bucket, and single-agent authentication — the infrastructure every subsequent phase depends on. Scope ends at: agent can log in, session persists, protected routes redirect, and all infrastructure is live on Vercel. + + + + +## Implementation Decisions + +### Login page +- Branded design — Teressa's logo, brand colors, and photo +- Route: `/agent/login` +- Title/headline: "Agent Portal" +- Generic error message on failed login: "Invalid email or password" (does not hint whether email exists) +- No forgot-password flow in this phase (Teressa is sole user — reset via env var or direct DB update) +- Password visibility toggle included (show/hide) +- Post-login redirect: `/agent/dashboard` + +### Session behavior +- 7-day rolling session — refreshes on each visit +- Persistent across browser restarts (httpOnly cookie, not sessionStorage) +- On session expiry: silent redirect to `/agent/login` +- Logout: immediate redirect to `/agent/login` with "You've been signed out" confirmation message + +### Database schema +- Auth tables only in this phase (users + sessions) — future phases own their own migrations +- ORM: Drizzle ORM (TypeScript-native, excellent Next.js + Neon support) +- Password storage: bcrypt hashing +- Migration files committed to repo in `/drizzle` directory (version-controlled, auditable) +- Initial account: seed script creates Teressa's account from environment variables (no signup UI) +- Single-agent design — standard users table rows, no multi-tenant role/status columns + +### Deployment +- Production only — deploy to Vercel at teressacopelandhomes.com +- Secrets and environment variables managed exclusively via Vercel dashboard (never committed to repo) +- Vercel Blob storage: single store, organized by path (e.g. `/documents/signed/`, `/documents/templates/`) +- Deployment trigger: Vercel native Git integration (push to main → auto-deploy, no GitHub Actions) + +### Claude's Discretion +- Exact brand color palette and visual design details (Teressa's brand assets to be used but layout specifics are open) +- Loading/submitting state on the login form button +- Exact bcrypt salt rounds +- Session token storage implementation details (Auth.js/NextAuth vs custom JWT) + + + + +## Specific Ideas + +- The login page should feel like it belongs to Teressa's real estate brand, not a generic SaaS admin panel +- "Agent Portal" as the label clearly signals purpose without being verbose + + + + +## Deferred Ideas + +- Forgot password / email reset flow — add to backlog for a future phase +- Multi-agent support / role-based access — intentionally deferred, single-agent product for now +- Staging or preview environments — production-only for this build; can revisit if testing complexity grows + + + +--- + +*Phase: 01-foundation* +*Context gathered: 2026-03-19*