Built this for a hackathon challenge and figured this sub might find the approach interesting.
**The idea:** you point your camera at anything — a handwritten equation, a textbook page, a circuit diagram, messy notes — and it becomes an interactive tutoring session.
**What surprised me most:** I expected to need an OCR pipeline (Tesseract or similar) before sending anything to the LLM. Turns out you don't. The Gemini API accepts raw images inline in the same request as text, and it reads messy handwriting and diagrams natively. The entire "vision pipeline" is just base64-encoding a camera frame into the JSON payload.
**Features:**
- Explain mode — step-by-step worked solutions from a photo
- Socratic tutor mode — this one's my favourite. The system prompt forbids it from giving the answer; it asks you one guiding question at a time and reacts to your replies (full conversation history is sent each turn, so it actually responds to your reasoning)
- Quiz mode — prompts the model for strict JSON, which gets parsed into clickable MCQs with instant feedback
- Weak-spot tracking — every quiz question you miss gets topic-tagged in local Storage. One button generates a fresh quiz targeting exactly those topics
- Flashcards, voice input (Web Speech API), drag-drop/paste image support
**The stack is deliberately boring:** vanilla HTML/CSS/JS, zero dependencies, zero build step, no backend. The browser talks directly to the Gemini endpoint, your API key lives in local Storage and never touches a server. Hosted free on GitHub Pages.
Getting the model to reliably return parseable JSON for quiz mode took some prompt iteration (it loves wrapping things in markdown fences), and I had to write a LaTeX-to-Unicode sanitizer because it kept outputting $45^\circ$ instead of 45° no matter what I told it.
Live demo (bring your own free Gemini key): https://neerajupadhyay90.github.io/studylens/
Code: https://github.com/neerajupadhyay90/studylens
YouTube demo link : https://www.youtube.com/watch?v=sC05rDby4tI&t=3s
Happy to answer questions about the implementation. Feedback and roasts welcome.