How zlcolin/everyone-can-use-english works
Project Type and Core Purpose
• The README states “AI 是当今世界上最好的外语老师,Enjoy 做 AI 最好的助教” – meaning the project is an AI-driven language-learning and speech assistant.
• The project supports a desktop application (built with a modern front-end toolchain and working with voice and chat components) and a web portal (using Nuxt in “1000h-portal”) along with a collection of training notebooks, scripted commands, and even content like a book.
• It also deploys worker scripts (entry, workers-site directories) implying serverless edge components; while CI/CD pipelines and GitHub workflows are used for building and deployment.
Analyzing the File Structure – Key Components
• The “enjoy” directory holds a large desktop application codebase with a typical two–process separation:
– A “main” process (found in src/main) that handles back‑end logic. This includes database migrations, command modules for speech transcription, audio processing, integration with external providers like Azure Speech SDK, GPT presets, and even components to run youtube download routines.
– A “renderer” process (found in src/renderer) with thousands of React/TSX UI components organized into features such as chats, audios, documents, transcription, preferences, and many “widget” components.
• The “1000h-portal” directory is a separate web portal built with Nuxt (see nuxt.config.ts, pages, layouts, assets) and even contains its own workers-site components.
• The “1000-hours” directory holds documentation, training content (Jupyter notebooks, self-training documents, phonetics exercises), and also a “workers-site” subfolder (with its own wrangler.toml files), highlighting deployment via serverless workers.
• There are additional directories like “entry”, “new-edition-drafts” and “book” that provide draft work, script samples, and book chapters. These serve as content and training material resources for the language training and AI assistant components.
Main Components and Their Relationships
a. Desktop Application (Enjoy):
– User Interface Layer (Renderer):
• Made up of strongly modular React/TSX components (for chats, audio assessments, documents, vocabulary, etc.).
• Communicates with the main process via IPC (inter-process communication channels) for performing heavy tasks.
– Application Core/Backend (Main Process):
• Contains modules that implement command logic (analyze, chat-suggestions, translation, etc.), database interfacing (with migration files and models for audios, chats, recordings, etc.) and various utility modules.
• Contacts external services (such as OpenAI/GPT, Azure Speech) through defined provider modules.
• Uses local file-system access and integrated libraries (e.g., whisper.cpp, Camdict, youtube downloader) for media and speech processing.
– Local Database and Storage:
• The “db” folder along with migrations and models in the Enjoy app indicates a local database used to store user settings, recordings, transcriptions, chat sessions, etc.
b. Web Portal (1000h-portal):
– A Nuxt‑based frontend where users can interact through web pages.
– Contains its own assets, public images, server configuration, and even a “workers-site” component – likely used as the static hosting or even a lightweight API layer.
– Integrates with the same API endpoints or backend services used by the desktop app, ensuring consistency of the experience.
c. Content/Training Resources:
– The “1000-hours” folder holds extensive learning content and Jupyter notebooks (for language and speech exercises) that can be diagrammed as a content delivery system.
– The “book” directory offers written guides, while “new-edition-drafts” and “自我训练” add ongoing updates and training modules.
d. External and Deployment Services:
– GitHub workflows (in .github/) automate builds, tests, releases and deployments for different platforms (Linux, macOS, Windows).
– Wrangler configurations (wrangler.toml files) are used to deploy portions (workers-site) on a serverless edge network (such as Cloudflare Workers).
– External AI services (such as OpenAI’s GPT, Azure Speech, and possibly Whisper) are integrated via provider modules.
Architectural Patterns and Design Principles
• The desktop app uses a typical Electron-like or cross‑platform architecture that clearly separates the UI (renderer) from business logic (main) and leverages IPC.
• The web portal is structured as a full‑stack Nuxt application following MVC-like routing and separation of concerns.
• Both parts are designed for high modularity:
– Extensive use of separated components, contexts, and reducers (especially in the Enjoy app) suggests a design using state management (React Context/reducers) for a fluid UI.
• There is a microservice flavor for the “workers-site” components and entry scripts which are deployed separately and form part of the distributed system.
Recommendations
1. User Interface Layer:
2. Application Core / Backend Layer:
– For Enjoy, illustrate the main process (API, command modules, DB access, provider modules) and its interactions with the renderer via IPC.
– For 1000h-portal, show the server-side logic as implemented in Nuxt, including server directories and API utilities.
3. Data and Storage Layer:
4. External Services – Integration Points:
5. Content Delivery/Training Resources:
– Indicate the training notebooks, book content, and self‑training folders as part of the content management system provided to end‑users.
– For example, from the renderer (UI) to the main process; from the main process to the local DB; from the main process to external AI services; and from web UI to server (Nuxt) endpoints.
– UI components (rectangles with rounded corners)
– Backend modules (rectangles with sharp corners)