PROJECT: HealthyBaby


Overview

HealthyBaby (HYBB) is a desktop application targeted towards university students that provides users with a database of quick, easy, and healthy recipes. HYBB helps alleviate the challenges faced while maintaining healthy eating habits, easing the transition from eating out everyday to cooking healthy meals regularly.

The user interacts with HYBB using a Command Line Interface, and it has a Graphical User Interface created with JavaFX.

It is written in Java, and has about 18 kLoC.

Summary of contributions

  • Major enhancement: added the ability to add quotes

    • What it does: allows the user to input their own customised quotes as long as it abides by the message constraints so that they can choose to display quotes to their own liking at the quotes section in the achievement tab.

    • Justification: This feature improves the product significantly because it provides motivation for the user to continue their healthy diets as users tend to lose their motivations for keeping their diets consistently. By allowing users to input their own quotes it does not restrict the users to the predetermined few default quotes.

    • Highlights: This enhancement affected the current data structure used to contain the quotes and required a modifiable file to allow users to input their own quotes. The implementation was more challenging as there has to be checks conducted to ensure that duplicate quotes are rejected and quotes do not violate the stated format.

    • Credits: {}

  • Major enhancement: added the ability to display streaks

    • What it does: allows the user to keep track of whether they’re cooking the recipes consistently and to also check what were their highest streaks.

    • Justification: This feature improves the product significantly because it provides a visual and statistical view of the user’s progress and it is updated real time as the user logs in cooked recipes. As both current and high streaks are displayed, it provides visual motivation for the users to not break their streaks.

    • Highlights: This enhancement requires data from CookedRecord, another part of the program that is largely unaffiliated wit streaks which made it challenging to link their data together. The algorithm for calculating both the current streak and highest streak from the CookedRecord list provided was also more challenging as the history of cooked recipes had to be take into consideration highest streak.

    • Credits: {}

  • Minor enhancement: contributed to the help command that allows the user to view the commands available.

  • Minor enhancement: Created SampleDataUtil(and recipes json) file containing the default recipe.

  • Code contributed: [Functional code] [Test code] {give links to collated code files}

  • Other contributions:

    • Project management:

      • Checked Checkstyles

    • Enhancements to existing features:

      • Updated GUI for achievement tab (Pull requests #200),

      • Added highest streak function (Pull requests #203)

    • Documentation:

      • Did tweaks to existing contents of the User Guide: #12)

    • Community:

      • Contributed to forum discussions (question: 99),

    • Tools: -

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.

QuotesTab
Figure 1. Achievement tab

Display streak: streak [Coming in v2.0]

Displays line chart of all logged streaks by user Format: streak

Remove quote: remove quote [Coming in v2.0]

Removes quote indicated by user
Format: remove quote [quote]

Remove quote: change quote [Coming in v2.0]

Changes currently displayed quote to a new randomised one
Format: change quote

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.

Quote Command (Yue Tong)

The quote command feature uses the quote command for users to input their own quotes to add on to the existing set of quotes that is already in the database. This allows the users to add in customised quotes that would suit their preferance more if the current list of quotes is not to their liking.

The following sequence diagram illustrates how the QuoteCommand is used.

QuoteSequenceDiagram
Figure 2. Quote command sequence diagram
The lifeline for EditCommandParser should end at the destroy marker (X) but due to a limitation of PlantUML, the lifeline reaches the end of diagram.
Undo button currently does not work for adding of quotes as there is no remove function currently implemented for quote ==== Implementation

This section explains how the quote command is implemented.

  1. User specified arguments are passed to the QuoteCommandParser#parse which will then parse the user input to verify if the quote field is empty. An error is thrown if the user had keyed in an empty field for quote.

  2. A new QuoteCommand object will be created with a Content field to store the quote and returned to the LogicManager

  3. The QuoteCommand#execute method is executed and Model#addQuote is called. This attempts to add the quote to the database and verify if any duplicate quote exists in the database via Model#hasQuote. If a duplicate quote is detected in the database, an error will be thrown to indicate that the quote already exists in the database.

  4. Once the quote has been successfully updated to the database, the result window informs the user that the quote has been successfully added.

The following activity diagram further illustrates how the QuoteCommand is used.

QuoteActivityDiagram
Figure 3. Quote command activity diagram

Design Considerations

Aspect: How quote command executes
  • Alternative 1 (current choice): The QuoteCommand only accepts adding of quotes

    • Pros: Maintaining the database for quotes is easier

    • Cons: Users will not be able to remove a quote if it is not to their liking and undo function does not work for quote command

  • Alternative 2: The QuoteCommand accepts both adding and removal of quotes

    • Pros: Users can customize whicher quotes they want to be displayed

    • Cons: If they user deletes the quote that is on display for Quote of the Day in the Achievement tab, this could cause display problems and as UniqueQuotesList is a hidden list, users will have to type out the quote completely similar in order to locate it

Streak feature(Yue Tong)

The Streak feature mainly deals with keeping track of the cooked meals that the user has logged into the system. The command that Streak is associated with is CookedCommand as every user input of cooked will result in the streak log to be reflected when cooked is executed. The changes are reflected in two main attributes, Current streak and High streak.

The following sequence diagram illustrates how the QuoteCommand is used.

StreakActivityDiagram
Figure 4. Quote command sequence diagram

Implementation

The streak feature uses data from the UniqueRecordList to parse through the recipes that the user has already cooked and extract the dates from these recipes to determine the current streak for the user and the highest streak score the user has attained as of yet.

The UniqueRecordList provides Streak with an observableList so that a listener could be added to it to make sure that the streak always auto-updates whenever a new CookedRecord is added in to the database. Via the addListener, whenever a new record is detected, the streaks are calculated again through parsing of the CookedRecords list and updated in real time in the achievement tab.

Design Considerations

Aspect: How streak is stored
  • Alternative 1 (current choice): Streak is calculated and updated via access to UniqueRecordList

    • Pros: Easier to access CookedRecord list when there is direct access to UniqueRecordList and to update in real time

    • Cons: There is more co-dependency among classes and there may be performance issues if UniqueRecordList is too large

  • Alternative 2: Streak has its own database and json file to keep track of streaks

    • Pros: Lesser time is required to re-calculate streaks every time a cookedRecord is updated as streak can just be added and subtracted from its recorded data in the database

    • Cons: A database section will be dedicated to just storing one number and without access to the UniqueRecordsList it is harder for Streak to be updated realtime when cookedRecord is updated.

Aspect: How streak is calculated
  • Alternative 1 (current choice): Accumulative streaks is calculated based on whether there is a 1-day difference between 2 consecutive cooked recipes

    • Pros: Easier to compute compared to implementing via a midnight deadline basis to calculate accumulative streaks

    • Cons: Streaks are not necessarily accounted for within a 24-hour period

  • Alternative 2: Accumulative streaks is calculated based on a stricter within 24-hour new logged cooked recipes

    • Pros: The accountability is higher for users to actually accomplish their streaks by having to cook recipes within a 24-hour period and not be able to go for more than a day without cooking new recipes without having their streaks jeopardised.

    • Cons: It is easier for users to lose their streaks and more difficult for users to ascertain when is the deadline to maintain their streaks

PROJECT: PowerPointLabs


{Optionally, you may include other projects in your portfolio.}