Project: DukeCooks DukeCooks Logo

What is DukeCooks?

DukeCooks is a lifestyle desktop application, specially designed for busy, health-conscious individuals. As busy student project developers for DukeCooks, we understand that it can be daunting to keep track of various tasks and yet, manage a healthy lifestyle at the same time.

DukeCooks aims to simplify this by allowing you to manage various aspects of your lifestyle, all within a single app! In DukeCooks, you will be able to manage tasks, store recipes, plan workouts, monitor health and write diaries.

Not only that, DukeCooks runs on the command-line interface (CLI). This means that all the tasks mentioned above can be executed all within a single line, saving you even more time!

Who developed DukeCooks?

DukeCooks is developed by a group of Year 2 students from: School of Computing, National University of Singapore.

What is in this document?

This document provides you with information on the contributions made to DukeCooks by me. It summarises my contributions to DukeCooks in the following 3 main areas:

  1. Overall Project

  2. User Guide

  3. Developer Guide

Contributions to Overall Project

Building the diary feature

The diary feature provide users with the ability to share their fitness and health tips. Furthermore, it allows users to view diaries in a simple and intuitive manner. The initial works for building the diary feature includes heavy referencing from the existing Address Book 3 (AB3) codebase.

Major Enhancements

Enhancement 1: Creating the ViewDiaryCommand

The ViewDiaryCommand is created to allow users to switch views between different diaries

This is specially designed so that users can switch diary views, without having to rely on clicking the mouse.

The functionality of ViewDiaryCommand is quite similar to that of ListCommand in AB3. I have modified the ListCommand in AB3 to allow the user to provide an diary index and only display that corresponding diary.

Enhancement 2: Creating the AddPageCommand Page Input Form

If AddPageCommand is executed, it opens a Page Input Form for users to enter their page details.

As a page’s details can get quite lengthy, the Page Input Form is created to help users by providing a GUI interface that is more suited for lengthy inputs.

This enhancement required heavy works in terms of GUI and I had to ensure that the inputs provided in the Page Input Form are first validated before it can be executed as a command.

Minor Enhancements

Enhancement: Adding icons and colours to pages

I have added different icons and colours to represent a page’s type. By differentiating the pages through colours and icons, users are able to quickly identify the 3 different page types: health, exercise and food with one glance.

Code Contribution

Visit this link to check out my contributions made to DukeCooks.

Other contributions

Project management

  • Managed releases v1.1, v1.2, v1.3 (3 releases) on GitHub

Documentation

  • Minor cosmetic tweaks to contents of User Guide and Developer Guide.

    (PR #181)

Bug Reports

Tool Integration

  • Integrated DukeCooks with AppVeyor (Continuous Integration tool), Netlify (Deployment Preview tool) and Coveralls (Code Coverage tool).

    (PR #35)

Contributions to User Guide

This section highlights my contributions to the User Guide for the diary feature. You may visit this link, to view the full User Guide.

Diary

Want to share great recipes and workout tips with your friends? Look through the available commands in this section and start sharing!

A Closer Look at Diary Feature

In the diary feature, you will be able to look through all your available diaries and pages at one quick glance! Not only that, you can also enter different commands within the command box.

Still confused? The following diagram explains where you can find the available diaries, their corresponding pages and also highlights the command box, where different commands can be executed.

diaryOverview
Figure 1. Overview of Diary Feature

Getting to Diary

Here’s a simple way to get into the diary feature!

Command: goto diary

Adding a diary

Let’s get started by adding a diary using the add diary command!

Command: add diary
Format: add diary n/ <diary name>

Example usage: add diary n/ Desserts Galore

Steps
  1. Enter the command in the command box and hit the Enter key. You are now adding a diary named "Dessert Galore" into DukeCooks.

    addDiary before
    Figure 2. Adding a diary
  2. If the command succeeds, you should see the following message in the result display and a new diary named "Dessert Galore" will be added.

    addDiary after
    Figure 3. Successfully added a diary
Diary names are only limited to 25 characters.

Deleting a diary

Accidentally created an unwanted diary? No worries! You can remove it with our delete diary command.

Command: delete diary
Format: delete diary <diary index>

Example usage: delete diary 8

Steps
  1. Enter the command in the command box and hit the Enter key. In this case, you are deleting the diary at index 8, which is "Dessert Galore".

    deleteDiary before
    Figure 4. Deleting a diary
  2. If the command succeeds, you will see the following message in the result display and the diary "Dessert Galore" will be removed.

    deleteDiary after
    Figure 5. Successfully deleted a diary

You may refer to this link for other diary commands that I have documented.

Contributions to Developer Guide

This section highlights my contributions to the Developer Guide for the diary feature. You may visit this link, to view the full Developer Guide.

Diary feature

Implementation

The current implementation of Diary consists of the following:

  • Each Diary consists of a unique DiaryName

  • Each Diary contains an array list of Page

  • Each Page is identified by a unique Title, PageType, Page Description and Page Image

  • Each class has their respective getter methods

The class diagram below gives an overview of the Diary class.

DiaryClassDiagram
Figure 6. Diary Class Diagram

Implementation of diary commands

Diary class supports multiple commands. It includes:

  • AddDiaryCommand - Adds a Diary into DukeCooks

  • DeleteDiaryCommand - Deletes a Diary from DukeCooks

  • EditDiaryCommand - Edits the specified Diary with a new DiaryName

  • ViewDiaryCommand - Views the specified Diary using the provided index

  • FindDiaryCommand - Finds the specified Diary using the provided keyword

  • ListDiaryCommand - Lists all available diaries to user

  • AddPageCommand - Adds a new Page to the specified Diary

  • DeletePageCommand - Deletes the Page in the specified Diary

  • EditPageCommand - Edits various fields of the specified Page

All the above commands behave similarly. The commands will be parsed in DukeCooksParser first and based on their types (i.e Add, Delete, Edit etc), the corresponding variant parsers will be invoked (i.e AddDiaryCommandParser, DeleteDiaryCommandParser etc). After which, the corresponding command will be executed (i.e AddDiaryCommand, DeleteDiaryCommand etc).

The figure below describes the execution of an DeleteDiaryCommand.

DeleteDiarySequenceDiagram
Figure 7. Sequence Diagram of DeleteDiaryCommand

 
After a successful execution, the specified diary will be removed.

Implementation of Images

All images used in DukeCooks are copied into an internal data folder and all subsequent loading of images is done from within this internal folder. The following activity diagram explains how an image is created in DukeCooks:

ImageActivityDiagram
Figure 8. Activity diagram of adding images

Design Considerations

Aspect Option 1 (Chosen) Option 2

Data structures used to store Page

Page objects are stored using an ArrayList

Pros
Simplest implementation and most novice programmers are familiar with it.

Cons
List operations tend to run slower as compared to other data structures such as sets.

Our Choice
This choice was chosen as we require the Page objects to be ordered, which is a functionality only provided in lists. In addition, the ordered Page objects greatly simplify the implementation of other commands such as DeletePageCommand as an page index can simply be provided to execute the command.

Page objects are stored using Sets

Pros
Faster runtime.

Cons
Sets do not provide an order to the Page objects.

Loading of images

Defensively copies images into our internal data folder and all subsequent loading of images is done from this folder.

Pros
Less prone to user errors when loading images. (i.e when user deletes image from their local directory)

Cons
Increased memory usage as each image needs to be saved internally.

Our Choice
This choice was chosen as it is less-prone to user errors and is safer.

Load images directly from user’s directory

Pros
Easy to implement.

Cons
May lead to unexpected errors when loading images. (i.e when user deletes image from their local directory)