diff --git a/.gitignore b/.gitignore index 2873e189e1..1444868b63 100644 --- a/.gitignore +++ b/.gitignore @@ -15,3 +15,6 @@ bin/ /text-ui-test/ACTUAL.TXT text-ui-test/EXPECTED-UNIX.TXT + +# plantuml jar +plantuml.jar \ No newline at end of file diff --git a/docs/DeveloperGuide.md b/docs/DeveloperGuide.md index 64e1f0ed2b..15312df164 100644 --- a/docs/DeveloperGuide.md +++ b/docs/DeveloperGuide.md @@ -2,12 +2,24 @@ ## Acknowledgements -{list here sources of all reused/adapted ideas, code, documentation, and third-party libraries -- include links to the original source as well} +1. Command, Parser and UI java files are adapted from one of our group member's [Duke Project](https://github.com/MingEn82/tp) ## Design & implementation -{Describe the design and implementation of the product. Use UML diagrams and short code snippets where applicable.} +### Architecture +![](../out/docs/uml/Architecture/architecture.svg) +**Main Components of LifeTracer** +`LifeTracker` is where users will access the application from. It is responsible for: + +- At app launch: Initialise the Databases and UI classes +- At app closure: Saves all updated data to databases + +The rest of the Application consists of three components: + +- `UI`: Reponsible for I/O between user and application +- `Command`: Handles execution of user inputs +- `Storage`: Stores information of the user and meals eaten ## Product scope ### Target user profile diff --git a/docs/uml/architecture.puml b/docs/uml/architecture.puml new file mode 100644 index 0000000000..90ede5aef4 --- /dev/null +++ b/docs/uml/architecture.puml @@ -0,0 +1,54 @@ +@startuml architecture +!include style.puml + +allow_mixing +skinparam classFontColor automatic +skinparam classHeaderBackgroundColor MODEL_COLOR_T4 + +database Storage STORAGE_COLOR { + +} + +class UI UI_COLOR { + +} + +class User { + +} + +class Food { + +} + +class Meal { + +} + +class Command LOGIC_COLOR { + +} + +class LifeTracker STORAGE_COLOR_T1 { + +} + +LifeTracker -up-> UI +LifeTracker -right-> Storage + +actor user USER_COLOR + +user ..> UI +UI -> Command + +Storage ..> Meal +Storage ..> Food +Storage ..> User +Meal *--left-- "1..*" Food + +Command --> User +Command --> Meal +Command --> Storage + + +@enduml \ No newline at end of file diff --git a/docs/uml/style.puml b/docs/uml/style.puml new file mode 100644 index 0000000000..2c46e043f2 --- /dev/null +++ b/docs/uml/style.puml @@ -0,0 +1,75 @@ +/' + 'Commonly used styles and colors across diagrams. + 'Refer to https://plantuml-documentation.readthedocs.io/en/latest for a more + 'comprehensive list of skinparams. + '/ + + +'T1 through T4 are shades of the original color from lightest to darkest + +!define UI_COLOR #1D8900 +!define UI_COLOR_T1 #83E769 +!define UI_COLOR_T2 #3FC71B +!define UI_COLOR_T3 #166800 +!define UI_COLOR_T4 #0E4100 + +!define LOGIC_COLOR #3333C4 +!define LOGIC_COLOR_T1 #C8C8FA +!define LOGIC_COLOR_T2 #6A6ADC +!define LOGIC_COLOR_T3 #1616B0 +!define LOGIC_COLOR_T4 #101086 + +!define MODEL_COLOR #9D0012 +!define MODEL_COLOR_T1 #F97181 +!define MODEL_COLOR_T2 #E41F36 +!define MODEL_COLOR_T3 #7B000E +!define MODEL_COLOR_T4 #51000A + +!define STORAGE_COLOR #A38300 +!define STORAGE_COLOR_T1 #FFE374 +!define STORAGE_COLOR_T2 #EDC520 +!define STORAGE_COLOR_T3 #806600 +!define STORAGE_COLOR_T2 #544400 + +!define USER_COLOR #000000 + +skinparam BackgroundColor #FFFFFFF + +skinparam Shadowing false + +skinparam Class { + FontColor #FFFFFF + BorderThickness 1 + BorderColor #FFFFFF + StereotypeFontColor #FFFFFF + FontName Arial +} + +skinparam Actor { + BorderColor USER_COLOR + Color USER_COLOR + FontName Arial +} + +skinparam Sequence { + MessageAlign center + BoxFontSize 15 + BoxPadding 0 + BoxFontColor #FFFFFF + FontName Arial +} + +skinparam Participant { + FontColor #FFFFFFF + Padding 20 +} + +skinparam MinClassWidth 50 +skinparam ParticipantPadding 10 +skinparam Shadowing false +skinparam DefaultTextAlignment center +skinparam packageStyle Rectangle + +hide footbox +hide members +hide circle \ No newline at end of file