{"id":29857168,"url":"https://github.com/santipac/nutrianalyzer","last_synced_at":"2026-05-07T03:37:27.661Z","repository":{"id":299919266,"uuid":"993893630","full_name":"Santipac/nutrianalyzer","owner":"Santipac","description":"AI-based food analyzer","archived":false,"fork":false,"pushed_at":"2025-07-26T23:45:51.000Z","size":84,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-27T02:52:32.831Z","etag":null,"topics":["edge","edgefunctions","food","llm","nextjs","open-ai","rate-limiting","react","typescript","zustand"],"latest_commit_sha":null,"homepage":"https://nutrianalyzer.santiagopacini.com/","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/Santipac.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-05-31T18:45:33.000Z","updated_at":"2025-07-26T23:46:42.000Z","dependencies_parsed_at":"2025-06-19T01:37:03.638Z","dependency_job_id":null,"html_url":"https://github.com/Santipac/nutrianalyzer","commit_stats":null,"previous_names":["santipac/food-ai-analyzer"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Santipac/nutrianalyzer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Santipac%2Fnutrianalyzer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Santipac%2Fnutrianalyzer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Santipac%2Fnutrianalyzer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Santipac%2Fnutrianalyzer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Santipac","download_url":"https://codeload.github.com/Santipac/nutrianalyzer/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Santipac%2Fnutrianalyzer/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31782736,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-14T02:24:21.117Z","status":"ssl_error","status_checked_at":"2026-04-14T02:24:20.627Z","response_time":153,"last_error":"SSL_read: 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":["edge","edgefunctions","food","llm","nextjs","open-ai","rate-limiting","react","typescript","zustand"],"created_at":"2025-07-30T00:38:50.827Z","updated_at":"2026-04-14T04:31:32.583Z","avatar_url":"https://github.com/Santipac.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🥗 AI Food Nutrition Analyzer\n\nAn intelligent web application that analyzes food and provides detailed nutritional information using AI. Designed for health-conscious users who want to better understand what they eat and receive personalized advice.\n\n## 🌟 Features\n\n### 📊 Complete Nutritional Analysis\n- **Macronutrient analysis**: Proteins, carbohydrates, fats, and fiber\n- **Micronutrient information**: Essential vitamins and minerals\n- **Calorie counting**: Accurate estimation of caloric content\n- **Health score**: Overall food healthiness evaluation (0-100)\n\n### 🤖 Smart Nutritional Chat  \n- Natural conversations with a virtual nutritionist\n- Personalized advice based on your profile\n- Responses in your preferred language\n- Specific recommendations according to your fitness goals\n\n### 👤 Personalized Profiles\n- Basic information: age, gender, height, weight\n- Fitness objectives: weight loss, muscle gain, maintenance\n- Training frequency\n- Recommendations tailored to your profile\n\n### 🛡️ Backend Protection\n- Smart rate limiting without database\n- Protection against prompt injection and malicious content\n- Multiple security layers\n- Flexible configuration for different environments\n\n## 🚀 Technologies \u0026 Libraries\n\n### Frontend\n- **[Next.js 15](https://nextjs.org/)** - React framework with App Router\n- **[React 19](https://react.dev/)** - User interface library\n- **[TypeScript](https://www.typescriptlang.org/)** - Static typing\n- **[Tailwind CSS](https://tailwindcss.com/)** - Utility-first CSS framework\n- **[Radix UI](https://www.radix-ui.com/)** - Accessible and unstyled components\n- **[Lucide React](https://lucide.dev/)** - Modern SVG icons\n- **[Zustand](https://zustand-demo.pmnd.rs/)** - Lightweight state management\n\n### Backend \u0026 AI\n- **[Vercel AI SDK](https://sdk.vercel.ai/)** - AI model integration\n- **[OpenAI GPT-3.5 Turbo](https://openai.com/)** - Language model for analysis and chat\n- **Next.js API Routes** - Backend endpoints\n- **Edge Runtime** - Optimized execution\n\n### Development Tools\n- **[pnpm](https://pnpm.io/)** - Fast package manager\n- **[PostCSS](https://postcss.org/)** - CSS processor\n- **ESLint** - Code linting\n- **Prettier** - Code formatting\n\n## 🛠️ Installation \u0026 Setup\n\n### Prerequisites\n- Node.js 18+ \n- pnpm (automatically installs if you use npm)\n\n### 1. Clone the repository\n```bash\ngit clone \u003crepository-url\u003e\ncd food-analyzer\n```\n\n### 2. Install dependencies\n```bash\nnpm install -g pnpm  # if you don't have pnpm installed\npnpm install\n```\n\n### 3. Configure environment variables\nCreate a `.env.local` file in the project root:\n\n```env\n# Required\nOPENAI_API_KEY=your_openai_key_here\n\n# Optional - Rate Limiting (default values)\nCHAT_MAX_REQUESTS=20           # Requests per minute for chat\nNUTRITION_MAX_REQUESTS=10      # Requests per minute for analysis\nGLOBAL_MAX_REQUESTS=100        # Global requests every 5 minutes\n\n# Optional - Security\nMAX_REQUEST_SIZE=51200         # 50KB maximum per request\nMAX_MESSAGE_LENGTH=2000        # Maximum characters per message\nENABLE_RATE_LIMITING=true      # Enable protections\n```\n\n### 4. Run in development\n```bash\npnpm dev\n```\n\nThe application will be available at `http://localhost:3000`\n\n### 5. Build for production\n```bash\npnpm build\npnpm start\n```\n\n## 🔒 Security\n\nThe project includes multiple protection layers:\n\n- **Rate Limiting**: Prevents abuse with endpoint-specific limits\n- **Content validation**: Detects prompt injection and malicious content  \n- **Size limits**: Controls request and message sizes\n- **Robust identification**: IP + User Agent for user identification\n- **Flexible configuration**: Adjust limits according to environment\n\nSee complete documentation in the security configuration file.\n\n## 🏗️ Project Architecture\n\n```\nsrc/\n├── app/                    # Next.js App Router\n│   ├── api/               # Backend endpoints\n│   │   ├── chat/          # Nutritional chat\n│   │   └── nutrition-analysis/ # Food analysis\n│   ├── chat/              # Chat page\n│   └── page.tsx           # Main page\n├── components/            # React components\n│   ├── analysis/          # Analysis components\n│   ├── chat/              # Chat components\n│   ├── onboarding/        # Profile form\n│   └── ui/                # Base components (Radix UI)\n├── lib/                   # Utilities and configuration\n│   ├── rate-limiter.ts    # Rate limiting system\n│   ├── security-middleware.ts # Security middleware\n│   ├── config.ts          # Central configuration\n│   └── utils.ts           # General utilities\n├── stores/                # Global state (Zustand)\n├── interfaces/            # TypeScript types\n└── helpers/               # Helper functions\n```\n\n## 🤝 Contributing\n\nContributions are welcome! If you have ideas to improve the project:\n\n1. Fork the repository\n2. Create a feature branch (`git checkout -b feature/new-feature`)\n3. Commit your changes (`git commit -am 'Add new feature'`)\n4. Push to the branch (`git push origin feature/new-feature`)\n5. Open a Pull Request\n\n## 📄 License\n\nThis project is under the MIT License - see the [LICENSE](LICENSE) file for details.\n\nThis means you can:\n- ✅ Use the code commercially\n- ✅ Modify the code  \n- ✅ Distribute the code\n- ✅ Private use\n- ✅ Include in proprietary projects\n\n**No restrictions**. Use it however you want, learn from it, improve it, share it.\n\n---\n\n**Developed as a portfolio project to demonstrate skills in:**\n- Full-Stack development with Next.js and TypeScript\n- AI API integration (OpenAI)\n- State management and component architecture\n- Security implementation without database\n- Modern and accessible UI/UX design\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsantipac%2Fnutrianalyzer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsantipac%2Fnutrianalyzer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsantipac%2Fnutrianalyzer/lists"}