Next.js 16 (React 19) app for upload, search, chat, configuration, and maintenance. Uses the generated OpenAPI SDK (@/lib/api/generated).
Prereqs: Node 22, Yarn Classic (via corepack).
yarn install --frozen-lockfile
cp .env.local.example .env.local # if present; otherwise create .env.localKey envs (frontend/.env.local):
NEXT_PUBLIC_API_BASE_URL=http://localhost:8000
OPENAI_API_KEY=sk-your-key
OPENAI_MODEL=gpt-5-nano # optional
OPENAI_TEMPERATURE=1 # optional
OPENAI_MAX_TOKENS=1500 # optional
yarn dev # http://localhost:3000
yarn build
yarn start- Always call the backend via the generated SDK (
@/lib/api/generated), not manualfetch. - Client wrapper lives in
lib/api/client.ts.
- Upload, Search, Chat, Configuration, Maintenance (status/init/delete/reset).
- Use
lib/utils/logger.tsfor structured logging. - Global state lives in
stores/app-store.tsxwith hooks underlib/hooks(use-search-store,use-chat-store,use-upload-store,use-system-status).
Root docker-compose.yml example:
services:
frontend:
environment:
- NEXT_PUBLIC_API_BASE_URL=http://backend:8000
- OPENAI_API_KEY=sk-your-keyNEXT_PUBLIC_API_BASE_URL is evaluated at build time; rebuild the image after changing it.