PROJECT: CookBuddy


Overview

CookBuddy is a desktop recipe manager for students staying in university accommodation who enjoy cooking. They can interact with it through a Command Line Interface (CLI), and it has a Graphical User Interface (GUI) created with JavaFX. It is written in Java, and has about 10 kLoC.

Summary of contributions

  • Major enhancement: added the ability to favourite/un-favourite recipes

    • What it does: allows the user to favourite or un-favourite a recipe. A recipe is marked as not favourited by default, but the user can change this using the fav command. If a user wants to un-favourite a recipe, they may do so using the unfav command.

  • Major enhancement #2: implemented the view command

    • What it does: allows users to view any recipe on the GUI. Before this feature was implemented, the displayed recipe would always be the first recipe added in the application.

  • Minor enhancement: Added the done and undo features, which behave similarly to the fav and unfav commands. They are used to mark recipes as attempted and not attempted, respoectively.

  • Minor enhancement #2: implemented the time command

    • What it does: allows users to assign a time to a recipe. Users may exclude hours and seconds when inputting the time, and these fields will be set to 0 if they are omitted.

  • Code contributed: [Code Contribution]

  • Other contributions:

    • Project management:

      • Managed releases v1.1 - v1.4 (4 releases) on GitHub

    • Enhancements to existing features:

      • Updated the GUI color scheme Pull Request #71

      • Wrote additional tests for existing features to increase coverage from 27% to 51%: Pull requests #299, #300

    • Documentation:

      • Did many changes to the User Guide and Developer Guide: Pull Requests #20, #22, #89, #193, #327 as well as many more.

    • Community:

      • Approved many team-members PRs, often providing feedback if it did not meet standards.

      • Contributed to forum discussions

      • Created the vast majority of the issues on the Issue Tracker here

    • Tools:

      • Integrated Codacy as well as Coveralls.

Contributions to the User Guide

Given below are sections I contributed to the User Guide. They showcase my ability to write documentation targeting end-users.

Favouriting a recipe — fav [Done by: Adarsh Chugani]

You can favourite an existing recipe from CookBuddy using the fav command.

Format: fav INDEX

  • INDEX must be a positive integer value, within range of the number of recipes in CookBuddy.

  • A favourited recipe is indicated by a red filled heart.

Example: You can type fav 1 and CookBuddy will favourite the recipe at index 1.

Coming in v2.0 [Done by: Adarsh Chugani]

Look forward to these features coming up in version 2.0 of CookBuddy!

Adding price (coming in v2.0): price

Adds the price attribute to recipes. With this, to can assign every recipe a specific price.

Format: price INDEX PRICE

Inputs from user:

  • INDEX: the index of the recipe you wish to assign a price to

  • PRICE: the price that you wish to assign to the recipe (accepts both integer and decimal values)

Example: price 1 10.50

This would assign the recipe at index a price of $10.50

Viewing statistics (coming in v2.0): stats

Format: stats

Displays your statistics: such as percentage of recipes attempted, difficulty breakdown of attempted recipes, amongst many others. With this feature, you will be able to analyse your cooking preferences!

Suggestions (coming in v2.0): suggest

Format: suggest

This feature suggests a recipe from your CookBuddy application for you to attempt. You will be suggested a recipe based on your statistics, namely the difficulty and ratings of the recipes you have attempted. The suggested recipe is more likely to be a recipe that you have not attempted, as we do not want you to constantly cook the same recipes. Additionally, the suggested recipe is more likely to have a difficulty similar to, or slightly higher than the recipes you have attempted, as we want you to grow as a budding cook!

Scale the recipe (coming in v2.0): scale

This feature scales a recipe to your intended size. The quantities of the ingredients used, as well as the prep time required will be adjusted for your use.

Format: scale INDEX SIZE

Inputs from user:

  • INDEX: The index of the recipe you wish to scale

  • SIZE: The size that you wish to scale the recipe to

Example: scale 1 3

This would scale the recipe at index 1 to be able to serve 3 people.

Import and export (coming in v2.0): import, export

Import a file: import

Imports recipes from the file at the given path.

Format: import PATH

Inputs from user:

  • PATH: the file path at which the desired file is

Example: import "/docs/recipebook.json"

This would import the "recipebook" JSON file from the docs folder.

Export transactions: export

Exports all transactions to the given path.

Format: export PATH

Inputs from user:

  • PATH: the file path at which the desired file is

Exports the recipes from cookbuddy into the given path

Example: export "/docs/"

This would export the recipes from CookBuddy into a file in the docs folder.

Printing (coming in v2.0): print

Prints out the recipe.

Format: print INDEX

Key-Words: * INDEX: the index of the recipe you wish to print.

Example: print 1

This would print out the recipe at index 1.

Sharing Recipes (coming in v2.0): share

Prints out the recipe.

Format: share INDEX SITE

Key-Words: * INDEX: the index of the recipe you wish to share.

  • SITE: the website you wish to share the recipe to

Example: share 1 facebook

This would share the recipe at index 1 on the user’s facebook account.

Contributions to the Developer Guide

Given below are sections I contributed to the Developer Guide. They showcase my ability to write technical documentation and the technical depth of my contributions to the project.

Favouriting recipes [Adarsh]

The following section describes how the fav command is implemented as well as design considerations that were taken into account during its implementation. Some possible future improvements are also suggested to improve the functionality of the fav command.

The fav command is implemented in the FavCommand class.

The following activity diagram shows the possible paths CookBuddy can take when a fav command is run.

FavActivityDiagram
Figure 1. Activity diagram of the fav command

Implementation

  1. When entering the fav command, the user will specify the index of the recipe to be favourited.

  2. FavCommandParser ensures that index specified is valid and returns a FavCommand.

The following sequence diagram summarizes the execution of the fav command

FavSequenceDiagram
Figure 2. Sequence diagram for the execution of a fav command

Design Considerations

Aspect: How many indexes should be taken in?
  • Alternative 1 (Chosen): Only 1 index to be specified per use of the command

    • Pros: Less error-prone

    • Cons: Less efficient

  • Alternative 2: Multiple indexes can be specified per use of the command

    • Pros: More efficient

    • Cons: More error prone

Possible improvements

In the current implementation, you are able to favourite recipes, even if they have already been favourited. A possible improvement would be to notify users if the recipe they are trying to favourite has already been favourited. This would greatly enhance the usefulness of the fav function in CookBuddy.

Assigning a time to a recipe [Adarsh]

The following section describes how the time command is implemented as well as design considerations that were taken into account during its implementation. Some possible future improvements are also suggested to improve the functionality of the time command.

The time command is implemented in the TimeCommand class.

The following activity diagram shows the possible paths CookBuddy can take when a time command is run.

TimeActivityDiagram
Figure 3. Activity diagram of the time command

Implementation

  1. When entering the time command, the user will input the index of the recipe they wish to assign a time, as well as the time they wish to assign to the recipe. The time is to be in the following format (hh:MM:ss). Minutes and seconds are optional, and would be set to 0 if no values are provided for them.

  2. TimeCommandParser ensures that index specified is valid and returns a TimeCommand.

The following sequence diagram summarizes the execution of the time command

TimeSequenceDiagram
Figure 4. Sequence diagram for the execution of a time command

Design Considerations

Aspect: Should the minutes and seconds be mandatory inputs
  • Alternative 1 (Chosen): No, they can be optional inputs

    • Pros: More efficient

    • Cons: -

  • Alternative 2: Yes, they should be mandatory inputs

    • Pros: -

    • Cons: Much less efficient

Possible improvements

In the current implementation, we are parsing the hours, minutes and seconds as integers. A possible improvement would be to use the java.util.time class.

Viewing recipes [Adarsh]

The following section describes how the view command is implemented as well as design considerations that were taken into account during its implementation. Some possible future improvements are also suggested to improve the functionality of the view command.

The view command is implemented in the ViewCommand class.

The following activity diagram shows the possible paths CookBuddy can take when a view command is run.

ViewActivityDiagram
Figure 5. Activity diagram of the view command

Implementation

  1. When entering the view command, the user will specify the index of the recipe that they wish to view.

  2. ViewCommandParser ensures that index specified is valid and returns a ViewCommand.

The following sequence diagram summarizes the execution of the view command

ViewSequenceDiagram
Figure 6. Sequence diagram for the execution of a view command

Design Considerations

Aspect: How should the user specify the recipe they want to view
  • Alternative 1 (Chosen): Using the index of the recipe

    • Pros: Easily identified from the GUI

    • Cons: -

  • Alternative 2: Using the name of the recipe

    • Pros: Users may know the name of the recipe better than the index

    • Cons: Less efficient

Possible improvements

In the current implementation, the view command only takes in the index of the recipe. A possible improvement would be to allow users to input the recipe name they want viewed. That way, users can input either the recipe name or index.

PROJECT: PowerPointLabs