💡 Inspiration

Nearly 1 in 8 households struggle to afford nutritious food, forcing families to choose between their budget and their health. We saw this challenge firsthand in our communities: parents skipping meals, families buying cheap processed foods instead of fresh produce, and the rising grocery prices making it harder to maintain a healthy diet.

We wanted to build something that could democratize nutrition – making healthy eating accessible regardless of income. NutriBudget was born from the belief that everyone deserves to eat well, and technology can help bridge the gap between budget constraints and nutritional needs.

🎯 What it does

NutriBudget is an AI-powered grocery planning tool that maximizes nutrition within your budget. Here's how it works:

  1. Input your constraints: Budget ($), household size, dietary preferences (vegetarian/non-vegetarian/vegan), and nutrition goals (balanced/high protein/low sugar)

  2. Get optimized recommendations: Our algorithm analyzes 5,000+ real grocery products with nutrition data and prices to recommend the perfect basket

  3. Visualize your impact: See your nutrition coverage, cost savings, meal suggestions, and contribution to UN Sustainable Development Goals

  4. Take action: Export your shopping list and head to the store with confidence

Real results: Users typically save 15-20% compared to typical shopping while meeting or exceeding their nutritional targets!

🛠️ How we built it

Data Pipeline & Machine Learning

  • Collected and cleaned a dataset of 5,000+ Canadian grocery products with detailed nutrition facts and prices
  • Built a custom health scoring algorithm that rewards protein, fiber, and whole foods while penalizing sugar, saturated fat, and ultra-processed items
  • Applied K-Means clustering to group products into categories (Staples, Vegetables & Wholefoods, Processed Snacks, High Energy foods)
  • Engineered a composite nutri-score combining health (60%) and affordability (40%) to rank products by value

Backend API

  • Flask REST API that loads the scored product database and exposes endpoints for searching and planning
  • Implemented a greedy optimization algorithm that:
    • Filters products by dietary restrictions
    • Calculates value metrics (nutrition per dollar)
    • Adjusts recommendations based on user goals
    • Maximizes variety while staying within budget

Frontend Experience

  • Built with Next.js 16 and React 19 for modern, performant UI
  • Designed a stunning interface using Tailwind CSS v4 with glassmorphism effects
  • Added smooth animations with Framer Motion and GSAP for delightful interactions
  • Implemented smart features: SDG impact tracking, meal suggestions, export functionality

Tech Stack

Frontend: Next.js, React, TypeScript, Tailwind CSS, Framer Motion, GSAP
Backend: Flask, Python, pandas, NumPy
ML: scikit-learn (K-Means, MinMaxScaler)
Optimization: Custom greedy algorithm with value-based selection
Data: Real grocery dataset with 5,000+ products

🧗 Challenges we ran into

  1. Data quality issues: The original dataset had inconsistent brand names, price outliers, and missing nutrition values. We had to build robust cleaning pipelines with winsorization and validation.

  2. Optimization complexity: Balancing multiple constraints (budget, nutrition targets, variety, dietary restrictions) was challenging. We experimented with linear programming but found a greedy approach provided better real-time performance while still delivering excellent results.

  3. Scoring algorithm design: Determining the right weights for health vs. affordability took many iterations. We settled on 60/40 after testing with real user scenarios.

  4. Real-world variety: Ensuring the basket had variety (not just rice and beans!) required adding max quantity limits per item and cluster diversity checks.

  5. UI/UX polish: Making complex nutrition data accessible and beautiful required thoughtful design – we went through multiple iterations to achieve the right balance of information and aesthetics.

🏆 Accomplishments that we're proud of

Real impact: Built a tool that genuinely helps people eat healthier on a budget
End-to-end ML pipeline: From raw data to production-ready scored products
Beautiful, modern UI: Created a premium interface that makes nutrition planning exciting
Comprehensive features: Meal suggestions, SDG tracking, cost savings analysis, export functionality
Proven results: 15-20% average savings while meeting/exceeding nutrition targets
Aligned with UN SDGs: Contributing to Zero Hunger (SDG 2) and Good Health (SDG 3)

📚 What we learned

  • Data is messy: Real-world grocery data requires extensive cleaning and validation
  • Simple algorithms can be powerful: Our greedy approach outperformed more complex methods in practice
  • User experience matters: Beautiful design isn't just aesthetic – it encourages people to actually use the tool
  • Nutrition is nuanced: Balancing macros, micros, processing levels, and budget requires careful algorithm design
  • Iteration is key: Each feature went through multiple refinements based on testing

🚀 What's next for NutriBudget

Short-term:

  • 🔮 Recipe suggestions using basket items
  • 🔮 Micronutrient tracking (vitamins & minerals)
  • 🔮 Allergy and preference filters
  • 🔮 Multi-store price comparison

Long-term:

  • 🔮 User accounts with saved plans and preferences
  • 🔮 Historical tracking and auto-refill suggestions
  • 🔮 Mobile app (React Native)
  • 🔮 Integration with grocery delivery APIs
  • 🔮 Expand to other countries and datasets
  • 🔮 Community recipe sharing

Our vision: Make NutriBudget the go-to tool for millions of families who want to eat healthy without breaking the bank.

Built With

Share this project:

Updates