Skip to content

BoraYaswanthReddy/FoodLens

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FoodLens

A smart food tracker that identifies food from images, provides nutritional information, and suggests meals.

Demo

Watch the Demo Video

Features

  • Food Identification: Identify food items from images.
  • Nutritional Analysis: Get detailed nutritional information for identified food.
  • Food Logging: Keep a log of your daily food intake.
  • Meal Suggestions: Get personalized meal suggestions based on your dietary preferences.

Installation

  1. Clone the repository:
    git clone <repository-url>
  2. Navigate to the project directory:
    cd FoodLens
  3. Install the dependencies:
    npm install
  4. Create a .env file in the root of the project and add the following environment variables:
    GOOGLE_AI_API_KEY=your_google_api_key
    CLOUDINARY_CLOUD_NAME=your_cloudinary_cloud_name
    CLOUDINARY_API_KEY=your_cloudinary_api_key
    CLOUDINARY_API_SECRET=your_cloudinary_api_secret
    
  5. Start the server:
    npm start

Usage

To use the command-line interface (CLI) for adding food entries, viewing history, or getting meal suggestions, run the following command:

npm run cli

API Endpoints

Food Entries

  • POST /api/food-entries

    Adds a new food entry. The request body should be the raw image data.

  • GET /api/food-entries

    Retrieves the entire food log.

Meal Suggestions

  • POST /api/meal-suggestions

    Get a meal suggestion. The request body should be a JSON object with diet and cuisine properties.

    Example:

    {
      "diet": "vegetarian",
      "cuisine": "Italian"
    }

Project Structure

/
├── public/
│   └── uploads/            # Uploaded images are stored here
├── src/
│   ├── aiProvider.ts       # Manages the AI provider
│   ├── foodIdentifier.ts   # Identifies food from images
│   ├── imageUploader.ts    # Handles image uploads to Cloudinary
│   ├── index.ts            # CLI entry point
│   ├── logManager.ts       # Manages the food log
│   ├── nutritionAnalyzer.ts# Analyzes nutritional information
│   ├── server.ts           # Express server
│   ├── suggestionEngine.ts # Generates meal suggestions
│   └── types.ts            # TypeScript types
├── .gitignore              # Git ignore file
├── package.json            # Project dependencies and scripts
└── tsconfig.json           # TypeScript configuration

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors