HotFridge
- WebApp
- food expiry tracking app
- AI-powered scan that scans placed out items on table to suggest list of items to add with Icon, Name, Estimated Expiry and Calories. User can edit it before approving to add.
- Notification for near-expired food.2
- Marking items as used so it will be moved to "Out of stock" cart so that user can bring that to buying checklist
- Algorithmized guides based on existing items and near expiry for preserving and recipes and more
ของในตู้เย็นเยอะเกินไป ทำให้หาของยาก อาหารบางอย่างเก็บไว้นานจนเสียจนอาจส่งกลิ่นเหม็น ไม่มีที่ใส่อาหารใหม่ ปัญหาตู้เย็นเต็มจากของเก่าและของใหม่ทับถมกัน เว็บแอปติดตามวันหมดอายุอาหาร ช่วยจัดการวัตถุดิบในตู้เย็นด้วย AI สแกนอาหาร แจ้งเตือนของใกล้หมดอายุ จัดทำเช็กลิสต์ซื้อของ และแนะนำการถนอมอาหารหรือสูตรอาหารจากวัตถุดิบที่มีอยู่
Deploy
CI (.github/workflows/deploy.yml) builds and pushes to Cloudflare Pages on every push to main, but a few things only need to be set up once, by hand, in the Cloudflare account:
-
Create the D1 database (one-time):
npx wrangler d1 create hotfridgeCopy the returned
database_idintowrangler.jsonc'sd1_databases[0].database_id(replacing theREPLACE_WITH_DATABASE_ID_FROM_WRANGLER_D1_CREATEplaceholder) and commit it — it's not a secret. -
Apply migrations to the remote database (needed again after every new migration):
npx wrangler d1 migrations apply hotfridge --remote -
Bind the D1 database to the Pages project — in the Cloudflare dashboard, open the
hotfridgePages project → Settings → Functions → D1 database bindings, and add a binding namedDBpointing at thehotfridgedatabase. (Pages projects configure bindings via the dashboard, notwrangler.jsonc, even thoughwrangler.jsoncis what local dev andwrangler d1commands read.) -
Set the Gemini API keys as a server secret — add a repository Actions secret named
GEMINI_API_KEYS. Its value is a comma-separated list (key-one,key-two). CI uploads it to the Pages runtime; Gemini calls and key rotation happen only on the server. -
Actions secrets — the workflow needs
CLOUDFLARE_API_TOKEN,CLOUDFLARE_ACCOUNT_ID,GEMINI_API_KEYS,GUIDE_JOB_SECRET,VAPID_SUBJECT,VAPID_PUBLIC_KEY, andVAPID_PRIVATE_KEYset as repository Actions secrets. The VAPID public key is the base64url-encoded 65-byte uncompressed P-256 point; the private key is the matching base64url JWKdvalue. -
Deploy the scheduled worker after changing
workers/recommendation-workflow.tsorwrangler.workflow.jsonc:bun run deploy:workflow printf '%s' "$GUIDE_JOB_SECRET" | bunx wrangler secret put GUIDE_JOB_SECRET --config wrangler.workflow.jsoncThe worker runs every five minutes and triggers both recommendation generation and near-expiry push delivery.
Steps 1–2 also apply locally for bun run dev (use --local instead of --remote), and the comma-separated Gemini keys locally go in .env (see .env.example).