NutriNudge is a browser extension that empowers consumers to make healthier choices by analyzing packaged food products. Using AI, NutriNudge provides personalized health insights, highlights harmful ingredients, and evaluates product suitability for dietary needs, like vegan or diabetes-friendly options, directly in the browser as users shop online.
NutriNudge makes healthy eating easier by providing instant, AI-driven insights as users browse and shop for food products online, enabling informed decisions seamlessly.
During the development of NutriNudge, we faced several challenges that required creative solutions:
1. Extracting Product Information: Extracting nutritional and ingredient details was challenging due to dynamic HTML structures. We used advanced DOM traversal and dynamic selectors, along with extensive debugging, to achieve consistent data extraction.
2. Handling Cross-Origin Requests (CORS): Communication between the extension and our server was initially blocked by CORS policies. We addressed this by configuring our backend to include Access-Control-Allow-Origin headers and pre-flight support, ensuring smooth interaction across browsers.
3. Incomplete Product Information: Many product pages had missing ingredients or nutritional values. We integrated OpenFoodFacts, an open API, to retrieve missing data, ensuring our analysis remained accurate even with incomplete product pages.
4. Popup Window Size: Making the extension’s popup wide enough was a challenge, as adjusting manifest.json had no effect. We solved this by explicitly setting the width with inline CSS and making all elements use the full width, resulting in a more user-friendly interface.
5. User-Specific Analysis: Personalizing insights based on user preferences like allergies required adaptable prompts for Generative AI. We designed concise prompts and iteratively tested them to ensure relevance without overwhelming users.
6. AI Integration: Integrating the AI-driven analysis from our Gemini model was challenging, especially with missing data. We implemented a fallback mechanism to use manually extracted data from product pages when API data was unavailable, ensuring continuous and accurate analysis.
Tracks Applied (1)
Discussion