Giter Club home page Giter Club logo

snapi's Introduction

Smart Nutrition API powered by AI

About

The Smart Nutrition API (S.N.A.P.I) is a versatile RESTful API Powered by Artificial Intelligence that can been consumed and used by any application that supports JSON-RPC protocol such as Mobile Applications, JavaScript Application such as browser Extensions, for users who are conscious about the foods their consume, whether they are following a meal plan provide by a Nutrition specialist due to health complications, or they are trying to change their lifestyle by watching or keeping track of their daily macros.

SNAPI is trained to recognize different kinds of foods consumed by humans and works by allowing Applications to feed it various kinds of raw data such images, voice prompts and text prompts (constrained to human food), depending on the type of information given, SNAPI then uses either image processing to analyze the image and categories the type of food contained in the image (e.g Banana). It then takes that data and compose a phrase such as “Nutritional Value in a Banana”, to which the phrase is then posed to ChatGPT API, and receives a response that is further analyzed and returned to the consumer/client of the API as a JSON response.

Project Setup

Under the hood, SNAPI uses FastAPI to handle requests

Requirements (Windows 10 or Later)

Python Virtual Environment

Windows ONLY Setup

To avoid complications, use Git Bash to execute the following commands on Windows

install the virtual environment

python -m venv venv

activate your newly install virtual environment

source venv/Scripts/activate

install python packages in the requirements.txt file by using PIP

pip install -r requirements.txt

To run the project type

uvicorn app.main:app --reload

Unix/Linux ONLY Setup

install the virtual environment

python3 -m venv venv

activate your newly install virtual environment

source venv/bin/activate

install python packages in the requirements.txt file by using PIP

pip3 install -r requirements.txt

To run the project type

uvicorn app.main:app --reload

Database Migrations

sample data is already provided inside app/database/snapidb.db, and the application by default connects to it

Proceed with this section only have if you have a fresh install of the database

Running the migrations

This command will create all the necessary database tables, BUT will NOT seed any data, it's your responsibility to do that, just as it is to config a new database connection.

alembic upgrade head

Roadmap

The future of SNAPI will be trained to allow it to accept request in various formats such as voice prompts and text prompts (constrained to human food), depending on the type of information given, SNAPI will then use Natural Language Processing (NLP) to process Voice and Text (e.g “How many calories are in this Banana”). It then takes that data and compose a phrase such as “Nutritional Value in a Banana”, to which the phrase is then posed to ChatGPT API, and receives a response that is further analyzed and returned to the consumer/client of the API as either JSON response or voice output using NLP.

snapi's People

Contributors

sibowilldo avatar sandisile-12t avatar sbusiso29 avatar siphesihle-7 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.