Overview
FitBiz is a fitness business management application, specially created for fitness coaches to manage their clients. It is a platform where coaches can store his clients' information, exercises done and weekly training schedule. FitBiz is primarily a desktop application where the user interacts with the program via the Command Line Interface (CLI), and views data via the Graphical User Interface (GUI). This project is written in Java 11, packaged using Gradle, and uses JavaFX for the GUI.
Summary of contributions
-
Major enhancement: added the filter feature which allows user to filter and display the clients list using client’s
Tag
andSport
-
What it does: Allows user to filter through his list of clients using
Tag
orSport
keywords and return clients that haveTag
orSport
matching all of the keywords specified. -
Justification: Allows user to group and view clients based on their
Tag
or theSport
they play, which is a convenient way of looking at similar groups of client when planning exercises or scheduling clients with similar needs to train as a group. This increases the efficiency of viewing clients from a long list based on their attributes and to find clients'INDEX
to view their information. -
Highlights: Provides a simple yet important way of grouping and viewing clients from the list. The implementation was done in such a way that makes it easy to expand to filter all attributes of clients allowing user to make training plans more robust. Future expansion plan includes the abilities to filter clients by ranges of their current and target weight to group those with similar needs and filter by address to allow user to schedule clients living near each other on the same day.
-
-
Major enhancement: helped to build the foundation of schedule feature
-
What it does: Allows user to add and view the training schedule of clients
-
Justification: Users will be able to add, store and view clients schedule and therefore eliminating the need to use another application for the same purpose. This increases the efficiency of users while planning for clients' trainings as the schedule, exercise history and information can all be viewed in the same page.
-
Highlights: We have essentially created a mini version of a calendar app that is simple yet maintain the important functionalities to add training schedules and display them in a weekly view. Many real life conditions for the training schedule added such as overlapping training time, whether to allow backlogging of training dates and clients having same training time have been resolved through multiple trials and discussions.
-
-
Minor enhancement: added
Sport
attribute toClient
-
Code contributed: [RepoSense]
-
Other contributions:
-
Enhancements to existing features:
-
Documentation:
-
Community:
-
Contributions to the User Guide
Given below are the sections I contributed to the User Guide. They showcase my ability to write documentation targeting end-users. |
Add a new client profile: add-c
--- Toh Ker Wei
After setting up the program, the first thing you might want to do is to add your client to FitBiz. You can do so by using the add-c
command, followed by the details of your client.
Format: add-c n/NAME p/PHONE_NUMBER e/EMAIL a/ADDRESS [g/GENDER] [b/BIRTHDAY] [h/HEIGHT] [cw/CURRENT_WEIGHT] [tw/TARGET_WEIGHT] [r/REMARK] [s/SPORT]… [t/TAG]…
Parameters
This section summarises the format and important information to note while using the add-c
command.
Parameters | Important points to note |
---|---|
|
* Substitute * * |
|
* Substitute * * * |
|
* Substitute * * * * |
|
* Substitute * * |
|
* Substitue * * * |
|
* Substitue * * * * |
|
* Substitute * * * |
|
* Substitute * * * |
|
* Substitue * * * |
|
* Substitute * * Sports given in this command will overwrite all of the client’s existing sports. * |
|
* Substitue * * Tags given in the command will overwrite the Client’s existing tags * You can remove all of the client’s tags by typing * |
|
* Substitute * * Any whitespace at the start of * |
*The set of special characters are !#$%&'*+/=?
{|}~^.-`
Example
Lets say you want to add a new client with the following details:
Name: Amanda Low
Phone number: 95436543
Email: AmandaLow@dmail.com
Address: West Coast Grove 69
Birthday: 5 April 1990
Sport: Swimmer
Tag: Vegetarian
-
Type the command below into the command box.
-
add-c n/Amanda Low p/95436543 e/AmandaLow@dmail.com a/West Coast Grove 69 s/Swimmer t/Vegetarian
-
-
Press enter to execute.
-
After Amanda has been successfully added to the clients list, the result will be displayed as shown.
Common errors/ problems:
If you are facing errors or difficulty adding a client, you can refer to the common errors and problems listed below and resolve your error using the solution given.
-
Compulsory fields missing
If you are adding a client and miss out any of the compulsory parameters. You will not be able to add the client.
For example, when you want to add a
Rachel Tan
into FitBiz but did not include the compulsory fielda/ADDRESS
After pressing enter, the following error message will be shown.
To solve this error, ensure that all compulsory parameters are included when adding a client. The compulsory parameters include:
n/NAME
,p/PHONE
,e/EMAIl
anda/ADDRESS
. To continue with the same example, the command will now include Rachel’s address.The result of successfully adding Rachel will show the following
-
Adding clients with the same phone number or email
In FitBiz, you cannot add 2 clients with the either same phone number or email.
For example, you have client with the email RachelTan@dmail.com
and you want to add another client with the same email.
The following error message will be shown.
To solve this issue, ensure that any new client you add does not have the same phone number or email as existing client.
Filter clients based on attribute: filter-c
--- Toh Ker Wei
When you have many clients and want to filter the list of clients to view a specific group, you can use the command filter-c
to filter clients based on their tags or their sports.
Format: filter-c [t/TAG]… [s/SPORT]…
Parameters
Parameter | Important notes |
---|---|
|
|
|
Order of words in |
Example
Let’s say you want to filter through your list of clients and only display those with the tag healthy
and play the sport badminton
.
-
Type the command
filter-c t/healthy s/badminton
into the command box. -
Press enter to execute.
-
The clients with the matching tag and sport will be displayed as shown.
Common error/ problem
Tags with spaces
When you want to filter the clients list with multiple tags like healthy
and sporty
, you might enter the command shown below.
You will then encounter the error Tags names should be alphanumeric
.
This error occurs because TAG
only accepts letters and numbers but not spaces. To solve the problem, add an additional delimiter for each tag you want to specify. Note that sports does not require multiple delimiter.
The list of successfully filter clients will then be displayed.
Contributions to the Developer Guide
Given below are the 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. |
Logic component
API :
Logic.java
-
Logic
uses theFitBizParser
class to parse the user command. -
This results in a
Command
object which is executed by theLogicManager
. -
The command execution can affect the
Model
(e.g. adding or deleting a client). -
The result of the command execution is encapsulated as a
CommandResult
object which is passed back to theUi
. -
In addition, the
CommandResult
object can also instruct theUi
to perform certain actions, such as displaying the list of clients or exercise graphs.
Given below is the sequence diagram for interactions within the Logic
component for the execute("delete-c 1")
API call mentioned previously.
delete-c 1
CommandFiltering the list of clients --- Toh Ker Wei
This feature allows users to filter the list of clients by specifying the Tag
or Sport
of the clients they want to view.
Implementation
This filtering mechanism is facilitated by TagAndSportContainsKeywordsPredicate
, that implements Predicate<Client>
which is a wrapper class for a boolean. FilterCommand
is associated with Model
is responsible for calling Model#updateFilteredClientList
based on TagAndSportContainsKeywordsPredicate
. TagAndSportContainsKeywordsPredicate
will call test
on Client
to check if the clients Tag
and Sport
contains all the keyword. the relations between these classes are shown in the class diagram below.
To further elaborate,
TagAndSportContainsKeywordsPredicate
contains 2 booleans:
-
hasTag
: evaluates if the client has all theTag
specified -
hasSport
: evaluates if the client has all theSport
specified
If there is no keyword specified for either Tag
or Sport
, the corresponding boolean will return true
. There must be at least 1 keyword specified, regardless of whether it is a Tag
or Sport
. TagAndSportContainsKeywordsPredicate
will then evaluate and return the logical addition of hasTag
and hasSport
.
In the following sequence diagram, we will be tracing the execution of the command filter t/obese s/swim
entered by the user.
Design Considerations
Using separate booleans to check for Tag and Sport keywords (Chosen) |
Using one boolean to check for all keywords | |
---|---|---|
Ease of Implementation |
Checks for client’s |
Simpler logic but errors are more difficult to pinpoint to either |
Ease of Expanding Feature |
Easier to add new parameters to filter since a separate check will be done before combining with the result of previous checks |
Boolean conditions can get very complex and logical error will be prone to occur |
We decided to use the first approach of checking if the client contains Tag
specified and Sport
specified separately.
Firstly, by separating the checks for each attributes, a correct implementation of checking Tag
against the keywords will allow us to easily duplicate the logic to be done for Sport
. This makes the code easier to debug as we can simply check the hasAttribute boolean to see if it gives the correct value.
Secondly, separating the checks for each attributes will allow us to add attributes of different types stored in different data structure easier. We could simply add another check on the attribute against the keyword specified then do a logical addition of the result against the others.
Therefore, as we foresee us adding more attributes to be filtered increasing the need to ensure logical correctness, the first approach is the most ideal.
Viewing the information of a client --- Toh Ker Wei
This feature allows users to view the information of a specific client using his INDEX
in the clients list. Information displayed includes additional information of the client, exercises done and his personal best of exercises done.
Implementation
The view client’s information feature is primarily facilitated by the model Client
. The details for list of exercises done and personal best will be discussed in section 3.7 and not be covered here. The client’s INDEX
in the clients list will be used to identify and retrieve his information. Additionally, only when a client’s information is being viewed, graph of his exercises can be plotted.
In the following sequence diagram, we will be tracing the execution when the user enters the command view-c 3
Design Considerations
Choose client to view based on INDEX (Chosen) |
Choose client to view based on NAME |
|
---|---|---|
Adhering to Single Responsibilities Principle |
|
|
Ease of Implementation |
Easier to implement as |
Harder to implement as |
We decided to use the first approach of using the client’s INDEX
to view his information.
Firstly, as the client’s INDEX
is unique, view-c
will only be responsible for retrieving and displaying the client’s information and will not need to resolve clients with the same names.
Secondly, for clients with the same name, INDEX
qill be used to specify the client to be view. This causes extra work for the implementation. Furthermore, in cases where users manage many clients and some with same names, there are functions like find and filter which allow users to scope the clients list and easily find the desired client’s INDEX
.
Therefore, viewing a client by his INDEX
minimises the responsibility of the command and will not need to resolve conflicting clients and is the most ideal.