Local

All work

P/04

LingoAI

Practice Japanese by chatting with AI personalities: every message is translated on the fly and spoken aloud with natural Japanese speech.

LingoAI logo on orange: a white cursive li script, two speech bubbles holding the Japanese あ and the letter A, and the LINGOai wordmark

Language apps drill vocabulary but rarely give you someone to talk to. LingoAI is a SvelteKit web app where you message GPT-powered chatbot personalities in English or Japanese, tap any message for an instant translation, and hear replies spoken aloud.

Typing English sends the bot Japanese via DeepL; typing Japanese is detected with wanakana and stored as-is. Replies come from OpenAI through LangChain with a casual Japanese-speaking-friend persona. Every Japanese message has a play button that synthesizes audio on demand through a VOICEVOX engine, and Supabase handles auth, profiles, chatbots, and full conversation history so sessions persist.

Shipped as an early prototype with a marketing landing page and waitlist. Japanese is the only target language wired up so far; an ElevenLabs route is scaffolded for others. The write-up below covers how a message travels through the app.

Case study

01 Intro: the passion for learning

To this day, the one thing I value the most is my passion for learning. I don't know if it stems from my ADHD or something else, but bettering myself every day is pretty fulfilling. One of those things was learning a language. I grew up bilingual (English and Vietnamese) and learned both Spanish and Japanese in school. At the time I was really focused on Japanese, and that led me to study abroad in Japan for a semester. I've got to say it was one of the best experiences of my life, but that's a story for another day.

This is probably the main reason I wanted to start LingoAI. As for the name: if you don't know me quite well yet, I love wordplay. Ringo (りんご) is apple in Japanese, but it sounds like "lingo" if you pronounce it the way a native Japanese speaker would.

02 Talk to me

Here's what happens when you hit send. First the app asks wanakana, a tiny Japanese text library, whether what you typed is Japanese. If it is, it goes through as-is. If it's English, DeepL translates it to Japanese first, so the bot always hears Japanese and you get to practice reading its side of the conversation. The message then goes to OpenAI through LangChain, and the reply comes back and gets saved next to your message in Supabase.

The entire personality is one line of system prompt: "You are a casual friend that speaks Japanese." Sometimes that's all it takes. Tap any message and you get a DeepL translation in the other direction, which is cached back to the database so the same message is never translated twice. (DeepL charges per character, and I am but one man.)

03 Say it out loud

Reading is only half of it. Every Japanese message has a play button, and pressing it sends the text to VOICEVOX, an open-source Japanese speech engine. The server asks it for an audio query, then a synthesis, and writes the result out as a wav file for the browser to play. I turned on its interrogative upspeak setting so questions actually rise at the end like a person asking them. Honestly, hearing the bot talk back for the first time was the moment this felt like a real thing.

The catch: VOICEVOX runs locally, so audio only works where the engine is running, and the generated files get swept out every time the chat page loads. An ElevenLabs route is already scaffolded for other languages. Both of those are on the list for whenever this graduates from prototype.

04 The boring but important bits

Supabase handles the unglamorous parts: sign-in, profiles, the list of chatbot personalities you pick from in the side drawer, and every message you've ever sent, so a conversation is still there when you come back. The app itself is SvelteKit and TypeScript with SCSS, the chat uses form actions rather than a pile of client-side fetches, and it's deployed on Vercel. The landing page is a waitlist for now rather than a public sign-up.

05 What's next

LingoAI is an early prototype and I'm okay with that. Japanese is the only language wired up and the audio needs a local engine. But the loop works: you type, a friend replies in Japanese, you tap to understand, and you press play to hear it. Next up is more languages and more personalities, ranging from casual to serious. またね!

Year
2023
Type
Web app
Role
Solo build
Stack
SvelteKit / TypeScript / Supabase / OpenAI / DeepL / VOICEVOX

Read 0%