
DietSync: Building a Privacy-First Nutrition Tracker with Kiro and AWS
I built a nutrition tracker that keeps your health data on your device, using Kiro’s spec-driven workflow to plan and test it. Amazon Bedrock adds an optional AI coach and Amazon S3 adds optional sync, so the app works fully offline with every cloud feature off.
Introduction
Most nutrition apps ask for the same trade: log your meals, weight, and body stats, and in return your data goes to someone else’s server. For something as personal as health data, I wanted to see whether that trade was necessary.
That question led to DietSync, a privacy-first nutrition tracking Progressive Web App (PWA). Your data stays on your device by default. Cloud features such as AI coaching and sync are optional extras, powered by Amazon Bedrock and Amazon S3. I built it using Kiro, AWS’s agentic IDE, and its spec-driven workflow.
In this post, I’ll walk through what DietSync does, how Kiro shaped the way I built it, how I used AWS services without breaking the privacy-first idea, and what I learned along the way.
The Problem
Calorie and macro trackers are useful, but they usually come with three problems:
- Privacy: health and food data is stored on remote servers, often with unclear usage.
- Connectivity: many apps stop being useful without a good internet connection.
- Local relevance: food databases are often weak on regional foods. As a developer in India, I wanted Indian dishes to be first-class items, not an afterthought.
I set three goals for DietSync: keep user data on-device, work fully offline, and make cloud features strictly opt-in.
What DietSync Does
- Food logging from a database of 300+ items, combining USDA data and common Indian foods
- Automatic goals: daily calorie and macro targets calculated from body stats using TDEE (Total Daily Energy Expenditure)
- Dashboard with a calorie progress view, macro ring, and meal-wise breakdown
- Water tracking, weight log, and a streak counter to build consistency
- Weekly and monthly progress charts
- Shareable progress summary card for exporting your achievements
- Multi-user accounts on a single device, with passwords hashed using PBKDF2
- AI Nutrition Coach powered by Amazon Bedrock
- Optional cloud sync using Amazon S3
- Fully offline PWA, installable on phone or desktop
Tech stack: React, TypeScript, Vite, Tailwind CSS, Zustand, Amazon Bedrock, Amazon S3, Kiro, and Vercel for deployment.
[Insert dashboard screenshot here]
Architecture Overview
DietSync is built around a local-first design:
- The core app runs entirely in the browser. React and Zustand manage UI and state, and LocalStorage persists user data.
- A FoodRepository abstraction sits between the app and the food database. Today it reads from a curated local dataset, but the interface means the data source can change later without rewriting the UI.
- Optional AWS integrations sit on the edge of the app. The AI Nutrition Coach calls Amazon Bedrock, and cloud sync uses Amazon S3. If either is unavailable or switched off, the rest of the app keeps working.
This separation was the key decision: AWS services add capability, but they are never required for the app to function.
[Insert architecture diagram here]
How I Used Kiro
I had built small projects before by prompting an AI assistant and patching whatever came back. It works, but it gets messy as the project grows. For DietSync, I used Kiro’s spec-driven development workflow instead, which gave the project structure from the start.
1. Requirements first
Before writing any code, I worked through the idea with Kiro and turned it into a requirements.md file. This forced me to make real decisions early: the app would be for general users, frontend-only, local-first, with multiple accounts per device, and a curated food database instead of a live external API. Writing these down made scope clear and kept me from adding features randomly.
2. Design next
Kiro then helped produce a design.md file covering architecture, data models, and key abstractions such as the FoodRepository interface. Having this written down meant that when I started implementing, I already knew how the pieces fit together.
3. Tasks as a build plan
The tasks.md file broke the whole build into ordered, trackable steps. Instead of asking “what should I build next?”, I could work through the list, one task at a time, with each step traceable back to a requirement.
4. Property-based testing
A diet tracker is full of rules that must always hold: macro totals should match the sum of logged items, calorie goals should respond correctly to changes in body stats, and data should survive being saved and reloaded. I used Vitest with fast-check to write property-based tests that check these rules across many generated inputs, not just a few hand-picked examples. This caught edge cases I would not have thought to test manually.
[Insert screenshot of the Kiro spec files here]
What Kiro changed for me
The biggest benefit was predictability. With a spec in place, AI-generated code had a clear target, and it was easy to check whether each piece matched the requirements and design. It turned AI assistance from a pile of prompts into a repeatable process.
How I Used AWS
Amazon Bedrock: the AI Nutrition Coach
The AI Nutrition Coach uses Amazon Bedrock to give users personalized guidance based on their goals and logged data. Bedrock was a good fit because it gives access to foundation models through a single managed service, so I did not have to host or manage any model infrastructure. [Mention the model you used and how you call Bedrock, for example through a serverless function.]
Because DietSync is privacy-first, the coach is designed as an optional feature, and users decide whether to use it. [Describe what data is sent to the coach and how you minimize it.]
Amazon S3: optional cloud sync
For users who want their data backed up or available across devices, Amazon S3 provides cloud sync. It is opt-in, so the default experience remains fully local. [Describe how sync works, for example the object structure and how you handle conflicts.]
Keeping privacy intact
The design rule I followed was simple: the app must work with every AWS feature turned off. This kept the privacy promise honest. Cloud features add value for those who want them, without becoming a hidden requirement.
Challenges and Lessons Learned
- Designing for offline first. Starting from a local-only model made later cloud features easier to add, because the app never depended on a network.
- Client-side security. With no backend, authentication has to be handled carefully in the browser. Using PBKDF2 for password hashing was an important step. [Add anything specific you learned about this.]
- Specs save time. Spending effort on requirements and design with Kiro felt slow at first, but it reduced rework during implementation.
- Testing beyond examples. Property-based testing changed how I think about correctness. Instead of asking “does this example pass?”, I started asking “what must always be true?”
- [Add one challenge unique to your build, such as a Bedrock prompt design problem, PWA caching issue, or food database curation.]
What’s Next
Planned improvements include richer AI coaching, a deeper food database, and a social progress-sharing feature beyond the current export card.
Conclusion
DietSync shows that a useful, intelligent health app does not have to start with giving away your data. Kiro gave me a structured way to plan and build it, and AWS services like Amazon Bedrock and Amazon S3 added AI and sync as optional layers on top of a local-first core.
Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article