Christopher Mayor
54879f3ab5
fix: force-dynamic on explore page to prevent static prerender crash with useSearchParams
2026-04-28 08:39:13 -07:00
Christopher Mayor
776f121eae
fix: merge comparisons [id] and [slug] routes to resolve ambiguous route error
2026-04-28 08:31:01 -07:00
Christopher Mayor
1c6e36cc6f
feat: implement issues #5-#8 — error states, header search, delete/toggle visibility, auth-aware UI
2026-04-28 08:21:00 -07:00
Christopher Mayor
e1d97178a1
fix: force-dynamic on profile page to prevent static prerender crash
2026-04-28 08:13:50 -07:00
Christopher Mayor
e0cbba6dc5
fix: type safety for profile page, exclude e2e from tsconfig
2026-04-28 07:15:59 -07:00
Christopher Mayor
50b9be2f1c
fix #4 : wire Profile page to real API data (user comparisons, stats, auth session)
2026-04-28 06:56:02 -07:00
Christopher Mayor
a2dabd527f
feat: support OpenRouter/custom LLM providers via env vars
...
Add LLM_API_KEY, LLM_BASE_URL, LLM_MODEL env vars so any
OpenAI-compatible API (OpenRouter, etc.) can be used as the LLM
backend without code changes.
2026-04-28 06:56:02 -07:00
Christopher Mayor
cfe50af1af
fix #12 : middleware __Secure- cookie prefix check
...
Middleware only checked for better-auth.session_token but HTTPS uses
__Secure-better-auth.session_token, causing all protected routes to
redirect to sign-in even when authenticated.
2026-04-28 06:56:02 -07:00
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
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
370fd2d8e6
fix: map users/sessions schema to better-auth expected names
2026-04-26 22:06:24 -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
7888d7995c
chore: update drizzle schema and migrations
2026-04-24 15:04:29 -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
e13b1ea2d5
feat: add Perplexity Sonar provider with OpenAI fallback
2026-04-24 14:34:55 -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
Christopher Mayor
d13780931e
scaffold: Next.js 15 + Drizzle + Better Auth + OpenAI + Recharts base
2026-04-24 14:29:47 -07:00