PROJECT: ExerHealth


Overview

ExerHealth is a desktop application used for tracking and scheduling the user’s exercises. The user interacts with it using a CLI, and it has a GUI created with JavaFX. It is written in Java, and has about 10 kLoC.

Summary of contributions

  • Major enhancement: added the ability to undo/redo previous commands

    • What it does: allows the user to undo all previous commands one at a time. Preceding undo commands can be reversed by using the redo command.

    • Justification: This feature improves the product significantly because a user can make mistakes in commands and the app should provide a convenient way to rectify them.

    • Highlights: This enhancement affects existing commands and commands to be added in future. It required an in-depth analysis of design alternatives. The implementation too was challenging as it required changes to existing commands.

    • Credits: {mention here if you reused any code/ideas from elsewhere or if a third-party library is heavily used in the feature so that a reader can make a more accurate judgement of how much effort went into the feature}

  • Minor enhancement: added a history command that allows the user to navigate to previous commands using up/down keys.

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

  • Other contributions:

    • Project management:

      • Managed releases v1.3 - v1.5rc (3 releases) on GitHub

    • Enhancements to existing features:

      • Updated the GUI color scheme (Pull requests #33, #34)

      • Wrote additional tests for existing features to increase coverage from 88% to 92% (Pull requests #36, #38)

    • Documentation:

      • Did cosmetic tweaks to existing contents of the User Guide: #14

    • Community:

      • PRs reviewed (with non-trivial review comments): #12, #32, #19, #42

      • Contributed to forum discussions (examples: 1, 2, 3, 4)

      • Reported bugs and suggestions for other teams in the class (examples: 1, 2, 3)

      • Some parts of the history feature I added was adopted by several other class mates (1, 2)

    • Tools:

      • Integrated a third party library (Natty) to the project (#42)

      • Integrated a new Github plugin (CircleCI) to the team repo

{you can add/remove categories in the list above}

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.

Delete health information : delete

Deleting exercise information

Deleting a certain exercise information from ExerHealth.

Format: delete t/exercise i/INDEX

  • Deletes the exercise at the specified INDEX.

  • The index refers to the index number shown in the displayed exercise list.

  • The index must be a positive integer 1, 2, 3, …​

Examples:

  • delete t/exercise i/2

deleteExerciseBefore

Expected result:

deleteExerciseAfter

Deleting exercise from scheduling regime

Deletes exercises from a certain scheduling regime.

Format: delete t/exercise n/REGIME_NAME [i/INDEX]…​

  • Deletes the exercise at the specified INDEX.

  • If index is not provided, the command deletes the entire scheduling regime

  • The index refers to the index number shown in the displayed regime list.

  • The index, if provided, must be a positive integer 1, 2, 3, …​

Examples:

  • delete t/regime n/cardio i/2
    Deletes the exercise indexed 2 in the cardio regime

  • delete t/regime n/legs
    Deletes the entire regime named legs

Clearing all entries : clear

Clears all entries from the exercise tracker.
Format: clear

Display statistics : stats

Display the statistics of exercises.

Format: stats t/CAT_NAME h/CHART_TYPE [s/START_DATE] [e/END_DATE]

  • Supported chart types: Pie Chart, Line Chart, Bar Chart

  • Supported category: exercise, calories

  • If no START_DATE and END_DATE are provided, the recent 7 days of history will be used.

  • If any date is provided, both START_DATE and END_DATE dates must be there.

  • The maximum range between START_DATE and END_DATE is 31 days.

  • Only exercise with same name and unit will be counted as same exercise.

  • Exercise will appear as NAME (UNIT) in the charts. E.g Running (km). If it is too long (more than 18 characters), it will be formatted to first 10 characters plus last 8 characters.

    • For example, exercise Strength Training (counts) is more than 18 characters, it will be formatted to Strength T…​(counts).

  • It also includes total and average CATEGORY per day of exercises in the date range.

Figure below shows an example of pie chart.

PieChart
Due to space constraint, some labels may not appear. Labels can be seen when mouse cursor hovers over the pie chart.

Example:

  • stats t/exercise h/piechart

  • stats t/calories h/linechart

  • stats t/exercise h/barchart s/20/09/2019 e/27/09/2019

Undo previous command: undo

Undo the previous successful command entered.

Supported Undoable Commands: add, delete, edit, clear

Example:

  • add t/exercise n/Push ups d/1/10/2019 c/123 q/100 u/reps

  • add t/regime n/Cardio i/1 i/3 i/5

  • delete t/exercise i/7

  • edit t/exercise i/3 n/Push Ups c/140 m/Chest

  • clear

If there is no previous command, undo will do nothing.

Format: undo

Redo undone command: redo

Redo the previous command that was undone by user.

If there is no command has been undone after the latest undoable command, redo command will do nothing.

Format: redo

Scheduling exercises: schedule

Schedules a regime

Schedules an exercise regime for a certain date. If the regime clashes with another scheduled regime, you will be prompted to resolve the conflict via a popup window. Refer to Resolving scheduling conflicts: resolve for details on resolving scheduling conflicts.

Format: schedule n/REGIME_NAME d/DATE

  • To schedule a regime, REGIME_NAME must exist in your regime list. You can use list t/regime command to view the regimes that you currently have.

  • The format of DATE must be of the form dd/MM/YYYY. For example, 12/12/2019 or 01/01/2020. Even if the number has only one digit, please ensure you include a 0 at the front to ensure that it adheres to the format required.

  • You will not be allowed to schedule a regime on a date that falls before the date displayed on your system clock

  • You are allowed to schedule a regime of the same name on the same date. The resolve window will pop up for you as per normal.

Example 1:

  • schedule n/cardio d/12/12/2019

Schedules the regime called cardio on the date 12/12/2019. If there are no other regimes scheduled on 12/12/2019 then the command is successful. Otherwise, you will be prompted to resolve the scheduling conflict.

Expected Result:

ScheduleRegimeCardio

Expected Result (if other schedule exist on 12/12/2019):

ScheduleRegimeCardioConflict

If the resolve window pops up for you, please refer to Resolving scheduling conflicts: resolve for details on resolving a scheduling conflict.

Completes a schedule regime

Once a scheduled regime is completed, you can add that completed schedule to the exercise tracker. The schedule is then deleted from the scheduling list.

Format: schedule i/INDEX_OF_SCHEDULE

The INDEX_OF_SCHEDULE provided must be a valid index from your schedule list. Please use list t/schedule to view you index of the schedule you wish to complete.

Example:

  • schedule i/2

Completes all the exercises that are in the schedule at index 2. All the exercises scheduled will be added to the exercise list and the schedule at index 2 is deleted.

Expected Result:

Before execution of schedule i/2

ScheduleCompleteBefore

In your exercise tracker

ScheduleCompleteExerciseTracker

In your schedule tracker after completing execution of schedule i/2

ScheduleCompleteScheduleTracker

Resolving scheduling conflicts: resolve

Described in the following two sections are two possible ways to resolve a scheduling conflict in the resolve window that pops up.

  • Once the resolve window pops up, you are not allowed to interact with the main ExerHealth window anymore. You are required to resolve the scheduling conflict before continuing to use the application as normal.

  • Any valid commands that are not resolve will not get executed in the resolve window. Only the resolve command is allowed in the resolve window.

Taking one of the regimes completely

Takes the scheduled regime or the conflicting regime completely and discarding the other. Neither regimes will be deleted from the user’s collection.

Format: resolve n/SCHEDULED_OR_CONFLICTING

You can only enter n/scheduled or n/conflicting to tell ExerHealth which schedule you wish to take. The scheduled or conflicting regimes are stated at the top of the list of exercises as shown below.
ResolveScheduledOrConflicting

Example:

  • resolve n/scheduled

Takes the already scheduled regime and schedule it at conflicting date.

Expected Result:

The resolve window and inputting the example command

ResolveScheduled

Once resolve window closes, the scheduled regime should be taken and scheduled at the correct date.

ResolveScheduledResult

Taking some exercises from both regimes

Takes some exercises from the scheduled regime and some from the conflicting regime to make a brand new regime. The new regime will be scheduled at the date of conflict. This new regime will also be added to your collection of regimes.

Format: resolve n/NEW_REGIME_NAME [i/INDEX_OF_EXERCISE_IN_SCHEDULED] [r/INDEX_OF_EXERCISE_IN_CONFLICTING]

  • Takes the exercise at the specified indexes of i/ and r/

  • NEW_REGIME_NAME must be a new name that does not exist in your collection of regimes

  • The index refers to the index number shown in the displayed resolve window

  • The index must be a positive integer 1, 2, 3, …​

  • i/ is for index of the scheduled regime

  • r/ is for index of the conflicting regime

  • At least one i/ or r/ must exist in your input for this command to succeed. Otherwise, ExerHealth will think you are trying to take one regime completely as stated in the previous section.

Example:

  • resolve n/new cardio i/1 r/4 r/2

Expected Result:

Takes exercise 1 from scheduled regime and exercises 2 and 4 from conflicting regime and adds them to a new regime called new cardio

ResolveTakeOneOrOther

The new cardio regime is now scheduled at the conflicting date with the new exercises that have been resolved.

ResolveTakeResolved

The new cardio regime is now added to your collection of regimes

ResolveRegimeTracker

Suggesting ideas: suggest

Suggest basic exercises

Recommends exercises from ExerHealth’s inbuilt database for beginners.

Format: suggest s/basic

Suggest possible exercises

Suggests exercises matching specified tags.

Based on matching muscle tags

Format: suggest s/possible o/OPERATION_TYPE [m/MUSCLE CUSTOM_PROPERTY_PREFIX_NAME/VALUE]

  • You must choose one of the following operation type: and, or.

  • i.e commands such as suggest s/possible m/Chest m/Legs will fail whereas suggest s/possible o/or m/Chest m/Legs will succeed.

  • You have to enter at least one property (muscle/custom property) to search for suggestions.

  • i.e commands such as suggest s/possible o/and and suggest s/possible o/or will both fail whereas suggest s/possible o/or m/Chest will succeed.

  • The operation type is optional if there is only one tag provided

  • i.e commands such as suggest s/possible o/and m/Chest, suggest s/possible o/or m/Chest and suggest s/possible m/Chest will all achieve the same outcome - display all the exercises tagged with "Chest" in the exercise tracker and ExerHealth’s database.

Based on matching custom properties

Similar to matching muscles tags, you can search for suggestions with matching custom property tags.

After creating Custom Properties and tracking exercises, you can search for suggestions with those custom properties.

Example: Suppose you have created a new Custom Property and have been tracking a few exercises with said custom property:

custom s/r f/Rating p/Number

add t/exercise n/Run d/02/11/2019 c/200 q/10 u/km m/Legs r/8

add t/exercise n/Bench Press d/05/11/2019 c/150 q/40 u/kg m/Chest r/8

Then, the following input will display a list of exercises which are tagged with "Chest" and have a rating of 8.

suggest s/possible o/and m/Chest r/8

Thus the command will display only the exercise named "Bench Press".

Expected Result:

suggestPossibleAfter1

The input, suggest s/possible o/or m/Chest r/8, however, will display a list of exercises with "Chest" or have a rating of 8.

suggestPossibleBefore2

Expected Result:

suggestPossibleAfter2

As seen on the image above, the two previously added exercises named "Bench Press" and "Run" are displayed because they each have a rating of 8. In addition to the tracked exercises, ExerHealth will also display suggestions in its database. Hence the exercise named "Push Ups" is displayed as it has a "Chest" muscle tag.

Duplicates

Sometimes, you may track exercises of the same name. Instead of displaying all suggestions of the same name, this function display the information of the most recently tracked exercise of that name.

suggestPossibleBefore3

Expected Result:

suggestPossibleAfter3

As seen on the image above, the tracked exercise named "Bench Press" on "06/11/2019" is displayed instead of the one on "05/11/2019".

Notes:

  • Suggestions from the database have dates displayed refer to the last time ExerHealth’s database was updated.

Custom properties

Adding custom properties: custom

Adds in a custom property which you can define for the exercises.

Once a new custom property is created, you can simply use the prefix name which you defined for the property to the add and edit command to include information for the new property.

  • The prefix name can only contain alphabets and should not contain spaces.

  • You must choose exactly one of the following as the parameter type for your custom property: Text, Number, Date.

  • Every word in the full name of each custom property will be changed to Start Case style, where the first letter of each word is capitalised with the other letters in lower case e.g. enD DaTe will be changed to End Date.

  • The date entered for the custom properties must follow the same requirements as that of add command.

  • You need not include the custom properties when adding a new exercise to the app.

Format: custom s/PREFIX_NAME f/FULL_NAME p/PARAMETER_TYPE

The following names and prefix names have been used for existing add / edit command parameters and properties and so, cannot be used.

Names used

Prefix names used

Name

n

Date

d

Calories

c

Quantity

q

Unit

u

Muscle

m

-

t

-

i

Example:

  • custom s/a f/Rating p/Number

Creates a Rating property for each exercise. Information for this property can be updated for each exercise by using a/NUMBER in the relevant command where NUMBER refers to a number.

  • custom s/b f/rEmaRk p/Text

Creates a Remark property for each exercise. Information for this property can be updated for each exercise by using b/TEXT in the relevant command where TEXT refers to a text sentence.

  • custom s/ed f/End Date p/Date

Creates a End Date property for each exercise. Information for this property can be updated for each exercise by using ed/DATE in the relevant command where DATE refers to a date.

Using Rating as an example, you can now perform the following actions after adding it:

  • add t/exercise n/Run d/01/10/2019 a/5

Adds an exercise with the name Run, date 01/10/2019 and rating 5 into the app.

  • edit t/exercise i/4 a/3

Edits the rating of the 4th exercise in the list to 3.

Removing custom properties: custom

Removes a custom property which you have previously defined either from a single exercise or from ExerHealth.

In the second case, you will still be able to add back the deleted custom property if you wish to.

  • FULL_NAME denotes the name of the previously defined custom property.

  • The index, if provided, must be a positive integer 1, 2, 3, …​

Format: custom rm/FULL_NAME [i/INDEX]

Example:

  • custom rm/Rating

Removes the custom property Rating from all of the exercises and from ExerHealth.

  • custom rm/Rating i/1

Removes the custom property Rating from the 1st exercise in the list.

Viewing custom properties: viewcustom

Opens up a window for you to view the custom properties you have defined. The name, prefix and parameter type of all existing custom properties will be shown.

Format: viewcustom

Example:

  • viewcustom

Opens up a window containing information of all existing custom properties.

Exiting the program : exit

Exits the program.
Format: exit

Saving the data

ExerHealth data are saved in the hard disk automatically after any command that changes the data.
There is no need to save manually.

Suggest intensity [Coming in v2.0]

Suggesting the amount of repetitions to complete for exercises.

Remind to do exercises [coming in v2.0]

Reminds you to do exercises.

Autocomplete of commands [coming in v2.0]

Autocompletes the commands while typing.

Importing data [coming in v2.0]

Imports data to update inbuilt database of exercises.

Encrypting data files [coming in v2.0]

Allows you to encrypt your data files for more security.

FAQ

Q: How do I transfer my data to another Computer?
A: Install the app in the other computer and overwrite the empty data file it creates with the file that contains the data of your previous ExerHealth folder.

Command Summary

  • Add exercises : add t/exercise n/EXERCISE_NAME d/DATE c/CALORIES q/QUANTITY u/UNITS [m/MUSCLE]…​
    e.g. add t/exercise n/Bench press d/19/09/2019 c/500 q/50 u/reps m/Chest

  • Add regimes : add t/regime n/REGIME_NAME [i/INDEX_OF_EXERCISE]…​ e.g. add t/regime n/Cardio i/1 i/2 i/3

  • List : list t/LIST_TYPE e.g. list t/exercise

  • Select : select t/LIST_TYPE i/INDEX e.g. select t/exercise i/1

  • Edit exercise : edit i/INDEX [n/EXERCISE_NAME] [d/DATE] [c/CALORIES] [q/QUANTITY] [u/UNITS] [m/MUSCLE]…​ ` e.g. `edit i/3 n/Bench press d/22/09/2019 c/240 q/10 u/sets m/Chest

  • Delete exercise : delete t/exercise i/INDEX e.g. delete t/exercise i/2

  • Delete regimes : delete t/regime n/REGIME_NAME e.g. delete t/regime n/Cardio

  • Delete exercise from regime : delete t/regime n/REGIME_NAME [i/INDEX_OF_EXERCISE]…​ e.g. delete t/regime n/Cardio i/1 i/2

  • Clear : clear

  • Help : help

  • Stats : stats t/CAT_NAME h/CHART_TYPE [s/START_DATE] [d/END_DATE] e.g. stats t/exercise h/barchart s/20/09/2019 e/27/09/2019

  • Undo : undo

  • Redo : redo

  • Schedule : schedule n/REGIME_NAME d/DATE e.g. schedule n/cardio d/12/12/2019

  • Complete Schedule : schedule i/INDEX_OF_SCHEDULE e.g. schedule i/2

  • Resolve(Take one regime) : resolve n/SCHEDULED_OR_CONFLICTING e.g. resolve n/scheduled, resolve n/conflicting

  • Resolve(Take some exercise from both regime) : resolve n/NEW_REGIME_NAME [i/INDEX_OF_SCHEDULED_EXERCISE] [r/INDEX_OF_CONFLICTING_EXERCISE] e.g. resolve n/new cardio i/1 i/3 r/2

  • Suggest basic : suggest s/basic

  • Suggest possible : suggest s/possible [o/OPERATION_TYPE] [m/MUSCLE]…​ [CUSTOM_PROPERTY_PREFIX/VALUE]…​ e.g. suggest s/possible m/Legs, suggest s/possible o/and m/Chest m/Leg

  • Add custom property : custom s/PREFIX_NAME f/FULL_NAME p/PARAMETER_TYPE e.g. custom s/ed f/End Date p/Date

  • Remove custom property : custom rm/FULL_NAME [i/INDEX] e.g. custom s/End Date i/1

  • View custom property : viewcustom

  • Exit : exit

Encrypting data files [coming in v2.0]

Allows you to encrypt your data files for more security.

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.

PROJECT: PowerPointLabs


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