I wanted to build something useful for people who can't easily explain their symptoms to a doctor — and do it with zero server storage, no accounts, and no exposed API keys.
Here's what I ended up with and how it works.
What it does
User describes their health concern in plain language
AI asks focused follow-up questions (like a warm family doctor)
Generates a structured PDF report with symptoms, solutions, and a pharmacy card
All data is permanently purged after download
The architecture
Single HTML file — no build step, no framework, no dependencies to install. Drop it anywhere and it works.
Cloudflare Worker as AI proxy — Gemini API keys are stored as encrypted environment variables in the Worker. The frontend never sees a key. GitHub's secret scanner has nothing to flag.
5-key rotation with model fallback — if one key hits a rate limit, the Worker tries the next. Models rotate: gemini-2.0-flash → gemini-2.0-flash-lite → gemini-2.5-flash.
Client-side PDF generation — jsPDF builds the report entirely in the browser. Includes a pharmacy card section and a QR code linking back to the tool.
Aggressive data purge — after download, localStorage, sessionStorage, IndexedDB, Service Worker cache all get wiped in one call.
Offline queue — if the user loses connection mid-session, requests are queued and auto-drained when they reconnect.
Global error boundary — all unhandled rejections are caught, user sees a toast, no silent crashes.
Why no backend
The whole point is trust. A user sharing health symptoms needs to know nothing is stored. A backend, even a well-intentioned one, creates doubt. Browser-only removes that doubt entirely.
Tech stack
Vanilla JS — no framework
Tailwind Play CDN — styling
jsPDF — PDF generation
Cloudflare Workers — AI proxy
Google Gemini — AI engine
Live tool
https://dagrang-repository.github.io/free-ai-medical-tool
Repo
https://github.com/dagrang-repository/free-ai-medical-tool
Fork it, self-host it, improve it. All feedback welcome.
Top comments (0)