Christopher Mayor
2e138a8364
fix #12 : extract session token before dot (Better Auth signed cookie)
...
Better Auth cookie format is 'token.signature' but DB only stores the
token portion. Split on '.' to extract the actual session token.
2026-04-28 06:56:02 -07:00
Christopher Mayor
d8eb0eef8e
fix #12 : handle __Secure- cookie prefix in all auth bypass code
...
Better Auth sets cookies with __Secure- prefix when served over HTTPS.
Updated cookie parsing in compare, user/comparisons, and user/stats
routes to check for both __Secure-better-auth.session_token and
better-auth.session_token.
2026-04-28 06:56:02 -07:00
Christopher Mayor
371755c241
fix #12 : remove all auth.api.getSession() calls
...
- middleware.ts: cookie-presence check only (Edge Runtime can't use DB),
skip auth for API routes entirely
- compare/route.ts: manual session token parsing + db.select() queries
- user/comparisons/route.ts: same manual auth bypass
- user/stats/route.ts: same manual auth bypass
Root cause: Drizzle 0.45.2 queryWithCache bug triggers when
auth.api.getSession() is called from non-route-handler contexts.
Bypass entirely with direct db.select() on sessions/users tables.
2026-04-28 06:56:02 -07:00
Christopher Mayor
fe5153c4e5
fix #12 : bypass auth.api.getSession() Drizzle queryWithCache bug
...
Manually parse session token from cookie and query sessions/users
tables via db.select() (regular query builder) instead of using
auth.api.getSession() which triggers Drizzle 0.45.2 queryWithCache
internal error when called from non-route-handler async context.
2026-04-28 06:56:02 -07:00
Hermes Agent
26c7ad4d7b
Add Playwright E2E test suite (25 tests across 4 specs)
...
- playwright.config.ts: headless CI setup with JSON/HTML reporters
- e2e/global-setup.ts: app reachability check before tests
- e2e/auth.spec.ts: 6 auth tests (sign-in, session, protected routes)
- e2e/compare.spec.ts: 8 API tests (validation, SSE flow, DB persistence)
- e2e/comparisons.spec.ts: 6 CRUD tests (list, detail, 404, view counts)
- e2e/user.spec.ts: 5 user tests (stats, pagination, session binding)
- e2e/helpers.ts: shared SSE parsing, auth, URL resolution utilities
- e2e/README.md: setup and run instructions
- AGENTS.md: updated with LLM provider notes and testing docs
- .gitignore: added playwright report/result directories
- package.json: added @playwright/test and test:e2e scripts
2026-04-27 20:48:05 -07:00
Christopher Mayor
8f64ccd2f6
fix: pass original request headers to auth.api.getSession
2026-04-27 12:05:50 -07:00
Christopher Mayor
419d96aedc
fix: disable drizzle query cache (NoopCache) to fix queryWithCache bug
2026-04-27 12:01:42 -07:00
Christopher Mayor
561e7b546e
debug: add postgres.js debug logging
2026-04-27 11:57:23 -07:00
Christopher Mayor
d686d1bd4f
fix: use plain Headers for auth session lookup in compare route
2026-04-27 11:43:42 -07:00
Christopher Mayor
3cb771a1cd
debug: add error catching to compare getSession
2026-04-27 11:39:06 -07:00
Christopher Mayor
b44277506a
fix: add withTimezone to session and verification expiresAt timestamps
2026-04-27 11:35:02 -07:00
Christopher Mayor
33d68502fb
fix #12 : explicit model name mapping in drizzle adapter schema
2026-04-27 11:29:12 -07:00
Christopher Mayor
eab1618d04
fix #12 : pass full schema to drizzle adapter
2026-04-27 11:26:34 -07:00
Christopher Mayor
273b600e98
fix #12 : simplify auth adapter, add verifications table
2026-04-27 11:22:42 -07:00
Christopher Mayor
024f3cb1f7
fix #12 : add missing session fields ipAddress and userAgent to Drizzle schema
2026-04-27 11:01:30 -07:00
Christopher Mayor
cd51f2a0c8
fix #12 : add accounts table for Better Auth credential storage
2026-04-27 10:57:15 -07:00
Christopher Mayor
4d5e1502e9
fix #9 #10 #11 : fix email_verified schema, add auth gate to compare, use real user id
2026-04-27 10:33:22 -07:00
Christopher Mayor
56b6f67d00
fix: update docker-compose to use shared postgres and Traefik labels
2026-04-26 22:16:24 -07:00
Christopher Mayor
370fd2d8e6
fix: map users/sessions schema to better-auth expected names
2026-04-26 22:06:24 -07:00
Christopher Mayor
089de443a0
docs: update deployment section with current production state
...
- Document production URL (comparaison.local.tophermayor.com)
- Detail host (ubuntu/192.168.50.61), Traefik ingress, shared Postgres
- Add Docker label routing, proxy-net network info
- List recent fixes: userId in comparison inserts, OpenAI getClient(), BETTER_AUTH_SECRET
2026-04-26 17:39:40 -07:00
Christopher Mayor
78e1c74fa3
fix: use getClient() instead of undefined client in openai provider
2026-04-26 16:55:59 -07:00
Christopher Mayor
d9ed1586cc
fix: use title as fallback query instead of null in compare route
2026-04-26 16:53:21 -07:00
Christopher Mayor
5187d75d53
fix: add userId to comparison inserts (placeholder 'system' until auth is wired)
2026-04-26 16:50:07 -07:00
Christopher Mayor
8d2239aebd
fix: use viewCount instead of views in profile page
2026-04-26 16:44:21 -07:00
Christopher Mayor
0b523b7274
fix: replace mockUser/mockComparisons with proper local variables in profile page
2026-04-26 16:43:25 -07:00
Christopher Mayor
db30a7e178
Merge branch 'feat/wire-pages'
2026-04-26 15:58:04 -07:00
Christopher Mayor
50fd4cda6a
Merge branch 'feat/api-endpoints'
2026-04-26 15:58:04 -07:00
Christopher Mayor
565085aba1
feat: wire up explore and profile pages
...
Updated explore and profile page components.
2026-04-26 15:58:00 -07:00
Christopher Mayor
c9e6e156ac
feat: add comparison and user API endpoints
...
New API routes under src/app/api/ for comparisons and user operations.
2026-04-26 15:57:58 -07:00
Christopher Mayor
494dcb91fa
fix: remove duplicate users table definition in schema
...
The users table was defined twice with conflicting field orderings
(timestamp vs boolean for emailVerified, different default placements).
Kept the cleaner definition and removed the duplicate.
2026-04-26 15:55:47 -07:00
Christopher Mayor
3c5df6a74c
docs: add v0.2-v0.4 implementation plan for feed, profile, auth, and search
2026-04-26 01:16:35 -07:00
Christopher Mayor
7888d7995c
chore: update drizzle schema and migrations
2026-04-24 15:04:29 -07:00
Christopher Mayor
3689b1707a
chore: gitignore worktree directories
2026-04-24 15:03:14 -07:00
Christopher Mayor
aac0e2f5b1
docs: comprehensive documentation - README, specs, architecture, API reference, UI/UX flow, dev guide
2026-04-24 15:02:40 -07:00
Christopher Mayor
5bde4e3aa6
Merge branch 'feat/backend'
2026-04-24 15:01:37 -07:00
Christopher Mayor
6832fbdebb
Merge branch 'feat/frontend'
2026-04-24 15:01:21 -07:00
Christopher Mayor
43f011e519
feat: complete frontend UI - comparison views, profile, explore, layout
2026-04-24 14:39:54 -07:00
Christopher Mayor
37c07e468d
fix: lazy-init OpenAI client to avoid build failure without API key
2026-04-24 14:37:28 -07:00
Christopher Mayor
a273f29e07
feat: improve compare API route with searching stage and validation
2026-04-24 14:36:06 -07:00
Christopher Mayor
2f4239a83b
feat: add provider fallback chain with priority system
2026-04-24 14:35:20 -07:00
Christopher Mayor
3539a5f3eb
feat: add .env.example with required environment variables
2026-04-24 14:35:19 -07:00
Christopher Mayor
e13b1ea2d5
feat: add Perplexity Sonar provider with OpenAI fallback
2026-04-24 14:34:55 -07:00
Christopher Mayor
26d879c82e
feat: add standalone output to next.config.ts for Docker builds
2026-04-24 14:34:50 -07:00
Christopher Mayor
66a2d647bb
feat: add Dockerfile and docker-compose.yml for containerized deployment
2026-04-24 14:34:35 -07:00
Christopher Mayor
637f1540cf
feat: update research pipeline with Tavily search and progress stages
2026-04-24 14:34:22 -07:00
Christopher Mayor
2c2fd3547c
feat: add auth middleware protecting /compare and /profile routes
2026-04-24 14:34:13 -07:00
Christopher Mayor
3568e2f008
feat: update Better Auth config with schema and session expiry
2026-04-24 14:33:54 -07:00
Christopher Mayor
71ef567d0d
feat: enhance OpenAI provider with web research context
2026-04-24 14:33:50 -07:00
Christopher Mayor
d8ff5f4bb1
feat: add users and sessions tables for Better Auth
2026-04-24 14:33:37 -07:00
Christopher Mayor
3a448a5063
feat: add Tavily search provider
2026-04-24 14:33:20 -07:00