Frontend Overview
Frontend Overview
Source of truth: frontend/.
High-Level Structure
- Routes:
frontend/app/ - Shared UI:
frontend/components/ - API client (generated):
frontend/generated/(do not edit) - API client (handwritten):
frontend/lib/api-client.ts - Auth state:
frontend/hooks/use-auth.ts(Zustand store + actions)
API Base URL
Client-side API calls use:
NEXT_PUBLIC_API_URL(preferred)
Most code defaults to http://localhost:8080 for local Docker backend development.
Two HTTP Clients
apiClient-> baseNEXT_PUBLIC_API_URL(used by Orval hooks and custom API calls)authClient-> baseNEXT_PUBLIC_API_URL/_allauth/browser/v1(used byuse-auth.ts)
Both attach:
- cookies (
withCredentials) X-Session-Token(from localStorage when available)X-CSRFToken(fromcsrftokencookie when available)
See frontend/lib/api-client.ts.
Chat Streaming
The chat UI uses @ai-sdk/react with a custom transport pointed at:
POST /api/v1/ai/chat/stream
Implementation:
frontend/components/chat/chat-view.tsx- headers helper:
frontend/lib/chat-headers.ts
Last updated June 21, 2026