What it is. DongengKu is a bilingual (Indonesian/English) children's story companion. A child or parent picks a theme, a character, a reading age (4–6 / 7–9 / 10–12) and a story length, and DongengKu writes a brand-new story — then reads it aloud, retells it briefly, and saves favourites for bedtime. How Firebase AI Logic is used. All AI inference runs through the Firebase AI Logic SDK (firebase/ai). Short retellings use one hybrid model created with InferenceMode.PREFER_ON_DEVICE: the SDK tries on-device Gemini Nano first (Chrome Prompt API) and falls back to cloud Gemini automatically. Full stories use the same hybrid model first, with an explicit cloud retry (gemini-2.5-flash) if the hybrid call fails. Every response reports its route via response.inferenceSource (ON_DEVICE / IN_CLOUD), and the UI shows the route + latency under each story — so the hybrid behaviour is visible, not claimed. initializeDeviceModel() warms up Nano on the Generate tap (user gesture, as Chrome requires). Anonymous Auth + Firestore store favourites (per-user rules); App Check protects AI Logic. Why hybrid fits this app. Retellings are short, private and repeated — perfect for free, instant, offline on-device inference. Full stories are longer and more creative — worth the cloud model. Splitting this way keeps costs near zero, keeps working offline for the short tasks, and never leaves a child without a story. Value. In Indonesia, quality bilingual bedtime stories are scarce and expensive. DongengKu gives any family with Chrome a free, age-adapted, read-aloud storyteller that respects privacy (short tasks never leave the device) and works even on a weak connection.

Built With

Share this project:

Updates

Submission history