Skip to content

FoodSnap AI Solution - Shanib#7

Open
Shanib20 wants to merge 5 commits intoWeCode-Community-Dev:mainfrom
Shanib20:feature/Shanib20
Open

FoodSnap AI Solution - Shanib#7
Shanib20 wants to merge 5 commits intoWeCode-Community-Dev:mainfrom
Shanib20:feature/Shanib20

Conversation

@Shanib20
Copy link

@Shanib20 Shanib20 commented Jul 1, 2025

Intelligent Nutritional Analysis

Member Name: Shanib


Project Overview

FoodSnap AI is an innovative application designed to empower users with instant nutritional insights into their meals. By leveraging cutting-edge AI, it aims to simplify the process of tracking food intake and making informed dietary choices, making healthy living more accessible.


Implemented Features

This solution includes the following key features:

  1. AI Food Recognition & Analysis:
    • Upload an image of your food, and our AI will identify the food item and provide an estimated calorie count along with macronutrient breakdown (protein, carbohydrates, fat).
  2. Smart Food Database Search:
    • Search a comprehensive database for detailed nutritional information on various food items and specific serving sizes.
    • (Note: For this hackathon, this feature uses simulated data to demonstrate functionality. In a production environment, it would integrate with a real nutrition database API like USDA FoodData Central.)
  3. Personalized Diet Plans (AI-Powered):
    • Input your dietary preferences, goals, and current health status, and receive a tailored diet plan generated by AI.
  4. AI Health Snapshot:
    • Get a quick overview of your current health status based on your dietary inputs, offering insights and recommendations.

Tech Stack Used

  • Frontend:
    • React.js (with Vite)
    • Tailwind CSS (for responsive and modern UI)
    • Lucide React (for icons)
    • React Router DOM (for navigation)
  • Backend:
    • Node.js (Runtime Environment)
    • Express.js (Web Framework)
    • Multer (for handling image uploads)
    • CORS (for cross-origin requests)
  • AI Integration:
    • Google Gemini API (for image analysis and text generation)
  • Deployment:
    • Netlify (for Frontend hosting)
    • Render (for Backend API hosting)

How to Set Up and Run Locally

To run this project on your local machine:

  1. Clone your forked repository:
    git clone [https://github.com/Shanib20/foodsnap-ai.git](https://github.com/Shanib20/foodsnap-ai.git)
    cd foodsnap-ai
  2. Switch to your development branch:
    git checkout feature/Shanib20
  3. Install Frontend Dependencies:
    npm install
  4. Install Backend Dependencies:
    cd backend
    npm install
    cd ..
  5. Configure Environment Variables:
    • Create a .env file inside the backend/ directory.
    • Copy the contents of backend/.env.example into backend/.env.
    • Replace YOUR_GOOGLE_GEMINI_API_KEY_HERE with your actual Google Gemini API Key.
    • Set FRONTEND_URL=http://localhost:5173 in backend/.env for local testing.
    • Important: The .env file is excluded by .gitignore and should never be committed to GitHub.
  6. Start the Backend Server:
    • Open a new terminal, navigate to the backend/ directory (cd backend).
    • Run: node server.cjs
  7. Start the Frontend Development Server:
    • Open another terminal, navigate to the project root (cd .. if you're in backend/).
    • Run: npm run dev
  8. Open your browser to http://localhost:5173 to view the application.

Live Demo

You can access the live deployed version of the FoodSnap AI application here:

**Frontend (Netlify): https://foodsnap-ai.netlify.app/

(Optional: You can also include your backend URL for transparency, but the frontend link is the primary one for judges.)
Backend API (Render): https://snapthefood.onrender.com


Known Issues / Limitations

  • The "Food Nutrition Database Search" currently uses simulated data for demonstration purposes. Full integration with a real nutrition database API would be implemented in a production version.
  • Accuracy of AI food recognition and calorie estimation is dependent on image quality and the complexity of the dish.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant