nanochat/scripts
Manmohan Sharma aa7a907063
feat(frontend): wire frontend to real backend auth + chat-api services
Remove NextAuth and replace with token-based auth against the backend
auth service (OAuth + JWT). The frontend now redirects login to
/api/auth/google and /api/auth/github (proxied by nginx to the auth
service), captures the JWT from the redirect query param, and uses it
for all API calls.

Key changes:
- Remove next-auth dependency and all NextAuth config/routes
- Add lib/auth-client.ts (JWT token storage + auth headers)
- Add hooks/useAuth.ts (client-side auth state + token capture)
- Rewrite middleware.ts to pass-through (client-side auth only)
- Login page uses plain <a> links to /api/auth/{provider}
- Chat page captures access_token from OAuth redirect
- Zustand store fetches conversations from real chat-api via JWT
- API routes proxy /api/conversations/* to chat-api with auth
- chat/stream route supports conversationId + auth header forwarding
- useSSE hook accepts auth headers for authenticated streaming
- Sidebar loads conversations from API, supports delete
- Landing page (Hero, LandingNav) uses useAuth instead of useSession
- Add .env.production.example and scripts/generate-jwt-keys.sh

Mock echo fallback preserved when CHAT_API_URL is not set.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-16 13:21:38 -07:00
..
base_eval.py delete autocast, an unnecessary thorn in my side, manage dtypes directly 2026-03-04 23:55:30 +00:00
base_train.py Add pre-GPU tool training and checkpoint plumbing 2026-03-24 20:52:36 -04:00
build_tool_datasets.py Add pre-GPU tool training and checkpoint plumbing 2026-03-24 20:52:36 -04:00
chat_cli.py rebrand to samosaChaat: UI, logo, and server messages 2026-03-23 09:58:12 -04:00
chat_eval.py Add pre-GPU tool training and checkpoint plumbing 2026-03-24 20:52:36 -04:00
chat_rl.py Add pre-GPU tool training and checkpoint plumbing 2026-03-24 20:52:36 -04:00
chat_sft.py Add pre-GPU tool training and checkpoint plumbing 2026-03-24 20:52:36 -04:00
chat_tool_rl.py Add pre-GPU tool training and checkpoint plumbing 2026-03-24 20:52:36 -04:00
chat_web.py rebrand to samosaChaat: UI, logo, and server messages 2026-03-23 09:58:12 -04:00
demo-schema-change.sh feat(ops): Day 2 operations automation and chaos runbook (#10) 2026-04-16 12:25:47 -07:00
export_onnx.py redesign UI: artisan landing page + warm chat theme + ONNX export script 2026-03-23 11:54:07 -04:00
generate-jwt-keys.sh feat(frontend): wire frontend to real backend auth + chat-api services 2026-04-16 13:21:38 -07:00
hf_sync_checkpoint.py Add pre-GPU tool training and checkpoint plumbing 2026-03-24 20:52:36 -04:00
import_hf_checkpoint.py Add pre-GPU tool training and checkpoint plumbing 2026-03-24 20:52:36 -04:00
local-dev.sh scaffold monorepo platform layout 2026-04-16 11:06:29 -07:00
rotate-nodes.sh feat(ops): Day 2 operations automation and chaos runbook (#10) 2026-04-16 12:25:47 -07:00
seed-db.sh scaffold monorepo platform layout 2026-04-16 11:06:29 -07:00
tok_eval.py initial commit 2025-10-13 06:49:24 -07:00
tok_train.py quick fix to not OOM main speedrun script 2026-01-26 22:31:42 +00:00
verify_external_access.py Add pre-GPU tool training and checkpoint plumbing 2026-03-24 20:52:36 -04:00
verify-deployment.sh feat(ops): Day 2 operations automation and chaos runbook (#10) 2026-04-16 12:25:47 -07:00