Skip to content

byteWizard-zero/nutrilens

Repository files navigation

🥗 NutriLens: AI-Powered Smart Nutrition Companion

Next.js React Gemini Zustand

"Lens your plate, balance your health. AI-driven meal analysis, visual portion tracking, and context-aware nutrition coaching at your fingertips."

NutriLens is a next-generation Progressive Web App (PWA) designed to simplify calorie tracking and dietary habits. Built with Next.js 15 and the latest @google/genai SDK, it allows users to take a photo of their meal, instantly extract food details, estimate portions, log macro metrics, and consult an AI nutritionist assistant with real-time streaming answers.


✨ Key Features

  • 📸 Instant Visual Meal Analysis: Upload or capture an image of your plate. Gemini analyzes the food, estimates weights/serving sizes, assigns confidence scores, and populates macro estimates.
  • 💬 Streaming Context-Aware AI Chat: An interactive nutritionist chat interface powered by Server-Sent Events (SSE). The AI knows your daily stats, caloric target, meal log count, and goals (e.g., muscle gain, fat loss) and delivers tailored, punchy advice.
  • 📊 Calorie Rings & Macro Analytics: Beautiful glassmorphic circular trackers for target completions, combined with Recharts-based bar/line metrics detailing daily fats, carbs, and proteins.
  • 📅 Calendar Heatmaps: Visually track consistency levels over a calendar layout to see active logging streaks.
  • 📏 Portion Fine-Tuning Slider: Adjust estimated portions with a dynamic slider, instantly scaling all calorie and macro metrics proportionally.
  • 📱 Progressive Web App (PWA): Built mobile-first with service worker configurations for offline caching and launcher integrations.

🛠️ Tech Stack & Architecture

  • Framework: Next.js 15 (App Router, Turbopack)
  • Styling & Motion: Tailwind CSS & Motion (Framer Motion)
  • Generative Core: Google GenAI SDK (gemini-2.5-flash for multi-modal analysis and streaming responses)
  • State Management: Zustand (Offline local-storage synced partitions for user targets, meal logs, and chat history)
  • Data Visualization: Recharts

🚀 Getting Started

Prerequisites

Installation

  1. Clone the Repository:

    git clone https://github.com/byteWizard-zero/nutrilens.git
    cd nutrilens
  2. Install Dependencies:

    npm install
  3. Configure Environment Variables: Create a .env.local file in the root directory:

    GEMINI_API_KEY=your_gemini_api_key_here
  4. Start Development Server:

    npm run dev

    Open http://localhost:3000 in your browser.

  5. Build for Production:

    npm run build

About

AI-powered smart nutrition companion Progressive Web App (PWA) built with Next.js, Zustand, and Gemini 2.5 Flash for multi-modal meal analysis and streaming AI chat.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors