Skip to content

Latest commit

 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

HeartGuard - Cholesterol Tracker

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.)

Setup (How it works)

Browser (index.html)  ──►  Cloudflare Worker  ──►  Google Gemini API
  no key                   holds GEMINI_API_KEY

1. Deploy the proxy

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 URL

2. Point the app at it

In 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";

Notes

  • Models: the app uses gemini-2.5-flash (text + vision) and gemini-2.5-flash-image (image generation). If you change them, update both index.html and ALLOWED_MODELS in worker/worker.js, and check the current model list.
  • Local testing: cd worker && npx wrangler dev, then set API_BASE = "http://localhost:8787".
  • Tighter CORS: set ALLOWED_ORIGIN in worker/worker.js to 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.

About

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages