
Weekend Productivity Challenge: Expiry Tracker with Bedrock AI Suggestions
A personal expiry tracker that uses Amazon Bedrock (Nova) to turn a list of soon-to-expire groceries into real recipe suggestions, which built with FastAPI, fuzzy matching, and AWS.
Weekend Productivity Challenge: Expiry Tracker with Bedrock AI Suggestions
Vision & What the App Does
Grocery shopping is easy. Remembering what's sitting in the fridge before it goes bad is the hard part. I built Expiry tracker with Bedrock AI suggestions, a personal expiry tracker that not only tells you when something will expire, but actively suggests what to do about it - using generative AI to turn "3 items expiring tomorrow" into an actual recipe idea.
The core problem: I shop weekly, but with a busy schedule I often forget what's in the fridge until it's already spoiled. Existing "expiry date" apps solve half the problem - they tell you a date, then leave you to figure out the rest. I wanted something that closes the loop: track what I bought, know when it needs to be used, and get a concrete suggestion for using it before it's wasted.
From a user's perspective: you log items you've purchased (name, category, purchase date). The app calculates an estimated "use-by" date based on a shelf-life reference table (e.g. fresh chicken → 2 days in the fridge, perfume → ~3 years). When items are approaching their expiry window, one API call sends that list to Amazon Bedrock, which returns 2-3 simple recipe ideas that use up the ingredients, plus quick tips for non-food items (cosmetics, household goods) that are aging out.
How I Built It
The backend is a FastAPI service with SQLAlchemy models for
Item , Category , and ShelfLifeReference . The expiry-date calculation itself is deterministic - purchase_date + shelf_life_days - matched against item names using fuzzy string matching ( rapidfuzz ), since real purchase entries rarely match a reference table exactly.The key design decision was where to draw the line between deterministic logic and AI. Calculating an expiry date doesn't need a language model. It needs a lookup table and simple date math, and doing it that way is faster, cheaper, and fully predictable. Where AI genuinely adds value is in open-ended language generation: turning a list of ingredients into a sensible recipe suggestion. So I kept the core tracking logic rule-based and added a single, focused AI feature via the Bedrock Converse API (
amazon.nova-lite-v1:0 ) rather than routing everything through an LLM.The main challenge was handling the AI call failing gracefully. Since Bedrock auto-enables foundation models on first invocation, the real failure points to guard against were IAM permission errors and transient API timeouts, not a manual access-request step. I didn't want either of those to break the whole
/items/expiring-soon flow, so I wrapped the Bedrock call in a try/except that falls back to a clear message instead of a 500 error, the core tracking feature stays usable even if the AI feature is temporarily down.Process




AWS Services Used / Architecture Overview
- Amazon Bedrock (Amazon Nova Lite, via the Converse API) - generates recipe/usage suggestions from the list of soon-to-expire items.
[Purchased items] → FastAPI + SQLAlchemy → fuzzy-match shelf-life → expiry_date calculated → items expiring soon → Amazon Bedrock (Nova) → recipe/usage suggestions → returned to user
What I Learned
This was my first time using the Bedrock Converse API directly with boto3 rather than through a higher-level SDK. I learned that model access has to be explicitly requested per-model in the Bedrock console before
InvokeModel / Converse calls will succeed, and that separating deterministic business logic from LLM calls - instead of routing everything through a prompt - keeps the system faster, cheaper, and easier to test. I also got more comfortable thinking about graceful degradation when a cloud AI service is unavailable, rather than assuming it will always respond successfully.Link to App or Repo
Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article