Inspiration
Over 32 million Americans face the daily challenge of avoiding foods that could trigger dangerous allergic reactions. As someone who’s seen how stressful grocery shopping can be for people with allergies, I wanted to create a tool that removes the guesswork and anxiety from reading labels.
Most apps only list ingredients without context, forcing users to manually scan for allergens or interpret nutrition data. I envisioned something faster, smarter, and more personal—where you enter your allergens once, and every product instantly tells you whether it’s safe.
I also recognized that people managing diabetes face a similar challenge: carbs and sugar content are buried in labels, making quick decisions difficult. By blending allergen detection with diabetic-friendly guidance, AllergyGuard AI empowers users to make safe, confident choices in seconds—whether they’re at the grocery store, online, or on the go.
The goal was simple: turn a stressful task into a quick, clear, and reliable experience that anyone can use, anytime.
What it does
AllergyGuard AI is a smart food safety assistant that helps people with allergies and diabetes make fast, informed choices about packaged foods.
Users start by entering their allergens—such as milk, eggs, or gluten—and can optionally enable Diabetic Mode for carb and sugar-aware guidance. They can then search for or scan any packaged food.
Within seconds, the app displays a clear badge:
Eat – Safe to consume
Limit – Occasional use recommended
Avoid – Risky due to allergens or high carb/sugar levels
Risky ingredients are automatically highlighted in the ingredient list, so users don’t need to hunt through tiny label text. Diabetic Mode combines carb and sugar data into a single, practical recommendation.
For extra clarity, the Ask AI button generates a plain-language explanation based on the product’s data and the user’s profile—perfect for quick decisions in a store aisle.
AllergyGuard AI pulls ingredient data from OpenFoodFacts and nutrition data from the USDA, ensuring accurate, real-world results. The entire process—from search to decision—takes under 10 seconds, giving users confidence and peace of mind every time they shop.
How we built it
We built AllergyGuard AI as a web application using React and TypeScript for the front-end, ensuring a responsive, user-friendly interface. The backend is powered by Node.js and Express, which handle API requests and process product data.
For ingredient and allergen information, we integrated the OpenFoodFacts API, and for nutrition data—such as calories, carbs, and sugar—we used the USDA FoodData Central API. We implemented real-time allergen matching, highlighting any risky ingredients directly in the ingredient list.
The Diabetic Mode feature applies custom logic that evaluates both carbs and sugar together, classifying foods as Eat, Limit, or Avoid with a simple color-coded badge.
We also added an Ask AI button that uses the OpenAI API to generate plain-language safety summaries tailored to the user’s allergen and health profile.
Caching and error handling were built in to ensure smooth performance and fallback data display if an API call fails. The app design focuses on speed, with every search returning results in under 10 seconds.
This combination of clear UI, intelligent data processing, and AI-powered explanations makes AllergyGuard AI both practical and easy to use.
Challenges we ran into
One of our biggest challenges was data consistency. Ingredient labels from OpenFoodFacts vary widely in format, spelling, and completeness, which made accurate allergen detection tricky. We had to implement robust parsing and keyword matching to ensure allergens were correctly flagged, even when written in different forms.
Integrating the USDA FoodData Central API came with its own hurdles—matching product names to nutrition entries wasn’t always straightforward, so we had to create fallback logic and filters to improve relevance.
Designing Diabetic Mode was another challenge. There’s no universal standard for what’s considered “safe” carb and sugar levels, so we experimented with multiple threshold ranges before settling on a practical, easy-to-understand system.
The Ask AI feature also required careful planning. We needed to send just enough product and allergen data to generate useful summaries while keeping the process secure and privacy-friendly.
Finally, ensuring the app stayed fast was critical. We implemented caching to reduce API calls and built clear fallback states so the user always sees results-even with slow or failed API responses. Each challenge forced us to refine the app’s logic, making it more reliable, accurate, and user-friendly.
Accomplishments that we're proud of
We’re proud that AllergyGuard AI went from idea to fully functional prototype within the hackathon timeline-complete with allergen detection, diabetic-friendly guidance, and AI-powered explanations.
One of our biggest wins was getting real-time allergen highlighting to work reliably, even with messy ingredient lists from the OpenFoodFacts API. Seeing risky ingredients instantly marked in red felt like a major milestone.
We also successfully integrated two different public data sources-OpenFoodFacts for ingredients and USDA FoodData Central for nutrition—and merged them into one seamless user experience.
Implementing Diabetic Mode was another highlight. By combining carb and sugar data into a single, color-coded badge, we made nutrition advice more accessible and actionable for people managing diabetes.
Our simple in-memory caching system improved performance noticeably, keeping searches under 10 seconds and reducing API call limits.
Finally, the Ask AI feature exceeded expectations by delivering clear, plain-language safety summaries that make the app approachable for users of all ages and tech skill levels.
Building something that can genuinely make grocery shopping safer and less stressful—while staying fast and easy to use-is the accomplishment we’re most proud of.
What we learned
This project taught us that clean data is rare—and that building reliable features means planning for incomplete, inconsistent, and messy inputs. Working with OpenFoodFacts showed us how varied ingredient labels can be, and we learned to create flexible parsing and matching logic to still catch allergens.
We also learned the importance of merging multiple data sources. Combining OpenFoodFacts for ingredients with USDA nutrition data required careful matching, filtering, and fallback strategies to ensure accuracy without slowing the app down.
On the technical side, we gained experience with real-time highlighting, in-memory caching, and API performance optimization, which were critical to keeping results under 10 seconds.
Designing the Diabetic Mode feature taught us how to turn abstract nutrition numbers into clear, actionable guidance by setting thresholds that make sense for real-world use.
Finally, integrating the Ask AI feature reminded us that AI works best when given just the right amount of structured context—too much or too little can make responses less helpful.
Overall, we walked away with stronger skills in data handling, API integration, performance tuning, and user-focused design, all while working under hackathon time constraints.
What's next for AllergyGuardAI
We see huge potential for AllergyGuard AI beyond the hackathon and plan to expand it with features that make it even more useful in real-world shopping situations.
Short-term goals:
Barcode scanning for instant product lookup without typing.
Offline mode with cached product data for areas with poor connectivity.
Multi-profile support so families can save allergen settings for each member.
Expanded allergen database to include more regional and less common allergens.
Long-term vision:
Restaurant and menu integration, allowing users to check dishes before ordering.
Crowdsourced product verification so the community can submit updates when labels change.
Personalized recommendations for safe alternative products based on past searches.
Partnerships with grocery stores to integrate AllergyGuard AI directly into their apps and websites.
Our ultimate goal is to make AllergyGuard AI a universal food safety companion—something you can rely on anywhere in the world, whether you’re in a grocery store, at a restaurant, or shopping online.
By continuing to improve speed, accuracy, and accessibility, we hope to turn a stressful task into a quick, confident, and even empowering experience.
Built With
- express.js
- node.js
- openai
- openfoodfacts-api
- react
- typescript
- usda-fooddata-central-api
Log in or sign up for Devpost to join the conversation.