How to Integrate Everyone-Can-Use-English with Other Tools: A Complete Integration Guide
Integrate Everyone-Can-Use-English (ECUE) via its API client, provider modules, database handlers, WebSocket channels, or reusable Node utilities to embed it as a library, call services from servers, or wire into broader workflows.
Everyone-Can-Use-English is a modular Electron application built with Vite, TypeScript, and SQLite. Understanding how to integrate everyone-can-use-english with other tools opens up possibilities for building custom language-learning platforms, transcription pipelines, or LLM-powered assistants. This guide covers every integration point with runnable code examples from the ZuodaoTech/everyone-can-use-english source code.
Integration Architecture Overview
ECUE separates concerns into three distinct layers that external tools can tap into:
| Layer | Purpose | Key File |
|---|---|---|
| Renderer | React-based UI communicating via IPC | enjoy/src/renderer.ts |
| Preload | Secure Node API bridge to renderer | enjoy/src/preload.ts |
| Main | Core logic, filesystem, database, external services | enjoy/src/main.ts |
External integration happens through well-defined boundaries in the main process layer, where Node.js capabilities remain fully available.
Integration Method 1: API Client for HTTP-Style Communication
The ApiClient class in enjoy/src/api/client.ts provides a thin wrapper around ECUE's internal endpoints. This is the cleanest way to integrate everyone-can-use-english with other tools when you need high-level operations like creating recordings or fetching transcriptions.
// example-integration.ts
import { ApiClient } from 'path/to/everyone-can-use-english/enjoy/src/api/client';
const client = new ApiClient({ baseURL: 'http://localhost:3000/api' });
async function createRecording(videoUrl: string) {
const resp = await client.post('/recordings', { url: videoUrl });
console.log('Recording created:', resp.data);
}
createRecording('https://www.youtube.com/watch?v=abc123');
The client reads the same configuration as the main application, ensuring consistent behavior across external calls.
Integration Method 2: Provider Modules for Media Extraction
Provider modules in enjoy/src/main/providers/*.ts expose a standardized fetchResources API. These plug-in-style modules handle YouTube, TED, Audible, and other sources—perfect for batch processing or server-side media pipelines.
import { YoutubeProvider } from 'path/to/everyone-can-use-english/enjoy/src/main/providers/youtube-provider';
async function getMeta(id: string) {
const provider = new YoutubeProvider();
const meta = await provider.fetchResources({
url: `https://www.youtube.com/watch?v=${id}`
});
console.log(meta);
}
getMeta('abc123');
Additional providers follow the same pattern:
- TED —
enjoy/src/main/providers/ted-provider.ts - Audible —
enjoy/src/main/providers/audible-provider.ts
Each returns normalized metadata including subtitles, audio URLs, and duration information.
Integration Method 3: Database Handlers for Direct Data Access
For low-level operations, import the SQLite connection from enjoy/src/main/db/index.ts or use specific handlers in enjoy/src/main/db/handlers/*.ts.
import { db } from 'path/to/everyone-can-use-english/enjoy/src/main/db';
async function countCompletedRecordings() {
const rows = await db.all(
'SELECT COUNT(*) AS cnt FROM recordings WHERE status = ?',
['completed']
);
console.log('Completed recordings:', rows[0].cnt);
}
countCompletedRecordings();
Domain-specific handlers like recordings-handler.ts encapsulate CRUD logic and validation, making them safer than raw SQL for most use cases.
Integration Method 4: WebSocket Channels for Real-Time Events
The cable system in enjoy/src/renderer/cables/channels/notifications_channel.ts broadcasts transcription progress, completion events, and other updates.
import { NotificationChannel } from 'path/to/everyone-can-use-english/enjoy/src/renderer/cables/channels/notifications_channel';
const channel = new NotificationChannel('ws://localhost:3000/cable');
channel.on('transcription-progress', (payload) => {
console.log('Progress:', payload.percentComplete);
});
Subscribe to these channels from external services to trigger downstream workflows without polling.
Integration Method 5: Reusable Node Utilities for Automation
Two standalone modules enable headless automation and CI integration:
enjoy/src/main/proxy-agent.ts— Configurable HTTP/HTTPS proxy handlingenjoy/src/main/downloader.ts— Batch audio/video download orchestration
Import these directly in Node scripts to build automated pipelines:
import { Downloader } from 'path/to/everyone-can-use-english/enjoy/src/main/downloader';
const dl = new Downloader({ concurrency: 4 });
await dl.queueBatch(urlList, {
onComplete: (file) => uploadToS3(file),
onError: (err) => logToMonitoring(err)
});
Key Integration Files Reference
| File | Integration Purpose |
|---|---|
enjoy/src/api/client.ts |
HTTP-style API wrapper |
enjoy/src/api/index.ts |
API utilities export barrel |
enjoy/src/main/db/index.ts |
Central SQLite connection |
enjoy/src/main/db/handlers/recordings-handler.ts |
Recording CRUD operations |
enjoy/src/main/providers/youtube-provider.ts |
YouTube metadata extraction |
enjoy/src/main/providers/ted-provider.ts |
TED talk processing |
enjoy/src/renderer/cables/channels/notifications_channel.ts |
Real-time event subscription |
enjoy/src/main/downloader.ts |
Batch download automation |
enjoy/src/main/proxy-agent.ts |
Proxy configuration utility |
Choosing the Right Integration Approach
- Use the API client when you need stability and don't want to manage database connections
- Use provider modules for media-focused workflows independent of ECUE's storage
- Use database handlers for analytics, migrations, or data synchronization tasks
- Use WebSocket channels when real-time responsiveness matters
- Use downloader/proxy utilities for automation and batch processing
Multiple approaches can be combined. For example, trigger recordings via the API client, monitor progress through WebSocket channels, then query completed results through database handlers.
Summary
- ECUE exposes five primary integration surfaces: API client, provider modules, database handlers, WebSocket channels, and reusable Node utilities
- All integration points live in the main process layer with full Node.js capability
- The
ApiClientclass (enjoy/src/api/client.ts) provides the most stable external interface - Provider modules offer plug-and-play media extraction from YouTube, TED, and other sources
- Direct database access through
enjoy/src/main/db/index.tsenables custom analytics and data pipelines - Real-time integration is possible via the notification channel system in
enjoy/src/renderer/cables/
Frequently Asked Questions
Can I run ECUE integrations without launching the full desktop application?
Yes. The provider modules, database handlers, and downloader utilities are pure Node.js code with no Electron dependencies. Import them directly in server-side scripts or CLI tools. Only the renderer process and WebSocket channels require the full application to be running.
What authentication is required for external API calls?
The ApiClient reads configuration from the same sources as the main application, including any bearer tokens or API keys stored in ECUE's settings. For direct database access, standard SQLite file permissions apply—ensure your external process has filesystem access to the ECUE data directory.
How do I handle schema changes when integrating directly with the SQLite database?
Database handlers in enjoy/src/main/db/handlers/*.ts abstract schema details and include migration logic. Import and use these handlers rather than writing raw SQL when possible. For custom queries, monitor the handler source files for schema updates between ECUE releases.
Are there rate limits or concurrency constraints on provider modules?
Individual providers implement their own throttling. The YoutubeProvider includes built-in delays and retry logic to respect service terms. The Downloader utility accepts a concurrency option to control parallel requests. Review each provider's implementation in enjoy/src/main/providers/ for specific limits.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →