Applied AI · Chatbot
Calorie LINE Bot
Snap a meal or type it in Thai, and a LINE bot estimates calories and macros, then coaches you toward a goal date.
Personal · Solo · Built with Claude Code
My contribution
I designed the whole bot — product, backend, AI turn and tests — and built it with Claude Code on Cloudflare’s free plan.
- A queue consumer gives OpenAI about 46 seconds per meal and still answers inside LINE’s one-minute reply window, instead of failing at the Workers 30-second limit.
- Food photos and Thai text become per-item calories and macros through OpenAI tool calls that log, edit, scale or delete meals in D1.
- More than 120 automated tests, including end-to-end webhook tests on a real local D1 with mock LINE and OpenAI servers.
Try it
See what it can do
Personal project · November 2026 · live private bot
What this project does
Send a food photo or a Thai description, and the bot logs the meal with calories, protein, carbs and fat. It also tracks weigh-ins, water and exercise, works out a daily target and sends reminders in the morning and evening.
Inside the project
- Daily targets use Mifflin-St Jeor with a 500 kcal deficit and safe floors of 1,500 kcal for men and 1,200 kcal for women.
- Portion buttons from ½ to 2× recompute totals without calling the model.
- Replies are Flex cards in Thai or English with plain-text fallbacks; a linter checks every card against LINE’s limits.
- Photos over 3 MB are refused, to stay within the free plan’s 10 ms CPU limit.
Skills & practical experience
Designing around hard platform limits on time, CPU and messages, and keeping an LLM’s changes to user data explicit and undoable.
- TypeScript
- Cloudflare Workers
- D1
- Queues
- OpenAI API
- LINE Messaging API
- Vitest
From the private repository (November 2026). The bot is live on Cloudflare Workers but only for approved users, so there is no public link or LINE ID.
Project context
Calorie numbers are estimates, not lab values. The demo uses sample data only.
