/foodrec

Primary LanguageJavaScript

Project Abstract

Features

  1. Food Dish Recognition
  2. Nutritional Values
  3. Recipe of the dish
  4. History and origin of the dish
  5. Menu dishes segregation into healthy and unhealthy

Tech-stack

  1. React-native for frontend
  2. Expo for App bundling and Mobile hosting
  3. Python FastAPI for backend

Setting up -

Backend -

Services used-
  1. OpenAI Api for text generation and formatting
  2. Google Cloud Platform - VisionAI Api for image and text detection
  3. API Ninjas for nutritional information
  4. Create .env or rename .env_template file to .env in the backend folder and don't forget to put .env in .gitignore
  1. Create an account on openai.com
  2. Setup up billing info
  3. Set API key
  4. Put API key in .env file like this -
OPENAI_API_KEY=<your-api-key>
Setting up GCP VisionAI Api:
  1. Create account on GCP
  2. Setup billing info
  3. Create a project
  4. Search for VisionAI api in "APIs & Services" > "Library" and click enable
  5. After enabling the VisionAI api, go to credentials and click "Create Credentials"
  6. Select "Service Account" and setup by providing name and description
  7. Download the service account credentials as json and put the json file in backend folder
  8. Add the path of credentials file to .env as -
GOOGLE_APPLICATION_CREDENTIALS=<path-to-credentials-file>
  1. Do not forget to put the file's name in .gitignore
Setting up API Ninjas api:
  1. Go to https://api-ninjas.com/ and sign up
  2. Go to yur profile and get api key
  3. Add the api key in .env file as -
NINJAS_API_KEY=<your-api-key>

Starting backend project -

# open a new terminal 
cd backend
pip install -r requirements.txt
python -m uvicorn main:app --reload --host 0.0.0.0 --port 8000

Starting frontend project -

  1. Installation
# open a new terminal 
cd client
npm install
  1. Get your network ip address by running this command in your terminal
ipconfig getifaddr en0
  1. Copy the ip address and replace the ip address in api.js file
  2. Run the following command to start the app
npx expo start
  1. This will run the app in the computer and provide you the steps to run the app in the phone.