Inspiration

I am a bilingual teacher with more than 30 years of experience, from Pre-K to adult and corporate training, in Austin, Texas. Every year I meet parents, workers and heritage speakers who need to practice English or Spanish for real life: a doctor's visit, a job interview, a meeting with their child's teacher. They tell me the same three things: they are embarrassed to make mistakes in front of people, they are afraid to type personal situations into online tools, and their internet is not always reliable. Puente ("bridge" in Spanish) is my answer.

What it does

Puente is a free web app for adults at CEFR levels A1, A2 and B1. It works in both directions: English with explanations in Spanish, or Spanish with explanations in English.

  • Talk: role-plays 8 real-life situations (doctor, job interview, parent–teacher conference, grocery store, renting an apartment, bank, restaurant, neighbor). The AI plays the other person at the learner's level and adds a correction and a tip in the learner's native language. Voice input and read-aloud are supported.
  • Write: corrects a text, offers a more natural version, a 1–5 score, encouragement and explained mistakes.
  • Lesson: creates five useful words with examples, translations and a three-question quiz on everyday topics.
  • Explain: translates a real text the learner received (for example, a school notice), explains what it asks and suggests a polite reply.
  • Progress: streak, activity, saved words and a chart of how many AI requests ran on-device versus in the cloud.

Every AI answer shows a badge — "🔒 On this device" or "☁️ Cloud" — with its response time. Without AI or internet, Puente still works with built-in guided dialogues, writing exercises and offline lessons.

How I built it

  • All AI calls go through Firebase AI Logic (getAI, getGenerativeModel, generateContent) with the Gemini Developer API, protected by Firebase App Check (reCAPTCHA Enterprise / Fraud Defense).
  • Hybrid inference: the default mode is InferenceMode.PREFER_ON_DEVICE, with expected input and output languages English and Spanish. On desktop Chrome, prompts run on Gemini Nano; otherwise they fall back to the cloud model.
  • Privacy-aware routing: personal scenarios (doctor, bank) switch to ONLY_ON_DEVICE when Gemini Nano is available, so that text never leaves the computer. Learners can also choose Hybrid, Device only or Cloud only in Settings.
  • Single-turn prompts: the conversation history is included in each prompt, because the on-device model does not support multi-turn chat. This makes the same conversation work on-device and in the cloud.
  • Structured output: on-device requests use a JSON Schema responseConstraint; cloud requests use responseMimeType: application/json.
  • initializeDeviceModel() runs on a user gesture to prepare Gemini Nano, and response.inferenceSource drives the badges and statistics.
  • The whole app is a single HTML file with the Firebase JS SDK bundled inside, hosted on GitHub Pages. Progress is stored only in the browser's localStorage.

Challenges I ran into

I am a teacher, not a professional developer, so setting up Firebase, App Check and GitHub Pages for the first time was my biggest challenge. Technically, designing prompts that run well on a small on-device model required keeping every request single-turn, short and structured. I also had to make sure the app stays useful when there is no AI and no connection.

Accomplishments that I'm proud of

  • Seeing my first conversation answered by Gemini Nano with the badge "On this device."
  • Giving learners real control over their privacy, with automatic on-device routing for personal topics.
  • Building one app that serves two communities: Spanish speakers learning English and English speakers learning Spanish.

What I learned

How hybrid inference works in practice, how to design prompts and JSON schemas for a small local model, and how to protect an AI-powered web app with App Check.

What's next for Puente

More scenarios (pharmacy, DMV, emergency calls), pronunciation feedback, more levels (B2), and a teacher view that adult-education programs can use in class.

Share this project:

Updates

Submission history