The Cook’s Nook

The Cook’s Nook Overview

View the Code

The Cook’s Nook is a mobile Android application that functions as a virtual cookbook, meal planner, and shopping assistant. Individuals create and store recipes in their personal virtual cook book, and The Cook’s Nook utilizes publicly available data provided from the US Department of Agriculture to provide nutritional information about the recipes they have created.

While browsing the cook book, users can easily create custom menus and add recipes of choice to simplify effortless meal planning. The Cook’s Nook also greatly streamlines the shopping process by allowing users to easily compile a condensed shopping list for recipes of their choice. Over time, The Cook’s Nook intends to use a user’s meal planning history and machine learning principles to make healthy meal recommendations to users in an effort to facilitate healthy eating habits.

Tech at a glance

  • Java
  • XML
  • SQL
  • SQLite
  • Android Room

Features to Note

  • Local Database Caching (SQLite)
  • RESTful Queries
  • MVVM Architecture
  • Data Visualization

The Cook’s Nook Data Sources and Structure

The Cook’s Nook accesses data over the network via RESTful queries, and also persists data locally.

FoodData Central

FoodData Central, a data system provided by the US Department of Agriculture, integrates five different databases which store data and metadata for various food items and their nutritional values. These databases are:

  • Foundation Foods
  • SR Legacy Foods
  • Survey Foods (FNDDS)
  • Branded Foods
  • Experimental Foods.

Users are able to download each database in .CSV format or as a Microsoft Access database. However, The Cook’s Nook instead uses the API provided by FoodData Central to access data directly via RESTful queries.

Each of the databases are separate from another, and thus utilize slightly different schemas for storing their data. No single database includes all of the food items necessary to make a functional cookbook application. However, each additional database integrated into The Cook’s Nook introduced additional complexity. Therefore, only two of the databases are incorporated: Foundation Foods, and Branded Foods. Foundation food items and Branded food items are then converted to a standardized Ingredient model for use within the application.

Using the FoodData Central API to access food and nutrition data has many advantages. The API provides a single interface to search all five databases simultaneously, with functionality to sort and filter data as needed. It prevents the need for users to transform and manipulate the databases to conform to their application requirements (for example, Android uses SQLite for local data persistence, while FoodData Central uses Microsoft Access). It also negates the need to store large amounts of data on the device, of which only a small subset might actually be accessed.

Android Room

Android Room is a persistence library that operates on top of a SQLite database and allows users to cache data locally on the device. The Cook’s Nook utilizes a Room database to store recipe, meal plan, and shopping list data.

Using the FoodData Central API to access food and nutrition data may have some advantages, but it also has a couple disadvantages. It requires the user to have internet access in order to query data, and network requests may be time consuming.

To improve the performance of the application, RESTful queries are only made when a user is creating a recipe and searching for ingredients. When a recipe is saved, the ingredients (and their corresponding nutrition information) are saved along with the recipe in the local Room database.

Looking Forward: Google Firebase

Android Room is great for storing local data. There may be some instances, though, where a user needs to access their cookbook from a different device or restore data to a damaged device. Google Firebase offers an Android compatible Realtime Database, which allows applications to persist data over the network. This enhances data protection, and provides flexibility to the users for how and where they access their data.

For now, The Cook’s Nook only persists user data locally. In future releases, it plans to incorporate network persistence using Google Firebase, with multiple-user support.