How bin-huang/chatbox works
Main System Components
a) Frontend Layer (Renderer Process):
• Main UI components (/src/renderer)
• Pages and dialogs
• Components for different AI providers
• Stores for state management
• i18n internationalization system
b) Backend Layer (Main Process):
• Main electron process
• System utilities
• Analytics
• Store management
• Proxy handling
c) Shared Layer:
• Types
• Defaults
• Common utilities
Electron Architecture
• Separation between Main and Renderer processes
• IPC (Inter-Process Communication) channels
• Preload scripts that bridge main and renderer
Data Flow
• User interface interactions
• API communications with various LLM providers
• Local storage operations
• State management flow
External Integrations
• Multiple AI providers (OpenAI, Claude, Google Gemini, etc.)
• Analytics services
• Team collaboration features
[User Interface Layer]
• Components (src/renderer/components)
• Pages (src/renderer/pages)
• Stores (src/renderer/stores)
• Hooks (src/renderer/hooks)
[IPC Bridge Layer]
[Main Process Layer]
• System Services
• File System Operations
• Window Management
[External Services Layer]
• AI Providers
• Analytics
• Team Collaboration
Specific Implementation Guidelines: