A modern web application that analyzes food images using Vercel AI SDK to provide nutritional information. Simply upload a photo of your food, and get instant details about calories and nutrients.
- Upload food images with drag-and-drop
- Get instant AI analysis of food content
- View calories and macronutrients
- See detailed breakdown of detected ingredients
- Beautiful, responsive UI
- Next.js 15
- Vercel AI SDK
- Shadcn UI
- TypeScript
- Tailwind CSS
This project showcases the power of Vercel AI SDK's generateObject function, which enables:
- Type-safe AI responses using Zod schema validation
- Structured data output for consistent UI rendering
- Multi-modal capabilities (text + image analysis)
- Easy integration with GPT-4o
The generateObject function ensures we get properly formatted nutritional data every time, making the app reliable and maintainable.
- Clone the repo
- Install dependencies with
pnpm install - Copy
.env.exampleto.env.localand add your OpenAI API key - Run
pnpm devto start the development server
Required environment variables:
OPENAI_API_KEY=your_openai_api_key
Contributions are welcome! Feel free to submit issues and pull requests.
MIT License - feel free to use this project however you'd like!
Built with ❤️ using Vercel AI SDK