FoodSnap AI is a smart nutrition tracking application that leverages artificial intelligence to analyze food images, identify dishes, and estimate their nutritional content.
Tracking daily nutritional intake is often a tedious and error-prone process. Users struggle to accurately estimate portion sizes and identify the caloric content of complex dishes. This friction leads to inconsistent tracking, lack of awareness about actual intake, and ultimately, a loss of motivation to maintain healthy dietary habits.
FoodSnap AI eliminates the guesswork from nutrition tracking. By leveraging advanced computer vision and Generative AI (Google Gemini), the application instantly analyzes food photos to identify dishes and estimate portion sizes. It then cross-references this data with a reliable nutrition database (Edamam) to provide an accurate breakdown of calories, proteins, fats, and carbohydrates. This seamless, "snap-and-track" experience empowers users to make informed dietary choices with minimal effort.
- AI-Powered Analysis: Uses Google's Gemini AI to identify food items and estimate portion sizes from images.
- Detailed Nutrition Data: Integrates with the Edamam API to retrieve accurate calorie, protein, fat, and carbohydrate information.
- History & Tracking: Keeps a record of your analyzed meals (stored via MongoDB).
- Responsive Design: Built with React and Tailwind CSS for a modern, mobile-friendly interface.
- React (v19)
- Vite
- Tailwind CSS (v4)
- Axios
- TypeScript
- Node.js
- Express
- MongoDB (with Mongoose)
- Google Generative AI (Gemini) SDK
- Edamam API
- TypeScript
Follow these steps to get the project running locally.
Ensure you have the following installed:
You will also need API keys for:
git clone https://github.com/Rahul-R79/foodsnap-ai.git
cd foodsnap-ai- Navigate to the backend directory:
cd Backend - Install dependencies:
npm install
- Create a
.envfile in theBackenddirectory and add the following variables:MONGO_URL=your_mongodb_connection_string GEMINI_API_KEY=your_gemini_api_key EDAMAM_APP_ID=your_edamam_app_id EDAMAM_APP_KEY=your_edamam_app_key PORT=8080
- Start the backend server:
The server should start on
npm run dev
http://localhost:8080.
- Open a new terminal and navigate to the frontend directory:
cd Frontend - Install dependencies:
npm install
- Create a
.envfile in theFrontenddirectory (if not already present, though Vite uses.envfiles for environment variables) or ensure yoursrc/config/axios.tspoints to the correct backend URL. Typically, for Vite:VITE_API_URL=http://localhost:8080
- Start the frontend development server:
The app will usually be available at
npm run dev
http://localhost:5173.
- Open the application in your browser.
- Upload or take a photo of your food.
- Wait for the AI to analyze the image.
- View the identified food name, estimated quantity, and nutritional breakdown.