{"id":35039478,"url":"https://github.com/paramsinghvc/nutrilens","last_synced_at":"2026-05-21T00:04:11.877Z","repository":{"id":327235731,"uuid":"1108471944","full_name":"paramsinghvc/nutrilens","owner":"paramsinghvc","description":"A web app to take real time pictures and get nutrition analysis and health suggestions through OpenAI","archived":false,"fork":false,"pushed_at":"2025-12-08T15:47:10.000Z","size":192,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-12-28T22:11:22.469Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://nutrilens-jet.vercel.app","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/paramsinghvc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-12-02T13:49:33.000Z","updated_at":"2025-12-08T15:47:14.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/paramsinghvc/nutrilens","commit_stats":null,"previous_names":["paramsinghvc/nutrilens"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/paramsinghvc/nutrilens","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paramsinghvc%2Fnutrilens","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paramsinghvc%2Fnutrilens/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paramsinghvc%2Fnutrilens/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paramsinghvc%2Fnutrilens/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/paramsinghvc","download_url":"https://codeload.github.com/paramsinghvc/nutrilens/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paramsinghvc%2Fnutrilens/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33281324,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-20T15:12:43.734Z","status":"ssl_error","status_checked_at":"2026-05-20T15:12:42.300Z","response_time":356,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-12-27T08:11:16.708Z","updated_at":"2026-05-21T00:04:11.856Z","avatar_url":"https://github.com/paramsinghvc.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg width=\"100\" height=\"100\" alt=\"Food Image\" src=\"https://github.com/user-attachments/assets/ff5b5db6-2aba-4cb1-ab09-b6e94b483592\" /\u003e\n\u003c/p\u003e\n\n# 🥗 NutriLens — AI-Powered Nutrition Analysis App\n\nNutriLens is an intelligent nutrition analysis platform that uses **OpenAI Vision** to analyze food images and provide instant, structured insights about **macros, micronutrients, health notes, and practical suggestions** — all with a friendly mobile-native interface.\n\nBuilt with **Next.js 15**, **Express.js**, and **OpenAI GPT-4.1 Vision**, NutriLens brings **AI nutrition analysis** directly to your browser.\n\n---\n\n## ✨ Features\n\n- 🧠 **AI-powered Food Recognition** — Upload a meal photo and let OpenAI identify each ingredient.  \n- ⚖️ **Instant Macro Breakdown** — Get estimated calories, protein, carbs, fats, and fiber.  \n- 🧬 **Micronutrient Insights** — Vitamins \u0026 minerals classified as *Low / Moderate / High*, color-coded for clarity.  \n- 💡 **Personalized Health Notes** — Friendly, emoji-led insights about your meal.  \n- 🌱 **Smarter Meal Suggestions** — AI-generated quick tips for balance and healthier eating.  \n- 📱 **Mobile-first UI** — A clean, interactive, draggable bottom sheet that feels native.  \n- ⚙️ **Docker-ready** — Easily run both frontend and backend in isolated containers.  \n\n---\n\n## 📸 Preview\n\n| Live Food scanning | AI Nutrient Insights | Health Tips |\n|----------------------|-------------------------|--------------|\n| \u003cimg width=\"590\" height=\"1278\" alt=\"Screen 1\" src=\"https://github.com/user-attachments/assets/78eb03f4-e8a9-43c5-afa4-086363c2f1d7\" /\u003e | \u003cimg width=\"590\" height=\"1278\" alt=\"Screen 3\" src=\"https://github.com/user-attachments/assets/eee37127-167d-4fbf-a8cb-b91207ba3534\" /\u003e | \u003cimg width=\"590\" height=\"1278\" alt=\"Screen 2\" src=\"https://github.com/user-attachments/assets/8b967c2c-6678-432a-b1ee-9955e738a0e8\" /\u003e|\n\n---\n\n## 🧩 Project Structure\n\n```\nnutrilens/\n├── app/                # Next.js 16.0.7 frontend (React 19)\n│   ├── components/     # UI components (Donut charts, BottomSheet, etc.)\n│   ├── public/\n│   └── ...\n├── server/             # Express.js backend\n│   ├── src/\n│   ├── package.json\n│   └── .env.example\n├── docker-compose.yml  # Combined app/server config\n└── README.md\n```\n\n---\n\n## ⚙️ Getting Started\n\n### 🧠 1. Setup OpenAI API Key\n\nYou’ll need an [OpenAI API key](https://platform.openai.com/api-keys).  \nCreate one and add it to your backend `.env` file.\n\n---\n\n### 🧰 2. Start the Express Server\n\nSet environment variables in `server/.env` (based on `.env.example`):\n\n```\nOPENAI_API_KEY=sk-xxxxxx\nPORT=8083\n```\n\nThen start the server:\n\n```bash\nnpm run docker:server\n# or\ncd server \u0026\u0026 yarn dev\n```\n\nServer runs at 👉 [http://localhost:8083](http://localhost:8083)\n\n---\n\n### 💻 3. Start the Next.js Frontend\n\nSet environment variables in `.env` (based on `.env.example`):\n\n```\nNEXT_PUBLIC_API_BASE=http://localhost:8083\nPORT=3000\n```\n\nThen run the dev server:\n\n```bash\nnpm run dev\n# or\nyarn dev\n```\n\nVisit 👉 [http://localhost:3000](http://localhost:3000)\n\n---\n\n## 🐳 Docker Setup (Optional)\n\nYou can run everything in Docker with one command:\n\n```bash\ndocker compose up --build\n```\n\nThis will spin up:\n- `frontend` → Next.js app (port 8087)\n- `backend` → Express + OpenAI API (port 8083)\n\n---\n\n## 🧠 How It Works\n\n1. User uploads a meal photo.  \n2. The backend sends the image to **OpenAI GPT-5.1 Vision** via the `responses.create()` API.  \n3. AI analyzes the meal composition, estimates portions, and outputs structured JSON (validated via **Zod**).  \n4. Frontend visualizes the data as colorful donut charts and categorized nutrient lists.\n\n---\n\n## 🪄 Tech Stack\n\n| Layer | Technology |\n|-------|-------------|\n| Frontend | Next.js 16.0.7 (React 19) + TypeScript + Tailwind CSS |\n| Backend | Express.js + OpenAI API (GPT-4.1 Vision) |\n| Validation | Zod Schema + `zodTextFormat()` |\n| Charts | Custom SVG Donut \u0026 MultiDonut Components |\n| Containerization | Docker \u0026 Docker Compose |\n| Deployment | Vercel + Nginx Reverse Proxy |\n\n---\n\n## 🚀 Deployment\n\n### Deploy the frontend on [Vercel](https://vercel.com)\n- Set `NEXT_PUBLIC_API_BASE` to your live API URL.\n\n### Deploy the backend (server)\n- On a VPS or platform like DigitalOcean or Render.\n- Configure Nginx reverse proxy (e.g. `nutrilens.mollyculelabs.com` → `localhost:8083`).\n- Use `pm2` or Docker for process management.\n\n---\n\n## 🔒 Environment Variables\n\n| Variable | Description |\n|-----------|--------------|\n| `OPENAI_API_KEY` | Your OpenAI API key |\n| `PORT` | Express server port |\n| `NEXT_PUBLIC_API_BASE` | Base URL for API calls |\n| `NODE_ENV` | `development` or `production` |\n\n---\n\n## 🧠 Example AI Output\n\n```json\n{\n  \"error\": null,\n  \"identifiedFoodItems\": [\"Paneer Curry\", \"Rice\", \"Cucumber Salad\"],\n  \"estimatedPortionSize\": [\n    { \"itemName\": \"Paneer Curry\", \"itemSize\": \"200g\" },\n    { \"itemName\": \"Rice\", \"itemSize\": \"150g\" }\n  ],\n  \"macros\": {\n    \"calories\": 520,\n    \"protein\": 28,\n    \"carbs\": 45,\n    \"fats\": 20,\n    \"fiber\": 6\n  },\n  \"micronutrients\": {\n    \"Vitamin A\": { \"category\": \"Moderate\", \"note\": \"Supports vision\", \"amount\": \"480µg\" },\n    \"Iron\": { \"category\": \"Low\", \"note\": \"Helps oxygen flow\", \"amount\": \"1.2mg\" }\n  },\n  \"health_notes\": [\"💪 High in protein for muscle recovery.\"],\n  \"healthier_suggestions\": [\"🥗 Add more greens for micronutrient balance.\"]\n}\n```\n\n---\n\n## 🧑‍💻 Author\n\n**Param Singh**  \nFull-stack engineer \u0026 digital creator  \n🌐 [mollyculelabs.com](https://mollyculelabs.com)  \n🐦 [@paramsinghvc](https://twitter.com/paramsinghvc)  \n💼 [GitHub](https://github.com/paramsinghvc)\n\n---\n\n## ⭐️ Show Your Support\n\nIf you like this project:\n- 🌟 Star the repo on [GitHub](https://github.com/paramsinghvc/nutrilens)\n- 🧩 Open issues or ideas for new features\n- ☕ Buy me a coffee (optional!)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparamsinghvc%2Fnutrilens","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fparamsinghvc%2Fnutrilens","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparamsinghvc%2Fnutrilens/lists"}