How qabot-zh/chatgpt-next-web works
Project type and purpose
• This is a full-stack hybrid web & desktop chat application (NextraChat).
• Purpose: Provide a customizable ChatGPT-like UI with multiple AI providers, cloud backup, file upload, i18n, and optional desktop packaging via Tauri.
File structure
• Top level:
• config files (Dockerfile, tsconfig.json, next.config.mjs, GitHub workflows)
• app/ – Next.js “app” directory containing:
– api/ – serverless route handlers for anthropic, openai, google, upstash (key-value), webdav
– client/ – client-side adapters, controller logic, platform drivers
– components/ – UI React components (chat, sidebar, settings, etc.)
– config/, constant.ts, utils.ts, utils/ – build, client, server config and utility functions
– store/ – Zustand or Redux-style state management slices
– locales/, masks/ – internationalization and prompt templates
– layout.tsx, page.tsx – root layout and pages
• public/ – static assets (prompts.json, service worker)
• scripts/ – automation for deployments and prompt fetching
• src-tauri/ – Rust back end for the Tauri desktop app
• docs/ – user manual and deployment guides
• Patterns:
• Next.js App Router for SSR/SSG and serverless API
• Client-side state management via store/
• Modular “platform” pattern for AI providers
• Tauri bridge for desktop packaging
README insights
• Core features: model selector, chat history search, OCR, translation, cloud backup
• Supported AI channels: OpenAI, Anthropic, Google, Upstash (for KV backup), WebDAV (for file backup)
• Extensive environment variable configuration for provider keys, UI customization, and feature toggles
• Multiple deployment targets: Docker, Vercel, Cloudflare Pages, Tauri desktop