Portfolio / Featured / AI / LLM · Web / Frontend
AhaWin
An evidence-first STEM reflection app: learners review the evidence, test a rule, explain it and try a fresh problem, with cost-protected Gemini analysis.
Problem
Answer checkers tell learners that they are wrong but not which step, and an AI tutor can invent a misconception from a photo that shows no reasoning at all.
What the repository shows
- Three curated examples run with zero model calls, and live AI is off by default.
- A missing-evidence route: a photo of the question alone cannot unlock an invented misconception.
- At most two sequential Gemini attempts, with strict response validation, numeric-equality checks and one total time budget.
- Shared Redis reservations, cooldowns and fail-closed daily quotas protect cost; an optional access code limits a pilot.
- No runtime npm dependencies: KaTeX is vendored, and photos are resized and stripped of metadata in the browser.
JavaScript · Node.js 24 · Gemini API · Upstash Redis · KaTeX · Vercel
Evidence for this project1 source
- Repository documentedRepository documentation
AhaWin includes curated STEM examples that need no model call, and limits Gemini to at most two sequential attempts with validation and budgets.
Added three curated, zero-model-call examples: distribution, adding fractions, and factoring before cancellation.
- Not represented as compliant for an under-18 audience; live Gemini use is not certified without the deployment's credentials.
README.md (opens in a new tab) @ fabe9e3 · reviewed 2026-10-26 · In the ledger
How it works
- Upload or paste a photo of worked steps; it is resized and stripped of metadata locally.
- The server checks budgets and asks Gemini for a structured lesson contract.
- The response is validated and its numbers re-checked; a second model is tried at most once.
- The learner reviews the evidence, tests a rule, explains it and tries a fresh problem.
Engineering evidence
- Tests
- 108 test definitions in 5 files, plus an optional Playwright browser suite
- CI
- GitHub Actions
- Deployment
- Vercel: static public/ with api/ functions
- Licence
- MIT
Counted from the repository at commit fabe9e3; the tests were not run for this site.
Limitations
- Not represented as compliant for an under-18 audience.
- Numeric checking supports a small grammar; symbolic reasoning still needs human judgement.
- Live Gemini and Redis connectivity cannot be certified without the deployment's credentials.