Commit Graph

156 Commits

Author SHA1 Message Date
Chandler Copeland
0a75442af3 fix(db): swap @neondatabase/serverless for postgres.js (local dev support)
Neon serverless driver requires remote WebSocket — incompatible with local
PostgreSQL. Replaced with postgres.js (drizzle-orm/postgres-js) in db/index.ts,
scripts/seed.ts, and drizzle.config.ts.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-19 14:00:32 -06:00
Chandler Copeland
32dc2d3ee5 feat(01-02): build agent portal layout, dashboard stub, and logout mechanism
- LogoutButton: client component with server action calling signOut to ?signed_out=1
- AgentLayout: defense-in-depth auth() check, header with email and sign-out button
- DashboardPage: belt-and-suspenders auth() check, welcome message with agent email
- HomePage: updated to Teressa Copeland Homes placeholder (Phase 2 marketing site)
- npm run build and npx tsc --noEmit both pass with zero errors
2026-03-19 13:39:25 -06:00
Chandler Copeland
f221597677 feat(01-02): build branded login page with password toggle and error handling
- Split-screen layout: agent photo left (lg+), login card right
- loginAction server action: signIn credentials, redirects on AuthError
- PasswordField client component: show/hide toggle with eye/eye-off SVG
- Signed-out confirmation banner on ?signed_out=1
- Error banner on ?error=invalid with generic message
- Brand colors: gold #C9A84C accent, navy #1B2B4B text, off-white #FAF9F7 bg
- Copied /Users/ccopeland/Downloads/red.jpg to public/red.jpg
2026-03-19 13:38:42 -06:00
Chandler Copeland
e5db79a8f0 feat(01-01): configure Auth.js v5 JWT + Credentials, route protection middleware
- Created src/lib/auth.ts with NextAuth JWT strategy, 7-day rolling session, Credentials provider
- Created src/app/api/auth/[...nextauth]/route.ts with GET/POST handlers and force-dynamic
- Created middleware.ts at project root (not src/) protecting /agent/* routes
- Fixed db/index.ts: lazy Proxy singleton prevents neon() crash during Next.js build
- npm run build passes; /api/auth/[...nextauth] renders as Dynamic route
2026-03-19 13:33:15 -06:00
Chandler Copeland
f46e7027a5 feat(01-01): define DB schema, configure Drizzle Kit, write seed script
- Created src/lib/db/schema.ts with users table (id, email, password_hash, created_at)
- Created src/lib/db/index.ts exporting db singleton via Drizzle + Neon HTTP driver
- Created drizzle.config.ts pointing to schema.ts with postgresql dialect
- Created scripts/seed.ts reading AGENT_EMAIL/AGENT_PASSWORD to create hashed user row
- Generated drizzle/0000_milky_black_cat.sql migration (committed per user decision)
- db:migrate and db:seed pending user Neon database setup
2026-03-19 13:30:52 -06:00
Chandler Copeland
dac1bc817b feat(01-01): scaffold Next.js 16.2.0 project with all Phase 1 dependencies
- Created teressa-copeland-homes with TypeScript, Tailwind, ESLint, App Router, src dir
- Installed next-auth@5.0.0-beta.30 (pinned exact version), drizzle-orm, @neondatabase/serverless
- Installed bcryptjs, @vercel/blob, zod, drizzle-kit, tsx, dotenv
- Added db:generate, db:migrate, db:seed, db:studio npm scripts
- Verified npm run build passes with zero TypeScript errors
2026-03-19 13:29:56 -06:00