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.
Under the hood, SNAPI uses FastAPI to handle requests
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
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
sample data is already provided inside app/database/snapidb.db, and the application by default connects to it
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
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.