-
Notifications
You must be signed in to change notification settings - Fork 89
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[CS2113-F11-1] FITNUS #27
base: master
Are you sure you want to change the base?
Changes from all commits
5106842
c0899a9
45ba6ff
2b1ec01
223a438
8f246d9
945441b
46d39d9
43b922f
066cdd2
540e4c1
8f99327
3c1a313
d127d10
cf3dc54
2c24bdd
15f9e6c
29e56e7
2a84d82
a0bdfd1
c3c2e90
9a4efd0
275d778
caea4fd
92e4bc3
fca8b8d
2c759a9
662d141
21e424a
4daa67b
31f14f8
76140cf
2f91d2f
6056f8b
c9d8ac5
90e81d7
6b19e90
6f95551
664d4e0
264bf1b
74fa347
3383f86
b0df278
dc239a8
d658f3f
4a0781e
003d1b1
ee55f79
6d21513
02fbc12
0e9c3c8
08bd893
0915bdc
4d860ff
65d1a5d
0b6eb8c
5f1d1ce
a847a3d
c3fd3a3
6204a80
3a01fbd
19d6c1a
9ad6efa
6e73839
3f4a38d
43758c6
fd0cc7d
ae4184c
10865ac
6d212b8
f1cd21a
f228f50
81d8045
3a733a2
791812f
dcb4374
8e8861f
568ea6f
7b542b6
d77e127
ace0288
22f9aba
9e2048e
4854a86
92e2d4e
a666a62
ccc9a90
d945506
d3ecf35
d251389
cea9d79
3b75cd6
f9e1a8b
398794d
c8c2562
59c07d4
8e0ce34
7ff361c
5c36530
a95800d
ebdbc39
fa2837f
08d105c
cb47052
c72765b
6ca3648
a1640f3
ae819b3
e6b83c0
6990891
5971c54
1a541bf
13553d7
d3879a6
8911f32
5374a8c
41ef618
493a621
8fec492
f0c41ae
f136a4a
dbe4c83
b493a99
2ee5806
1752378
a773093
ead7772
970e22b
31efa75
583de53
6b0a13e
a428600
dcfb206
2d8faaa
df80e92
cc0fff1
d921be9
b4a5479
0192df9
c54de2d
c00c0c6
37a9f61
9b4a10e
64b2a2a
ecb012d
1dc8963
c817f41
5193f21
7673bc8
75395ef
ed9ce44
49b1549
db529b9
ed8d15c
43cfd28
4ed88a3
fff0055
5baed11
632a82b
f181617
b63c94a
15c64cd
5d8345e
922981d
007bc02
25c5ce4
2286b58
6b9dbc6
a95ed63
b7515da
c7b817c
8ef7eee
52db76c
5133f60
07875cb
24f568d
39ccf2f
80a6ac8
8a8e8c2
71821d8
561c41d
5113d15
592656a
d5f28a3
f911de5
7e6e5c8
647881b
679ebd0
738c947
0a3c513
fd754e2
fb7205f
e97fd48
717295c
ac40ab8
4fcc5df
34bbb4e
28cb8d4
c8401cf
1bfbd1a
6638b6f
bd7f8a7
72a88df
ea7f8d3
815bf5f
d3e8ce6
20aee5d
9503ff2
0031283
deee6b7
0936716
8234aea
999f916
85c86ab
5c276b3
1184a29
ce334db
7f4f941
7213833
5235a0a
dc88434
a59ae1b
6d5145b
5aac026
5847537
aa02ae5
b5f5bb1
8cd19f7
d21417d
3a6ab4f
77e3033
7a96072
46d39f9
658c3c2
f832042
a6d662b
b9a29ef
51f7669
13cfffb
d31d8a8
8351894
697d21d
471aa4d
69570af
b11d188
d2fc745
e0f2c85
3c0f01a
85244db
68c97c1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"java.configuration.updateBuildConfiguration": "interactive" | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Manifest-Version: 1.0 | ||
Main-Class: seedu.duke.Duke | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,8 @@ | ||
# About us | ||
|
||
Display | Name | Github Profile | Portfolio | ||
--------|:----:|:--------------:|:---------: | ||
![](https://via.placeholder.com/100.png?text=Photo) | John Doe | [Github](https://github.com/) | [Portfolio](docs/team/johndoe.md) | ||
![](https://via.placeholder.com/100.png?text=Photo) | Don Joe | [Github](https://github.com/) | [Portfolio](docs/team/johndoe.md) | ||
![](https://via.placeholder.com/100.png?text=Photo) | Ron John | [Github](https://github.com/) | [Portfolio](docs/team/johndoe.md) | ||
![](https://via.placeholder.com/100.png?text=Photo) | John Roe | [Github](https://github.com/) | [Portfolio](docs/team/johndoe.md) | ||
![](https://via.placeholder.com/100.png?text=Photo) | Don Roe | [Github](https://github.com/) | [Portfolio](docs/team/johndoe.md) | ||
Display | Name | Github Profile | Portfolio | PPP | ||
--------|:-----------:|:--------------------------------------:|:---------:|:----:| | ||
![](https://picsum.photos/98) | Kevin Zhang | [Github](https://github.com/kevinz420) | [Portfolio](docs/team/johndoe.md) | ||
![](https://picsum.photos/99) | Ethan Huang | [Github](https://github.com/remy9926) | [Portfolio](docs/team/johndoe.md) | [PPP](./team/remy9926.md) | ||
![](https://picsum.photos/100) | Jiayan Tian | [Github](https://github.com/j-y-yan) | [Portfolio](docs/team/johndoe.md) | ||
![](https://picsum.photos/102) | Feng Guangyao | [Github](https://github.com/mroppa1) | [Portfolio](docs/team/fengguangyao.md) |
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -1,38 +1,107 @@ | ||||||||||||||||||||||
# Developer Guide | ||||||||||||||||||||||
|
||||||||||||||||||||||
## **Content** | ||||||||||||||||||||||
- [Handing User Inputs & Displaying Output](#item-one) | ||||||||||||||||||||||
- [Updates Exercise from Log feature](#item-two) | ||||||||||||||||||||||
- [Adding a New Exercise Goal](#item-three) | ||||||||||||||||||||||
|
||||||||||||||||||||||
## Acknowledgements | ||||||||||||||||||||||
|
||||||||||||||||||||||
{list here sources of all reused/adapted ideas, code, documentation, and third-party libraries -- include links to the original source as well} | ||||||||||||||||||||||
[Remy9926 iP for File I/O](https://github.com/Remy9926/ip) | ||||||||||||||||||||||
|
||||||||||||||||||||||
## Design & implementation | ||||||||||||||||||||||
|
||||||||||||||||||||||
{Describe the design and implementation of the product. Use UML diagrams and short code snippets where applicable.} | ||||||||||||||||||||||
<a id="item-one"></a> | ||||||||||||||||||||||
### Handling User Inputs & Displaying Output | ||||||||||||||||||||||
|
||||||||||||||||||||||
A lot of the initial project setup that deals with things like parsing, displaying outputs back to the user, exceptions, etc. are strongly inspired by the address book example project demoed in class. Specifically, we have classes that are responsible for various aspects of our project in order to follow the single-responsibility principle and limit the amount of coupling. | ||||||||||||||||||||||
|
||||||||||||||||||||||
One specific design implementation we chose was having a Command superclass that all commands in our application will inherit from. This allows every command we write in the future to be guaranteed to possess all methods specified in the superclass. Therefore, we can call these methods in our main function without needing to worry about the differences between various commands because they all inherit from the same parent. Another alternative we considered was simply making each separate command its own function and calling them from our parser class. However, we want to keep the commands as high level as possible and avoid calling more lower-level functions if possible, so we can provide more encapsulation to each command. Therefore, we decided to go with this class-based command hierarchy that was also found in the example address book repo. | ||||||||||||||||||||||
|
||||||||||||||||||||||
Below is a class diagram that describes how our various components interact with one another: | ||||||||||||||||||||||
|
||||||||||||||||||||||
![image](https://github.com/AY2324S1-CS2113-F11-1/tp/assets/54857388/21bd2aa9-8e50-49d2-b888-50446115f922) | ||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good use of '+' and '-' for the class diagram. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||||||||||||||||||||||
|
||||||||||||||||||||||
The parser class is responsible for reading the user input and creating specific command objects. All of these subcommands inherit from a general Command parent class which has an `execute` method that can be called regardless of child class and will return a CommandResult object. The CommandResult object dictates what info (string or list of items) needs to be returned to the user for viewing. Both CommandResult and TextUi (responsible for actually displaying data from CommandResult to user) will only print objects from classes that inherit from the Printable interface. This ensures that objects in the `relevantItems` list are all serializable as a human-readable string to be displayed to the end user. | ||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Maybe enclose the class/interface names in code-blocks? |
||||||||||||||||||||||
|
||||||||||||||||||||||
<a id="item-two"></a> | ||||||||||||||||||||||
### Update Exercises from Log feature | ||||||||||||||||||||||
|
||||||||||||||||||||||
The proposed feature is to allow users to update exercises from the ExerciseLog class to allow for full CRUD functionality of the class. Currently, users are able to create exercises and log them as well as view all the exercises that they have created, but in the case of a typo, they are unable to update the log to accommodate for the user error. To improve the user experience, this update feature has been proposed to allow users to have a better experience using the app. | ||||||||||||||||||||||
|
||||||||||||||||||||||
The update feature will be implemented by allowing users to select the task that they want to edit by specifying the month and day that they logged this exercise at, as well as the corresponding exercise name and the number of calories that the exercise has burned. This is because each exercise is stored within Day objects, and in order to check if two exercises are equivalent, we check both the exerciseName and caloriesBurned fields. Thus, these parameters will need to be specified by the user in order to update the exercise log. | ||||||||||||||||||||||
|
||||||||||||||||||||||
Below is an example of how this feature will work: | ||||||||||||||||||||||
|
||||||||||||||||||||||
Step 1: Upon starting the app, the ExerciseLog class is initialized and a log is created for the user to log their exercises. | ||||||||||||||||||||||
|
||||||||||||||||||||||
<img width="661" alt="Screenshot 2023-10-22 at 22 21 04" src="https://github.com/Remy9926/tp/assets/95456114/933b3636-eba7-442b-bcf2-aec22ef49dba"> | ||||||||||||||||||||||
|
||||||||||||||||||||||
Step 2: The user calls the log command with the specified parameters to add a new exercise to the list. However, the user notices that they made a typo and want to change the details of the exercise that they just logged. | ||||||||||||||||||||||
Comment on lines
+36
to
+40
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Maybe indent and bold the steps section to make it create a hierarchy of sections. |
||||||||||||||||||||||
|
||||||||||||||||||||||
<img width="682" alt="Screenshot 2023-10-22 at 22 23 59" src="https://github.com/Remy9926/tp/assets/95456114/318cd321-6516-4163-a4ce-4a9e5d5edf7b"> | ||||||||||||||||||||||
|
||||||||||||||||||||||
Step 3: The user calls the update command with the information of the old exercise as well as the new information that the user wants to update with. With this, the update is done. | ||||||||||||||||||||||
|
||||||||||||||||||||||
<img width="652" alt="Screenshot 2023-10-22 at 22 25 09" src="https://github.com/Remy9926/tp/assets/95456114/d07d5570-11fc-426c-877d-feb31a338f0a"> | ||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. maybe add a class diagram for the log class There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. add a sequence diagram for creating a new log |
||||||||||||||||||||||
|
||||||||||||||||||||||
<a id="item-three"></a> | ||||||||||||||||||||||
### Adding a New Exercise Goal | ||||||||||||||||||||||
Setting up exercise goals is one of the major components in our FitNus app. It could guide users to do exercise in a more systematic way, while ensuring the possibility of keeping track of the record. | ||||||||||||||||||||||
|
||||||||||||||||||||||
Inheritance Level: | ||||||||||||||||||||||
|
||||||||||||||||||||||
As one of the commands input by user, the goal class should be inherited from the command class, with the general abstract method such as constructor, execution of command, etc. | ||||||||||||||||||||||
|
||||||||||||||||||||||
Implementation: | ||||||||||||||||||||||
The goalist class has some helper functions, including checkGoalInput to ensure the validity of user input, addGoal to add a new goal record into the goal list. The execution of goal command simply create a new goal record by first validating the user input, and create a goal record and finally return the result of creating the goal. | ||||||||||||||||||||||
|
||||||||||||||||||||||
1. View Goal function and Delete Goal function | ||||||||||||||||||||||
|
||||||||||||||||||||||
The view function is vital in visualization of the goal list while delete function helps to remove some redundant, incorrect, or achieved goals. | ||||||||||||||||||||||
|
||||||||||||||||||||||
- Implementation 1: | ||||||||||||||||||||||
|
||||||||||||||||||||||
Note that since other command classes may also need a list function or delete function, these two functions can be created for a general use and applicable for all commands. | ||||||||||||||||||||||
|
||||||||||||||||||||||
- Implementation 2 (Current Implementation): | ||||||||||||||||||||||
|
||||||||||||||||||||||
Since the user need different input to differentiate type of objects to delete, it is acceptable to implement different delete classes, with some common implementation of interface(if any). | ||||||||||||||||||||||
|
||||||||||||||||||||||
2. Achieve Goal function | ||||||||||||||||||||||
|
||||||||||||||||||||||
This aims to keep the record of achieved goals. Once the user marks a goal as finished, the record will be automatically backed up into the history list, with supported view function. Also, it is designed not to allow user to modify any achivement. If user made any mistakes, either he starts a new achievement files, or he keeps the false record. | ||||||||||||||||||||||
|
||||||||||||||||||||||
Potential Improvements: | ||||||||||||||||||||||
|
||||||||||||||||||||||
All records in the history list(and general goal list) should be sorted according to their finish time and in alphabetical order. | ||||||||||||||||||||||
|
||||||||||||||||||||||
To provent user from making mistakes, we could design an algorithm to detect whether an achievement is accomplished. | ||||||||||||||||||||||
|
||||||||||||||||||||||
|
||||||||||||||||||||||
## Product scope | ||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. unfinished DG |
||||||||||||||||||||||
### Target user profile | ||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Target user profile, Value proposition, User Stories, and Non-Functional Requirements is not updated. |
||||||||||||||||||||||
|
||||||||||||||||||||||
{Describe the target user profile} | ||||||||||||||||||||||
Our target users are NUS students who are looking to get in shape and live a healthier lifestyle. We want to provide fitness and eating recommendations that are near the NUS campus which will be easily accessible to our end users. | ||||||||||||||||||||||
|
||||||||||||||||||||||
### Value proposition | ||||||||||||||||||||||
|
||||||||||||||||||||||
{Describe the value proposition: what problem does it solve?} | ||||||||||||||||||||||
* track calories consumption vs usage | ||||||||||||||||||||||
* set fitness goals and monitor their progress towards these goals | ||||||||||||||||||||||
|
||||||||||||||||||||||
|
||||||||||||||||||||||
## User Stories | ||||||||||||||||||||||
|
||||||||||||||||||||||
|Version| As a ... | I want to ... | So that I can ...| | ||||||||||||||||||||||
|--------|----------|---------------|------------------| | ||||||||||||||||||||||
|v1.0|new user|see usage instructions|refer to them when I forget how to use the application| | ||||||||||||||||||||||
|v2.0|user|find a to-do item by name|locate a to-do without having to go through the entire list| | ||||||||||||||||||||||
|v1.0|New User|see usage instructions|refer to them when I forget how to use the application| | ||||||||||||||||||||||
|v2.0|Obesity Victim|set up my work out plan|lose weight| | ||||||||||||||||||||||
|v2.0|Health Enthusiasts|set up fitness goals|follow and keep myself healthy in a systematic way| | ||||||||||||||||||||||
|v2.1|Dieter|record everyday diet|monitor the amount of calories taking in and check total amount| | ||||||||||||||||||||||
|
||||||||||||||||||||||
## Non-Functional Requirements | ||||||||||||||||||||||
|
||||||||||||||||||||||
{Give non-functional requirements} | ||||||||||||||||||||||
|
||||||||||||||||||||||
## Glossary | ||||||||||||||||||||||
|
||||||||||||||||||||||
* *glossary item* - Definition | ||||||||||||||||||||||
## Non-Functional Requirements | ||||||||||||||||||||||
|
||||||||||||||||||||||
## Instructions for manual testing | ||||||||||||||||||||||
* Java 17 is the most recommended version to use. | ||||||||||||||||||||||
* Make sure the login user of your pc keeps the same, otherwise the storage address might differ, resulting in the loss of precious data. | ||||||||||||||||||||||
|
||||||||||||||||||||||
{Give instructions on how to do a manual product testing e.g., how to load sample data to be used for testing} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
# Duke | ||
|
||
{Give product intro here} | ||
FITNUS helps NUS students set and maintain fitness goals for themselves. Students can log their meals that they've eaten as well as any exercise they have done and manage it all in our intuitive CLI application! | ||
|
||
Useful links: | ||
Here are some useful links: | ||
* [User Guide](UserGuide.md) | ||
* [Developer Guide](DeveloperGuide.md) | ||
* [About Us](AboutUs.md) | ||
* [About Us](AboutUs.md) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the class diagram, maybe use same font size for the text of same type?