DEV Community


Posted on • Updated on

Keto Diet Lib - a collection of food info and helpful tools for ketogenic patients

Site Demo Gif

Overview of My Submission

Keto Diet Lib is an informative site with comprehensive data on foods and their nutritional values for ketogenic patients.

It uses a combination of the Atlas Search and Aggregation Pipeline to provide a simple but effective search engine that helps generate the list of data for the user.

The site also has a dedicated page for each food to display their fats, proteins, carbohydrates, and calories. Additionally, the page has tools that can help with the user's keto diet plan:

  1. Serving - updates the nutritional values based on the selected serving option (ex. 1 cup, 4.2 oz)
  2. Nutrient Comparison - a pie chart that shows the division of fats, proteins, and carbohydrates
  3. Ketometer - visual meter that informs the user the contents of the carbohydrates vs. the user's allowed carbohydrates consumption
  4. Keto Rating - overall rating of the food in terms of how healthy it is for ketogenic patients

Lastly, the site also has a page that generates the top 5 data per food group with the highest fats and lowest carbs. The data are displayed in 100 grams.

Submission Category:

I'm submitting this entry for the Choose Your Own Adventure category.

Link to Code

GitHub logo netervati / ketodietlib

A collection of food info and helpful tools for keto patients

Keto Diet Lib

alt text

Keto Diet Lib is an informative site with comprehensive data on foods and their nutritional values for ketogenic patients. This project is my submission for the MongoDB Atlas Hackathon on DEV under the category Choose Your Own Adventure. Credit goes to My Food Data for the dataset.

Primary Technologies

Below are the main technologies that I used:

  • Flask (Backend Framework)
  • Bootstrap, & Vanilla JS (Frontend Technologies)
  • MongoDB (Database)

Hosting the Application locally

To use Keto Diet Lib, you will need python 3.9. You will also need a MongoDB account and the MongoDB Community Edition application.


Follow the instructions in the MongoDB site and create your own database and user. Make sure to allow your IP address to access MongoDB by setting your cluster's Network Access. Then, create a collection labeled foodinfo. Import the foodinfo.csv file in the added collection. Afterwards, create a search…

Additional Information

Check this link for a live demonstration of Keto Diet Lib. Please, note that I'm using a free tier account to host this so you will experience slow response from the site.

Search Results

Search Results

Data Page

Data Page

Top Food / Data

Top Food / Data

Search Operators Demo

Search Operators Demo

Technologies Used

  • Flask
  • Flask Pymongo
  • Jinja
  • Bootstrap
  • Vanilla JS
  • Chart.js
  • MongoDB
  • Atlas Search
  • Gunicorn
  • Heroku



This was my first Hackathon (sort of since I joined 2 game jams before), my first use of MongoDB, and my first post in Dev. I joined late for this event, but I still had fun learning about the amazing tools the database has. Initially, I was hesitant to show this project because everyone else has complex and cool creations, but I think I did well for my first try. This was a great experience. To all participants, good luck!

Top comments (1)