Your AI-powered nutrition companion for smarter eating
Track, understand, and optimize your nutrition through intelligent conversations and personalized insights.
Chat with an intelligent AI nutritionist powered by Google Gemini 2.0. Get personalized advice, verify nutrition claims with authoritative sources, and compare different perspectives side-by-side. Upload food images for instant ingredient detection and analysis, with answers informed by your own uploaded documents.
Snap a photo of your meal and let AI extract ingredients automatically. Get detailed nutrition breakdowns including macros, vitamins, minerals, and fiber. Each food receives a healthiness score (0-100) and is saved to your searchable food history.
Track your progress with comprehensive weekly reports, nutrition trend visualizations, and goal comparisons. Build logging streaks, unlock achievements, and see how your actual intake stacks up against your targets.
Upload your dietary guidelines, meal plans, or nutrition research as PDFs, Word docs, or text files. The AI uses RAG (Retrieval-Augmented Generation) to search your documents and provide personalized, source-cited answers.
- Telegram Bot: Get reminders and check-ins via @nutritionlm_bot
- Google Fit: Sync your activity and health data (optional)
Complete an onboarding flow to set your nutrition goals, dietary preferences, and restrictions. Manage your profile and customize daily targets for protein, carbs, fats, and more.
| Category | Technology |
|---|---|
| Framework | Next.js 16 (App Router) |
| Frontend | React 19 |
| AI | Google Gemini 2.0 Flash/Pro |
| Database | Supabase (PostgreSQL) |
| Auth | Supabase Auth (Google OAuth) |
| Styling | Tailwind CSS 4 |
| Icons | Lucide React |
| Document Processing | mammoth, pdf-parse |
| Markdown | react-markdown |
- Node.js 18+ and npm
- Supabase project with Google OAuth configured
- Google Gemini API key
- Google OAuth credentials (optional, for Google Fit)
-
Clone the repository
git clone <repository-url> cd nutritionlm
-
Install dependencies
npm install
-
Set up environment variables
Create
.env.localin the project root:# Supabase NEXT_PUBLIC_SUPABASE_URL=your_supabase_url NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY=your_supabase_anon_key SUPABASE_SERVICE_ROLE_KEY=your_service_role_key # Google Gemini GEMINI_API_KEY=your_gemini_api_key # Google Fit OAuth (optional) GOOGLE_CLIENT_ID=your_google_client_id GOOGLE_CLIENT_SECRET=your_google_client_secret GOOGLE_FIT_REDIRECT_URI=http://localhost:3000/api/google-fit/callback
-
Set up the database
Run
db/schema.sqlin your Supabase SQL editor to create all required tables. -
Start the development server
npm run dev
Open http://localhost:3000 in your browser.
nutritionlm/
├── app/
│ ├── api/ # API routes
│ │ ├── analytics/ # Analytics endpoints
│ │ ├── chat/ # AI chat endpoint
│ │ ├── food-log/ # Food logging
│ │ ├── google-fit/ # Google Fit OAuth
│ │ ├── ingredients/ # Image ingredient extraction
│ │ ├── nutrition-goals/ # Nutrition goal management
│ │ ├── nutritionist/ # Nutrition analysis
│ │ ├── optimal-nutrition/ # Goal generation
│ │ ├── sources/ # Document management
│ │ └── weekly-report/ # Weekly reports
│ ├── components/ # React components
│ │ ├── ChatMessage.js # Chat message display
│ │ ├── FoodLogModal.js # Food log details
│ │ ├── Header.js # App header
│ │ ├── InputArea.js # Chat input area
│ │ ├── ProfileModal.js # User profile
│ │ ├── Sidebar.js # Navigation sidebar
│ │ └── ThinkingIndicator.js
│ ├── login/ # Login page
│ ├── onboarding/ # User onboarding flow
│ ├── profile/ # Profile page
│ ├── analytics/ # Analytics dashboard
│ ├── page.js # Main chat interface
│ └── utils/supabase/ # Supabase clients
├── services/ # Service layer
│ ├── auth.js # Authentication helpers
│ ├── documentProcessor.js # Document processing
│ ├── foodLog.js # Food log utilities
│ ├── sourceSearch.js # RAG search
│ └── userPreference.js # User preferences
├── db/ # Database schemas
└── public/ # Static assets
NutritionLM_bot/
│
├── main.py # Telegram bot main entry point
│ # - Handles webhook
│ # - Receives photos
│ # - Uploads images to Supabase
│ # - Calls Nutrition & Ingredients APIs
│ # - Inserts food log records
│
├── render.yaml # Render deployment configuration
│ # - Web service setup
│ # - Auto deploy triggers
│ # - Environment variables
│
├── requirements.txt # Python package dependencies
│ # - telegram bot
│ # - supabase-py
│ # - requests, zoneinfo, etc.
│
└── runtime.txt # Python runtime version for Render
# e.g., python-3.10
Deployed on Vercel with automatic deployments from the main branch.
Production: nutrition-lm.vercel.app
Configure environment variables in your Vercel project settings.
Deployed separately on Render.
- Repository: NutritionLM_bot
- Endpoint: nutritionlm-bot.onrender.com
For detailed API reference, see API_DOCUMENTATION.md
Contributions are welcome! Feel free to open issues or submit pull requests.
Made with ❤️ by Cool Beans