🎙️ EasyEnglish: The Zero-Cloud-Cost, E2EE English Speaking Companion

🌟 About the Project

💡 What Inspired Us

Over 1.5 billion people worldwide are learning English. Yet, the vast majority hit an invisible barrier: the conversational freeze. Traditional apps like Duolingo turn language acquisition into gamified vocabulary drills, but fail to build spontaneous speaking fluency. The few apps offering live conversations route every voice packet through centralized media servers (SFUs/MCUs), racking up massive cloud bandwidth bills that force founders to shut down or hide behind exorbitant subscriptions. Worse, users are exposed to eavesdropping, data harvesting, and safety risks.

We set out to answer a single question:

Can we build a world-class, real-time speaking companion that guarantees absolute cryptographic privacy, offers 24/7 AI conversational coaching, and costs the developer exactly \$0.00 in idle and streaming infrastructure?

The answer is EasyEnglish.


🛠️ How We Built It

We designed EasyEnglish around three core pillars: Zero-Trust Privacy, Free-Tier Sustainability, and Seamless RevenueCat Monetization.

flowchart LR
    subgraph Client ["Flutter Mobile Client"]
        UI["Riverpod UI Engine"]
        E2EE["E2EE Cryptography Engine\nX25519 + HKDF + AES-GCM"]
        MOD["On-Device Moderation\nRegex & Rolling PCM Buffer"]
    end

    subgraph Monetization ["Monetization & Auth"]
        RC["RevenueCat SDK v10+\nEntitlement: easy_english_pro"]
    end

    subgraph Serverless ["Zero-Cost Edge Infrastructure"]
        Vercel["Vercel Edge Proxy\napi/coach.js"]
        Upstash["Upstash Redis\nDaily Quota Limiter"]
        Gemini["Google Gemini 1.5 Flash\nGrammar & Fluency Coach"]
    end

    Client -->|1. In-App Purchase| RC
    Client -->|2. Direct P2P Video Call| Client
    Client -->|3. Bearer Token Auth| Vercel
    Vercel -->|4. Verify Entitlement| RC
    Vercel -->|5. Check 50 req/day limit| Upstash
    Vercel -->|6. Grammar Analysis| Gemini

1. Peer-to-Peer WebRTC with Zero-Trust E2EE

Free 1-on-1 human matchmaking connects two learners directly device-to-device. We implemented an on-device cryptographic handshake using the Diffie-Hellman problem on Curve25519 ($X25519$):

  1. Both endpoints generate ephemeral key pairs: $(sk_A, pk_A)$ and $(sk_B, pk_B)$.
  2. The shared secret $K_{shared}$ is derived via: $$K_{shared} = X25519(sk_A, pk_B) = X25519(sk_B, pk_A)$$
  3. Symmetric keys are extracted using HKDF-SHA256: $$K_{session} = \text{HKDF-Extract-Expand}(K_{shared}, \text{info} = \text{"EasyEnglish-E2EE-v1"})$$
  4. Audio, video, and text data channels are authenticated with AES-256-GCM with monotonic sequence numbers $S_{seq} \in \mathbb{N}$ to eliminate replay attacks.
  5. To defeat Man-in-the-Middle (MITM) attacks without centralized certificate authorities, we calculate a deterministic 4-digit numeric code and 4-emoji Short Authentication String (SAS): $$\text{SAS} = \text{SHA-256}\Big(\min(pk_A, pk_B) \mathbin{\Vert} \max(pk_A, pk_B)\Big)$$ Users simply confirm they see the same emojis (e.g., 🚀 🐱 💎 🌟) on their screens.

2. The Gemini AI Speaking Coach & Zero-Cost Cloud Model

For learners too shy to speak to a stranger, or who want round-the-clock structured practice, we built the Gemini AI Speaking Coach.

  • Powered by gemini-1.5-flash, the tutor engages in realistic roleplays (ordering coffee, job interviews, airport navigation) and outputs structured grammar corrections.
  • The Developer-Cost-Shield: The client passes its RevenueCat app_user_id as a Bearer token to a serverless Vercel Edge proxy (/api/coach). The proxy verifies active entitlement (easy_english_pro) against the RevenueCat REST API and checks an Upstash Redis rolling counter. If the user is unentitled or exceeds 50 requests/day, requests are halted at the edge before incurring upstream API costs.

3. RevenueCat In-App Purchase Engine

Integrated using modern purchases_flutter (v10+) and purchases_ui_flutter:

  • Configured dynamic paywalls using RevenueCatUI.presentPaywallIfNeeded('easy_english_pro').
  • Built custom localized package pickers with a 48% savings badge for the yearly plan vs. monthly.
  • Integrated RevenueCatUI.presentCustomerCenter() to provide subscribers self-serve management, cancellation prevention, and purchase restoration.

4. Client-Side Content Moderation & Safety Shield

Because P2P media cannot be inspected by a central server, safety is enforced entirely on the client:

  • Homoglyph & Leetspeak Normalizer: Strips zero-width unicode characters and normalizes obfuscations (b!tch $\to$ bitch) in $<1\text{ms}$.
  • Scunthorpe-Safe Token Regex: Prevents false alarms on innocent everyday words ("classic", "pass", "assistant").
  • 15-Second Audio Safety Buffer: A rolling FIFO buffer of raw PCM audio ($16\text{kHz} \times 16\text{-bit} = 32\,\text{KB/s} \times 15\,\text{s} = 480\,\text{KB}$) kept entirely in memory. Only if a user taps Report & Block is the buffer packaged for abuse review.

📈 The Economics: Marginal Cost Function

For typical cloud apps, the total server cost $C_{total}$ scales linearly with total minutes spoken $M$ and concurrent streams $N$:

$$C_{\text{traditional}}(N, M) = N \cdot (\text{Signaling}) + M \cdot (\text{Bandwidth}_{\text{SFU}}) + M \cdot (\text{Transcoding})$$

In EasyEnglish, WebRTC media streams directly peer-to-peer ($0\,\text{bytes}$ through our servers), and AI calls are strictly capped:

$$C_{\text{EasyEnglish}}(N, M) = \$0.00 + \sum_{i \in \text{Pro}} \min(\text{Requests}i, 50) \times C{\text{Gemini}}$$

Since Pro users generate monthly subscription revenue $R_{sub} \gg 50 \times 30 \times C_{\text{Gemini}}$, our gross margin satisfies:

$$\text{Gross Margin} = \frac{R_{sub} - C_{compute}}{R_{sub}} > 92\%$$


🥊 Challenges We Faced & What We Learned

  1. Building on Low-Spec Hardware:

    • Challenge: Our development machine is an Intel Core i5 dual-core laptop with limited RAM. Heavy Android Studio emulators and standard 8GB Gradle daemons caused thermal throttling and out-of-memory crashes.
    • Solution: We tuned android/gradle.properties (-Xmx1536m -XX:MaxMetaspaceSize=512m, 2 workers), used headless Dart/Flutter testing (flutter test ran 23 tests in 13 seconds), and automated continuous APK builds via GitHub Actions on cloud runners.
  2. Mitigating Scunthorpe False-Positives on Mobile:

    • Challenge: Naive regex filters flagged words like "classic literature", "pass the salt", or "teaching assistant".
    • Solution: We designed tokenized boundary matching combined with character homoglyph decoders that evaluate only complete leetspeak words without degrading UI framerates.
  3. Eliminating Relay Latency with Direct E2EE:

    • Challenge: Implementing Diffie-Hellman key derivation asynchronously without delaying the instant WebRTC media track attachment.
    • Solution: Key pairs are computed during ICE candidate gathering so that symmetric session keys are ready the millisecond the RTCDataChannel opens.

🚀 Key Takeaways & What's Next

Building EasyEnglish proved that privacy and profitability do not have to be opposing forces. By pushing heavy media compute to the edge (user devices) and using RevenueCat to unlock AI capabilities, single-developer startups can launch resilient consumer platforms capable of supporting millions of users without risking cloud bankruptcies.

Next, we are preparing for app store publication across Google Play and the Samsung Galaxy Store for the RevenueCat Shipaton 2026.

Built With

Share this project:

Updates

Submission history