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 key as a Pages build environment variable — dashboard → Settings → Environment variables → add
VITE_GEMINI_API_KEYfor the Production environment. This is baked into the client bundle at build time (seesrc/lib/ai/gemini.ts), so it must be present during the CI build, not just at runtime. -
GitHub Actions secrets — the workflow needs
CLOUDFLARE_API_TOKENandCLOUDFLARE_ACCOUNT_IDset as repo secrets (Settings → Secrets and variables → Actions) forwrangler-actionto authenticate.
Steps 1–2 also apply locally for bun run dev (use --local instead of --remote), and the Gemini key locally goes in .env (see .env.example) rather than the Pages dashboard.