tp

DietBook User Guide

Introduction

DietBook is a desktop application, optimized for use via a Command Line Interface (CLI). It is designed to track your food and nutritional intake as well as provide you with your daily calorie recommendation. As the application mainly targets NUS students staying on campus, it has a database prepopulated with food items commonly found around NUS. This allows for such food items to be easily added to the list of food items consumed for tracking.

Quick Start

  1. Ensure that you have Java 11 installed.
  2. Download the latest version of dietbook.jar from here.
  3. Copy the file to the folder you want to use as the home folder for your DietBook.
  4. Navigate to the folder containing the jar file on command prompt and run the command java -jar dietbook.jar.
  5. Enable full-screen for a better experience but rest assure that DietBook will still function normally even in non full-screen mode.
  6. For first time users:
    A CLI, similar to the one shown below, should appear within a few seconds. Follow the instructions provided to setup DietBook or refer to name and info for more detailed explanations.
    DietBook Welcome Message
  7. Start using DietBook by typing any valid command and pressing Enter to execute it.
  8. Refer to the Features section below for more details of each command or jump to Command Summary section for a list of valid commands.

Features

:warning: Please take note of the following:

Entering username: name

Stores the user’s name or nickname into DietBook during the initial setup.

Format: name YOUR_NAME_OR_NICKNAME

Example of usage:

Output example:

Hi Jack!
Before we get started, I would like to know about about you so that I can make more
accurate calculations for you :). Therefore, could you please share with me the following:
- Your gender either F for female or M for male or O for others.
- Your age which is a positive integer.
- Your height in cm.
- Your original weight in kg, the weight when you first started using DietBook or you current weight.
- Your current weight in kg.
- Your target weight in kg, or your current weight if that is also your target weight.
- Your fitness level, represented by a number from 1 to 5.
  1 = You hardly engage in any exercise or have a job that requires little to no physical activity.
  2 = You engage in some form of light exercise or have a job that requires some physical activity.
  3 = You engage in moderate amount of exercise or have a job that requires moderate physical activity.
  4 = You engage in vigorous exercise or have a physically demanding job.
  5 = You engage in extremely vigorous exercise or have an extremely physically demanding job.

Please input your details in the following format:
  info g/GENDER a/AGE h/HEIGHT o/ORIGINAL_WEIGHT c/CURRENT_WEIGHT t/TARGET_WEIGHT f/FITNESS_LEVEL
  Example: info g/F a/21 h/165 o/65 c/65 t/55 f/2

Entering user information: info

Stores the user’s personal information into DietBook during the initial setup.

Format: info g/GENDER a/AGE h/HEIGHT o/ORIGINAL_WEIGHT c/CURRENT_WEIGHT t/TARGET_WEIGHT f/FITNESS_LEVEL

Example of usage:

Output example:

Thank you! DietBook has been initialised and you may start by entering any valid commands.
If you require a list of valid commands, you can enter: help

Viewing user information: userinfo

Shows the user information stored in DietBook.

Format: userinfo

Output example:

Here is your information:
  Name: Jack
  Gender: male
  Age: 21
  Height: 175cm
  Original weight: 85kg
  Current weight: 85kg
  Target weight: 75kg
  Fitness level: You engage in some form of light exercise or have a job that requires some physical activity.

Editing user information: editinfo

Edits the user information stored in DietBook.

Format: editinfo [n/NAME] [g/GENDER] [a/AGE] [h/HEIGHT] [o/ORIGINAL_WEIGHT] [c/CURRENT_WEIGHT] [t/TARGET_WEIGHT] [f/FITNESS_LEVEL]

Example of usage:

Output example:

Got it! I've updated your personal information:
  Name: Jack
  Gender: male
  Age: 21
  Height: 175cm
  Original weight: 85kg
  Current weight: 75kg
  Target weight: 75kg
  Fitness level: You engage in vigorous exercise or have a physically demanding job.

To view all food in the database: data

Displays a list of provided food database.

Format: data

Output example:

Here are the food items in the database:
  1. Prawn Mee Soup(Dry)(Large) | calorie : 490 | protein : 20 | carbohydrate : 30 | fats : 26
  2. Prawn Mee Soup(Dry)(Small) | calorie : 390 | protein : 15 | carbohydrate : 25 | fats : 19
  3. Fried Hokkien Prawn Mee(Large) | calorie : 470 | protein : 20 | carbohydrate : 40 | fats : 20
  4. Fried Hokkien Prawn Mee(Small) | calorie : 350 | protein : 15 | carbohydrate : 30 | fats : 15
  5. Clay Pot Chicken | calorie : 440 | protein : 15 | carbohydrate : 34 | fats : 15
  6. Black Pepper Chicken | calorie : 490 | protein : 16 | carbohydrate : 34 | fats : 16
  7. Ayam Penyet Set | calorie : 699 | protein : 30 | carbohydrate : 45 | fats : 30
  8. Steamed Chicken Set  | calorie : 475 | protein : 20 | carbohydrate : 35 | fats : 20
  9. Ikan Grouper Penyet Set | calorie : 669 | protein : 40 | carbohydrate : 50 | fats : 50
  10. kimchi fried rice | calorie : 520 | protein : 35 | carbohydrate : 45 | fats : 56
  11. ginseng chicken | calorie : 450 | protein : 32 | carbohydrate : 25 | fats : 66
  12. ramen | calorie : 530 | protein : 25 | carbohydrate : 76 | fats : 43
  13. gong cha green tea | calorie : 100 | protein : 0 | carbohydrate : 0 | fats : 0
  14. gong cha ooloong tea | calorie : 100 | protein : 0 | carbohydrate : 0 | fats : 0
  15. gong cha bubble tea | calorie : 200 | protein : 0 | carbohydrate : 0 | fats : 0

To add food from the database: add

Adds a desired food in the database into the DietBook.

Format: add i/FOOD_INDEX x/PORTION_SIZE [yyyy-mm-ddTHH:MM]

Note : optional date time input, if not provided, the entry will have the current date time stamp Inputting a future date time is not allowed.

Example of Usage:

Output example:

  1. Prawn Mee Soup(Dry)(Large) | calorie : 490 | protein : 20 | carbohydrate : 30 | fats : 26 -- (1) [09 Nov 2020 2238]
  2. Fried Hokkien Prawn Mee(Large) | calorie : 470 | protein : 20 | carbohydrate : 40 | fats : 20 -- (2) [02 Nov 2020 1230]

To add you own food: add

Format: add x/PORTION_SIZE n/FOOD_NAME k/CALORIE [c/CARBOHYDRATE] [p/PROTEIN] [f/FAT]

Examples of usage :

To view all food in DietBook: list

Example of usage : list

Output :

Here are the food items in DietBook:
  1. Salty Chicken Rice | calorie : 300 | protein : 20 | carbohydrate : 10 | fats : 50 -- (1)
  2. Salty Chicken Rice | calorie : 300 | protein : 20 | carbohydrate : 10 | fats : 50 -- (1)
  3. Chilli Pepper Crab | calorie : 400 | protein : 10 | carbohydrate : 10 | fats : 20 -- (2)

To view all food in DietBook recorded within a time period: list

Format: list yyyy-mm-ddTHH:mm yyyy-mm-ddTHH:mm

Example of usage : list 2020-10-29T11:30 2020-10-29T16:40

To view all food in DietBook recorded from a certain date until now: list yyyy-mm-ddTHH:mm

Example of usage : list 1066-10-14T08:00

Output :

Here are the food items recorded in DietBook between 14 Oct 1066 0800 and 29 Oct 2020 1317:
  1. Salty Chicken Rice | calorie : 300 | protein : 20 | carbohydrate : 10 | fats : 50 -- (1)
  2. Salty Chicken Rice | calorie : 300 | protein : 20 | carbohydrate : 10 | fats : 50 -- (1)
  3. Chilli Pepper Crab | calorie : 400 | protein : 10 | carbohydrate : 10 | fats : 20 -- (2)

To delete a food from DietBook: delete INDEX

Example of usage : delete 2

Output :

Noted. I've removed this food item:
  Salty Chicken Rice | calorie : 300 | protein : 20 | carbohydrate : 10 | fats : 50 -- (1)

The list after delete is done :

Here are the food items in DietBook:
  1. Salty Chicken Rice | calorie : 300 | protein : 20 | carbohydrate : 10 | fats : 50 -- (1)
  2. Chilli Pepper Crab | calorie : 400 | protein : 10 | carbohydrate : 10 | fats : 20 -- (2)

To delete all food items from the DietBook: clear

Example of usage : clear

Output :

All previous data has been deleted...
DietBook is now empty.

Before clearing :

Here are the food items in DietBook:
  1. Salty Chicken Rice | calorie : 300 | protein : 20 | carbohydrate : 10 | fats : 50 -- (1)
  2. Chilli Pepper Crab | calorie : 400 | protein : 10 | carbohydrate : 10 | fats : 20 -- (2)

After clearing :

DietBook is currently empty.

Calculating nutrition intake: calculate

Calculate the amount of nutrition in the foods in intake list.

Format: calculate NUTRITION_NAME [START_TIME] [END_TIME]

example usage:

Output example:

Time period: between 29 Oct 2020 0800 and 29 Oct 2020 1700

Total carbohydrate intake: 80g

Calculate the recommendation based on the person infomation.

Format: recommend Example of usage: recommend

Output :

Hi Jack!
  Here is your daily recommended calorie intake: 2607kcal

We use the following list as an example, to set up the list we have the following sequence of inputs

add x/1 n/Salty Chicken Rice k/300 c/10 p/20 f/50
add x/2 n/Chilli Pepper Crab k/400 c/10 p/10 f/20
add x/1 n/Steak Buns k/500 c/20 p/50 f/10
add x/3 n/Sweat potato tea k/300 c/30 p/0 f/0
add x/1 n/Chicken Wing Noodles k/400 c/10 p/30 f/10
list
Here are the food items in DietBook:
  1. Salty Chicken Rice | calorie : 300 | protein : 20 | carbohydrate : 10 | fats : 50 -- (1)
  2. Chilli Pepper Crab | calorie : 400 | protein : 10 | carbohydrate : 10 | fats : 20 -- (2)
  3. Steak Buns | calorie : 500 | protein : 50 | carbohydrate : 20 | fats : 10 -- (1)
  4. Sweat potato tea | calorie : 300 | protein : 0 | carbohydrate : 30 | fats : 0 -- (3)
  5. Chicken Wing Noodles | calorie : 400 | protein : 30 | carbohydrate : 10 | fats : 10 -- (1)

Other features

To view a list of valid commands: help

Displays the helping guide for commands.

Format: help

Output example:

Listed below are the valid commands for DietBook:
__________________________________________________________________________________________________________________________________________
__________________________________________________________________________________________________________________________________________
  userinfo    | To view user information:
              | userinfo
__________________________________________________________________________________________________________________________________________
  editinfo    | To edit user information:
              | editinfo [n/NAME] [g/GENDER] [a/AGE] [h/HEIGHT] [o/ORIGINAL_WEIGHT] [c/CURRENT_WEIGHT] [t/TARGET_WEIGHT] [f/FITNESS_LEVEL]
__________________________________________________________________________________________________________________________________________
  add         | To add a food from the database:
              | add i/INDEX x/PORTION_SIZE [yyyy-mm-ddTHH:mm]
__________________________________________________________________________________________________________________________________________
  data        | To view all food in the database:
              | data
__________________________________________________________________________________________________________________________________________
  add         | To add a food not in the database:
              | add x/PORTION_SIZE n/FOOD_NAME k/CALORIE [c/CARBOHYDRATE] [p/PROTEIN] [f/FAT] [yyyy-mm-ddTHH:mm]
__________________________________________________________________________________________________________________________________________
  list        | To view all food in DietBook:
              | list [yyyy-mm-ddTHH:mm] [yyyy-mm-ddTHH:mm]
__________________________________________________________________________________________________________________________________________
  delete      | To delete a food from DietBook:
              | delete INDEX
__________________________________________________________________________________________________________________________________________
  clear       | To delete all food items from the DietBook:
              | clear
__________________________________________________________________________________________________________________________________________
  recommend   | To get recommended calorie intake:
              | recommend
__________________________________________________________________________________________________________________________________________
  calculate   | To calculate nutritional intake:
              | calculate NUTRIENT_TYPE [yyyy-mm-ddTHH:mm] [yyyy-mm-ddTHH:mm]
              |   Valid NUTRIENT_TYPE: carb, calorie, fat, protein, all
__________________________________________________________________________________________________________________________________________
  help        | To view a list of valid commands:
              | help
__________________________________________________________________________________________________________________________________________
  exit        | To exit DietBook:
              | exit
__________________________________________________________________________________________________________________________________________

To exit DietBook: exit

Exits the DietBook.

Format: exit

Output example:

Bye! Hope to see you again soon!

Saving the DietBook:

Saves the DietBook data when the exit command have been input. The saved data is in 2 files: UserInfo.txt and FoodList.txt. *Also saves data whenever there is a change in either Person or FoodList data after commands such as add, clear,delete and editinfowith no message printed.

Output example:

Your data has been saved successfully.

Loading existing FoodList and Person data into the DietBook:

Saved data of FoodList and Person loaded if available. *New file created when saving if no existing data.

Output example:

*With existing data

Loading personal information...
Loading personal food data...
_____________________________________________________________________________________________________________________________________
_______  __ ______ ________ _______   ______   ______  __    __
|   __  \|  |   ___|__    __|   __  \ /  __  \ /  __  \|  | /  /
|  |  |  |  |  |___   |  |  |  |__|  |  |  |  |  |  |  |  |/  /
|  |  |  |  |   ___|  |  |  |   __  <|  |  |  |  |  |  |     /
|  |__|  |  |  |___   |  |  |  |__|  |  |__|  |  |  |  |  |\  \
|_______/|__|______|  |__|  |_______/ \______/ \______/|__| \__\

Welcome back to DietBook tik!
All your previous data has been successfully loaded and you may start by entering any valid commands. 
If you require a list of valid commands, you can enter: help
_____________________________________________________________________________________________________________________________________

*Without existing data

Loading personal information...
_____________________________________________________________________________________________________________________________________
Person data file not found! Creating new personal data....
_____________________________________________________________________________________________________________________________________
Loading personal food data...
_____________________________________________________________________________________________________________________________________
FoodList data file not found! Creating new food list...
_____________________________________________________________________________________________________________________________________
_____________________________________________________________________________________________________________________________________
_______  __ ______ ________ _______   ______   ______  __    __
|   __  \|  |   ___|__    __|   __  \ /  __  \ /  __  \|  | /  /
|  |  |  |  |  |___   |  |  |  |__|  |  |  |  |  |  |  |  |/  /
|  |  |  |  |   ___|  |  |  |   __  <|  |  |  |  |  |  |     /
|  |__|  |  |  |___   |  |  |  |__|  |  |__|  |  |  |  |  |\  \
|_______/|__|______|  |__|  |_______/ \______/ \______/|__| \__\

Hello! Welcome to DietBook!
I am Diet, your guide to using DietBook. How may I address you?
Please input your name or nickname in the following format:
  name YOUR_NAME_OR_NICKNAME 
  Example: name Jack";
_____________________________________________________________________________________________________________________________________

FAQ

Q: How do I transfer my data to another computer?

A: Either download dietbook.jar on the other computer and overwrite the empty data files with the data files from your previous computer or copy the whole DietBook home folder from the previous computer to the new computer. data from v2.1 is NOT compatible with earlier data. The data is found in C/Users/{User name}/dietbook. As of v2.1 the food list data is found in the folder Food##PORTION###dDATE##folder and the Personal data is found in the folder PERSONA_IS_NO_SUCH_PERSOOSOOSNSNSNS.

Command Summary

Action Format, Examples
Enter name Note: Used only when setting up DietBook for the first time.
name YOUR_NAME_OR_NICKNAME
e.g.,name Jack
Enter info Note: Used only when setting up DietBook for the first time.
info g/GENDER a/AGE h/HEIGHT o/ORIGINAL_WEIGHT c/CURRENT_WEIGHT t/TARGET_WEIGHT f/FITNESS_LEVEL
e.g.,info g/M a/21 h/175 o/85 c/85 t/75 f/2
View user info userinfo
Edit user info editinfo [n/NAME] [g/GENDER] [a/AGE] [h/HEIGHT] [o/ORIGINAL_WEIGHT] [c/CURRENT_WEIGHT] [t/TARGET_WEIGHT] [f/FITNESS_LEVEL]
e.g.,editinfo c/75 f/4
Calculate recommended calorie intake recommend
Calculate nutrition intake calculate NUTRITION_NAME [START_TIME] [END_TIME]
e.g.,calculate fat