Inspiration
OjekAI helps Indonesian ojek (motorcycle taxi) drivers keep track of every trip and understand their day.
What it does
- Log trips offline — date, time, pickup, destination, fare (Rp), distance (km), notes. Trips are stored in localStorage, so logging works with no connection at all.
- Summarize a trip (on-device) — one click, one or two sentences in Bahasa Indonesia, including whether the fare was fair for the distance.
- Daily report (cloud) — totals plus three insights: busiest hour, most profitable route, and one practical tip for tomorrow.
- Visible hybrid status — the header shows Firebase connection state and on-device model availability, and every AI result carries a badge showing which path actually ran: On-device · Gemini Nano, Cloud · Gemini, or Demo, read from the Firebase AI Logic property response.inferenceSource (JS SDK v12.5.0+), never guessed.
How we built it
Built with Firebase AI Logic hybrid inference: per-trip summaries use PREFER_ON_DEVICE — Gemini Nano answers instantly, offline, for free, falling back to cloud when Nano is unavailable. Daily reports use PREFER_IN_CLOUD — long-form reasoning over the full day's trips belongs on the cloud Gemini model. The app is Vite 8 + React 19 + TypeScript with Firebase JS SDK 13 (firebase/ai, Gemini Developer API backend, no billing required) and no backend of our own. Without Firebase config, the app runs in clearly-labelled DEMO mode: the full UI flow works end-to-end with a local deterministic summarizer, and every AI result is badged DEMO. To enable real AI, follow FIREBASE_SETUP.md in the repository.
What we learned
The two AI features have opposite shapes, so each one uses the compute that suits it — short, single-turn text on-device, and a long document (all trips + totals + insights) in the cloud. That is the hybrid inference fit for this app.
Built With
- ai
- firebase
- gemini
- nano
- react
- typescript
- vite
