"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.
- 📸 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.
- Framework: Next.js 15 (App Router, Turbopack)
- Styling & Motion: Tailwind CSS & Motion (Framer Motion)
- Generative Core: Google GenAI SDK (
gemini-2.5-flashfor 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
- Node.js (v20+)
- A Google Gemini API Key from Google AI Studio.
-
Clone the Repository:
git clone https://github.com/byteWizard-zero/nutrilens.git cd nutrilens -
Install Dependencies:
npm install
-
Configure Environment Variables: Create a
.env.localfile in the root directory:GEMINI_API_KEY=your_gemini_api_key_here
-
Start Development Server:
npm run dev
Open
http://localhost:3000in your browser. -
Build for Production:
npm run build