How chatgptnextweb/chatgpt-next-web works
High-Level Components (Main Layer)
a) Client-Side Components:
• Web Application (Next.js)
• Desktop Application (Tauri)
• PWA Support
• Service Worker
b) Server-Side Components:
• API Routes (Next.js API)
• Model Providers Integration
• Cloud Storage Services
• Authentication System
Core Architectural Patterns
[Client Layer]
• Web Interface (Next.js)
• Components
• Store (State Management)
• Utils
• Desktop Client (Tauri)
• Native Shell
• Web View
[API Layer]
• Route Handlers
• Model Providers
• Authentication
• Configuration
[External Services]
• AI Models
• OpenAI
• Azure
• Other Providers
• Storage
• WebDAV
• UpStash
• Local Storage
Key Components to Highlight
a) Frontend Architecture:
• Components (/app/components)
• Store Management (/app/store)
• API Clients (/app/client)
• Utilities (/app/utils)
• Localization (/app/locales)
b) API Integration:
• Multiple Model Providers (/app/api/[provider])
• Authentication Handlers
• Configuration Management
• Storage Services
c) Cross-Platform Support:
• Web Application (Next.js)
• Desktop Client (Tauri)
• PWA Capabilities
Data Flow Patterns
Following interactions:
• Client-Server Communication
• State Management Flow
• Authentication Flow
• Model Provider Integration
• Storage Synchronization
Special Features
• Real-time Chat Support
• Plugin System
• Artifacts Management
• Multi-language Support
• Theme System (Dark/Light Mode)
• Prompt Templates
• Voice Integration