How animalnots/betterchatgpt-plus works
Main Components
• Electron Desktop Wrapper: Located in the “electron” directory, this part is used to bundle the web app as a desktop application.
• API & Business Logic Layer: Found in src/api and src/utils, these components handle OpenAI ChatGPT API calls, Google API calls, model parsing, and chat-related logic.
• State Management: The project makes extensive use of Redux slices in the src/store directory. This layer manages chats, configuration, authentication, and other global states.
• Internationalization (i18n): The public/locales directory holds translation files for multiple languages, indicating that text and UI strings are made available in various locales.
• Build & Deployment Configurations: Dockerfile, docker-compose.yml, Vite config files, and GitHub Actions workflows indicate options for containerization as well as continuous deployment. These are also helpful to include for a comprehensive view of where and how the app is built and deployed.
Relationships and Interactions
• Frontend UI (React components) as the primary user interface layer.
• The Electron layer should wrap around the frontend; include a separate block or boundary labeled “Desktop App (Electron)” to indicate that it encapsulates the web UI and adds any desktop-specific functionalities.
• Use of i18n components by showing a connection from the UI to “Translation Files (public/locales)” to denote dynamic loading of locale data.
Architectural Patterns and Principles
• Modularity and Reusability: The file structure (with folders for components, hooks, tools, and utilities) indicates that different functionalities are encapsulated within reusable modules.