<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: dagrang</title>
    <description>The latest articles on DEV Community by dagrang (@dagrang).</description>
    <link>https://dev.to/dagrang</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3902212%2F58b30d7c-cc65-454d-820b-b0f6e116bc02.png</url>
      <title>DEV Community: dagrang</title>
      <link>https://dev.to/dagrang</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/dagrang"/>
    <language>en</language>
    <item>
      <title>How I built a privacy-first AI medical tool in a single HTML file</title>
      <dc:creator>dagrang</dc:creator>
      <pubDate>Tue, 28 Apr 2026 10:53:16 +0000</pubDate>
      <link>https://dev.to/dagrang/how-i-built-a-privacy-first-ai-medical-tool-in-a-single-html-file-136n</link>
      <guid>https://dev.to/dagrang/how-i-built-a-privacy-first-ai-medical-tool-in-a-single-html-file-136n</guid>
      <description>&lt;p&gt;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.&lt;br&gt;
Here's what I ended up with and how it works.&lt;br&gt;
What it does&lt;/p&gt;

&lt;p&gt;User describes their health concern in plain language&lt;br&gt;
AI asks focused follow-up questions (like a warm family doctor)&lt;br&gt;
Generates a structured PDF report with symptoms, solutions, and a pharmacy card&lt;br&gt;
All data is permanently purged after download&lt;/p&gt;

&lt;p&gt;The architecture&lt;br&gt;
Single HTML file — no build step, no framework, no dependencies to install. Drop it anywhere and it works.&lt;br&gt;
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.&lt;br&gt;
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.&lt;br&gt;
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.&lt;br&gt;
Aggressive data purge — after download, localStorage, sessionStorage, IndexedDB, Service Worker cache all get wiped in one call.&lt;br&gt;
Offline queue — if the user loses connection mid-session, requests are queued and auto-drained when they reconnect.&lt;br&gt;
Global error boundary — all unhandled rejections are caught, user sees a toast, no silent crashes.&lt;br&gt;
Why no backend&lt;br&gt;
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.&lt;br&gt;
Tech stack&lt;/p&gt;

&lt;p&gt;Vanilla JS — no framework&lt;br&gt;
Tailwind Play CDN — styling&lt;br&gt;
jsPDF — PDF generation&lt;br&gt;
Cloudflare Workers — AI proxy&lt;br&gt;
Google Gemini — AI engine&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/dagrang-repository/free-ai-medical-tool" rel="noopener noreferrer"&gt;&lt;/a&gt;&lt;br&gt;
GitHub Pages — hosting&lt;/p&gt;

&lt;p&gt;Live tool&lt;br&gt;
&lt;a href="https://dagrang-repository.github.io/free-ai-medical-tool" rel="noopener noreferrer"&gt;https://dagrang-repository.github.io/free-ai-medical-tool&lt;/a&gt;&lt;br&gt;
Repo&lt;br&gt;
&lt;a href="https://github.com/dagrang-repository/free-ai-medical-tool" rel="noopener noreferrer"&gt;https://github.com/dagrang-repository/free-ai-medical-tool&lt;/a&gt;&lt;br&gt;
Fork it, self-host it, improve it. All feedback welcome.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>ai</category>
      <category>productivity</category>
    </item>
  </channel>
</rss>
