Inspiration
As very active individuals, we wanted to make an application that would not only save time but inform us about the macronutrients of grocery products.
What it does
This web app allows users to select a fitness or dietary goal of bulking, cutting, keto, or diabetic and choose grocery products based on how well the nutrients of the products help towards their goal. Users will input a product like "milk" and we will return the top rated brands or types of milk that will cater towards the users' goals but giving a rating based on weighted algorithms that we developed for each respective goal.
Users may then select and save the items for later. The products are solely chosen and priced from Kroger's selection as a proof of concept.
How we built it
We divided our project into a frontend and backend. The backend used express.js in Typescript. We created endpoints that would take in a search term from the frontend, use the term to search in Kroger's Product API to grab the top 10 most relevant products. We then take the price and UPC (universal product code), which is used to do a search in the Nutritionix API. The UPC from Kroger must be transformed to included a calculated check digit that will then be truly a universal code that is searchable. The transformed UPC is used as input in the Nutritionix API to find all the nutrition facts of the specific product. The list of products will then have all their nutritional values and will each run the Nutrition Rating algorithm that will use the user's fitness or dietary goal to take into account the scale of each of the nutrients in order to give a rating.
All of this data for each of the products for a given search term is then sent to the frontend in React and shown to the users ranked by their Nutrition Rating for the users to observe and compare.
Challenges we ran into
There were many issues into the access of the Kroger API. The requests required unique encodings that would create inconsistencies from source code to actual requests. The UPC initially wouldn't be recognized by the Nutritionix API because the format of Kroger's UPC wasn't universally known. We did further research, comparing item barcode to their UPC to find that the front digits needed to be cut and a check digit needed to be calculated.
We also had beginner programmers, who learned a lot of this entire process by having to learn syntax and software paradigm on the spot.
Accomplishments that we're proud of
We finished. We had first time hackers that were able to not only explore the possibilities of the project but also complete something that we feel like we can use for the rest of our lives once we put more time into perfecting the code. Our software stack planning ended up all working in the end, so that means we challenged ourselves well and still accomplished our requirements.
What we learned
We learned to plan our project on a higher level. The newer developers were able to experiment and learn more about REST API as well as how the pipeline of data works in many types of web apps work. Our constant communication was vital to our success.
What's next for NutriFit
Removing saved items from the profile Updating the fitness goal the user currently has Provide smart and intelligent explanation for the ratings given for the items Persistent user sessions Profile pictures Price comparison in ratio to nutrients
Built With
- express.js
- kroger-dev-api
- mongodb
- mongoose
- nutritionix
- react
- typescript
Log in or sign up for Devpost to join the conversation.