This app was build as a tracker for a friend. It is a single-page web app for tracking cholesterol and stroke-risk: lipid-panel comparison, a daily adherence tracker, a vitals diary, and AI-assisted food and recipe tools.
You will need a Gemini API key to use certain features. The AI features run through a small Cloudflare Worker so the Gemini API key stays server-side.
NOTE: Not medical advice. This is an educational tracker, not a medical device. Consult a qualified clinician, Fell free to show the app and follow as per clinicians guideline.
Live demo: https://kamilkkakar.github.io/heartguard/
(AI features need the proxy below to be deployed and API_BASE set.)
Browser (index.html) ──► Cloudflare Worker ──► Google Gemini API
no key holds GEMINI_API_KEY
Needs a free Cloudflare account and a Gemini API key.
cd worker
npm install
npx wrangler login
npx wrangler secret put GEMINI_API_KEY # paste your key when prompted
npx wrangler deploy # prints your worker URLIn index.html, set API_BASE (near the top of the <script>) to the worker
URL, with no trailing slash:
const API_BASE = "https://heartguard-proxy.your-subdomain.workers.dev";- Models: the app uses
gemini-2.5-flash(text + vision) andgemini-2.5-flash-image(image generation). If you change them, update bothindex.htmlandALLOWED_MODELSinworker/worker.js, and check the current model list. - Local testing:
cd worker && npx wrangler dev, then setAPI_BASE = "http://localhost:8787". - Tighter CORS: set
ALLOWED_ORIGINinworker/worker.jsto your Pages origin instead of*, then redeploy. - Data: all user data lives in the browser's
localStorage. Lab and food images are sent to Gemini (via the proxy) for analysis and are not stored by this app.