The Problem
Half the world's students study where the internet is slow, expensive, or simply not there. When the connection drops, their AI tutor disappears with it — right in the middle of exam week.
What It Does
PocketScholar is an offline-first study companion that keeps working when the internet doesn't. Paste a textbook chapter, lecture transcript, or your own notes — or snap a photo of a page. It generates a summary with key points, flashcards, and a quiz, plus an Ask mode for questions about your notes — all in a clean study-pack view.
How Hybrid Inference Works
When Chrome has Gemini Nano, short notes run entirely on-device. Long notes use a tiered route: Nano first for anything under about 6,000 characters, then the cloud model (Gemini via Firebase AI Logic, model gemini-3.5-flash-lite) when the text is too long for the on-device session or Nano is unavailable. The routing is automatic — the same Generate button takes the cloud route when Nano can't run — and the result is explicit and visible: the badge always says which model actually produced the pack — On-device (Gemini Nano) or Cloud (Gemini) — with the elapsed time on screen.
Offline & Sync Architecture
Notes live in the browser first (IndexedDB), so the study session survives the bus, the blackout, and the dead zone. Photo OCR runs on-device (Tesseract.js, English + Indonesian). When you are back online, notes sync to Firestore (same device/browser); the app is a Firebase-hosted PWA with install + offline support. Q&A history stays on the device and is never synced.
Security & Privacy
The cloud route is guarded by App Check (reCAPTCHA Enterprise), Firestore rules scope data per device, and notes stay in your browser unless Firestore sync is configured. On-device runs never leave the device at all. Privacy and offline access, in exchange for patience.
Verified Test Results (19–20 Nov 2026)
- On-device: a 1,974-character note took 86.5 s on Gemini Nano (GitHub Codespace, Chrome 158, 19 Nov 14:35 WIB). The badge on screen is from that measured run, not an estimate. Why so slow: Nano runs fully locally — the trade-off is patience for privacy, and the live elapsed timer shows the real wait.
- Cloud: the same sample took 4.1 s (Gemini via Firebase AI Logic, badge on screen, 19 Nov). Retests on 19 Nov ranged 5.2–16.8 s; live desktop check 20 Nov: study pack 10.7 s, Q&A answer 2.8 s. Why it varies: network and model load — the live timer shows the real elapsed time on every run, so the number is never hidden.
- Offline: airplane-mode test on a real phone (19 Nov): the app opens from cache, on-device OCR reads a real textbook photo (87% confidence, 92 words), and Generate fails gracefully with a clear message — no crash.
- Features verified live 20 Nov: summary + 8 key points, 7 flip flashcards, 5-question quiz (4/5, answered live in the recorded run shown in the video), Q&A, "Synced to Firestore" status, and hard reload keeps the note, pack, and quiz score.
What's Built
A Firebase-hosted PWA (https://pocketscholar-198d8.web.app) with Firestore cloud sync (anonymous, per-device — no account), an offline queue (IndexedDB), PWA install + offline support, on-device photo OCR, and Q&A mode.
Why This Matters
The best AI in the world is useless if it needs a connection a student doesn't have. PocketScholar puts the model on the device — and is honest about when it can't.
Built With
- ai
- firebase
- firebase-ai-logic
- firestore
- gemini
- hosting
- indexeddb
- react
- typescript
- vite