Skip to content

teixr12/trilingo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Trilingo (MVP) — Speaking/Listening Mandarin Coach

This is a dependency-free, static web app (plus optional PWA offline support) that turns the 5‑week conversational/business plan into a gameified practice engine.

Run locally

node scripts/dev-server.mjs

Then open:

  • http://localhost:5173

If your environment blocks opening local ports, use any other static server (or deploy to a host like Vercel).

Deploy (access anywhere)

This is a static site. Deploy the folder to any static host.

For AI Coach (server-side API key), use a host with serverless functions (Vercel recommended).

AI Coach (server-side)

The AI coach calls a serverless endpoint at api/coach.js so your API key stays on the server.

NVIDIA (Kimi K2.5 on build.nvidia.com)

On your host (e.g. Vercel), set env vars:

  • COACH_PROVIDER=nvidia
  • NVIDIA_API_KEY=...
  • (optional) NVIDIA_BASE_URL (default: https://integrate.api.nvidia.com/v1)
  • (optional) NVIDIA_MODEL (default: moonshotai/kimi-k2.5)

Notes:

  • The proxy retries once with the alternate model id (k2.5k2-5) if NVIDIA rejects the model string.

Kimi / Moonshot (optional)

On your host (e.g. Vercel), set env vars:

  • COACH_PROVIDER=moonshot
  • MOONSHOT_API_KEY=...
  • (optional) MOONSHOT_BASE_URL (default: https://api.moonshot.ai/v1)
  • (optional) MOONSHOT_MODEL (default: kimi-k2.5)

Any OpenAI-compatible API (if you have a Kimi endpoint/key)

If you have a 3rd-party “Kimi K2.5” API that is OpenAI-compatible (chat completions), set:

  • COACH_PROVIDER=compatible
  • COACH_BASE_URL=... (example: https://example.com/v1)
  • COACH_API_KEY=...
  • COACH_MODEL=...
  • (optional) COACH_AUTH_HEADER (default: Authorization)
  • (optional) COACH_AUTH_PREFIX (default: Bearer ; set empty if your provider uses a raw key header)

OpenAI (optional)

On your host (e.g. Vercel), set env vars:

  • COACH_PROVIDER=openai (or omit)
  • OPENAI_API_KEY=...
  • (optional) OPENAI_MODEL (default: gpt-4o-mini)

Then in the app: Settings → AI Coach → Enable.

(Recommended) Lock down the AI proxy

To prevent other websites from using your /api/coach endpoint, set:

  • COACH_ALLOWED_ORIGINS=https://your-domain.com,https://your-app.vercel.app

Cross-device login + sync (Supabase)

The app supports email+password login and syncs your full progress state to Supabase (per user).

  1. Create a Supabase project
  2. Run the SQL in supabase/schema.sql
  3. (Optional, recommended) On your host, set env vars so every device auto-loads these:
    • TRILINGO_SUPABASE_URL=... (or SUPABASE_URL)
    • TRILINGO_SUPABASE_ANON_KEY=... (or SUPABASE_ANON_KEY)
  4. In the app: Settings → Cloud login + sync (Supabase):
    • if you didn’t set env vars, paste Supabase URL + anon key
  5. Sign up / sign in
  6. Toggle Sync on

Notes

  • Voice features use the browser’s built-in APIs:
    • Text-to-speech: speechSynthesis
    • Speech recognition (when supported): webkitSpeechRecognition
  • Progress is stored in localStorage. Use Settings → Export/Import to move progress between devices.
  • Built-in modes:
    • Today: daily session generator (includes weak-item fix pack)
    • Tutor: asks simple questions; rewrites your reply naturally
    • Roleplay: business negotiation + travel
    • Grammar: reusable patterns + quick drills
    • Test: weekly speaking test that flags weak items

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors