Tan De Jun (@dejunnn) - Project Portfolio Page

Overview

Diet Manager is an personalised text-based chat-bot application used for managing an individual’s diet. Diet Manager is capable of tracking daily food intake and providing recommendations depending on a user’s specified health data.

Summary of Contributions

Code Contributed

Diet Manager: Link to code on tP Code Dashboard here.

Enhancements implemented

Design:

Commands Implemented:

Commands Enhanced:

Features Implemented:

Contributions to documentation

Established the framework and contributed to most sections of the User Guide:

Sections wrote: Introduction, Quick Start, Profile Features, Utility Features, FAQ, Command Summary

Sections enhanced: Daily Food Record Features, Food Nutrition Record Features, Recipe Features

Contributions to the DG

Established the framework and contributed to most sections of the Developer Guide:

Sections wrote:

UML Diagrams drawn and added:

Contributions to team-based tasks

Contributions beyond the project team

Contributions to the User Guide

Below are short snippets of my contributions to the User Guide. I am unable to include more due to page constraints.


1 Introduction

Diet Manager is an personal text-based chat-bot application used for managing an individual’s diet.

Diet Manager is capable of the following functions:

2 Quick Start

Note that most command features are locked until a valid profile has been created. Only the set-profile, help and exit commands are usable upon first start-up

    Please create a profile before using this command. Enter:
    set-profile {name} {age} {gender} {height} {weight} {weight goal}

3 Features

Note that:

3.1 Profile Features

Set user profile

Creates a new profile

Format: set-profile NAME AGE GENDER HEIGHT WEIGHT WEIGHTGOAL

Example of usage:

set-profile John 20 male 180 80 75

View user profile

View user profile details

Format: profile

Example of usage:

profile

4 FAQ

Q: What do I do if the application cannot be launched?

A: Ensure that you have Java 11 and above installed on your device, and that you have the most updated version of the application.

Q: How do I transfer my data to another device?

A: All recorded user-related data will be stored in a folder when running the application. Simply copying and moving that specific folder would be sufficient.

Q: What if I want to use this application for multiple users on the same device?

A: The application is localised and user data is dependent on the specific data files present. Simply switch the data files to that of another user, or have multiple folders present for multiple users.

Q: Can I directly change the data in the data files?

A: You can, but it is strongly discouraged as it could lead to the data file being corrupt and the application being forced to delete the data file and create a new one.


Contributions to the Developer Guide

Below are short snippets of my contributions to the Developer Guide. I am unable to include more due to page constraints.


Architecture

ArchitectureDiagram

The Architecture Diagram given above explains the high-level design of the Diet Manager Application.

The components involved are given below:

Logic component

Logic-Component

The Logic component is responsible for:

Model component

Model-Component

The Model component is responsible for:

The Model consists of the following classes:

The Model component

  1. Receives instructions from Logic to update in-memory information.
  2. Is not dependent on any of the other components.
  3. Contains all the classes that are responsible for database and records of food and user

Launch Application

Launch Application

Implementation

Upon startup of Diet Manager:

  1. AppManager.launch() is called.
  2. AppManager then constructs the relevant object required for the application to function. These objects include, in the order of construction:
    • UI - User Interface functions
    • LogsCentre - Logging and system tracking functions
    • Profile - Holds user profile data in-memory
    • FoodNutritionRecord - Holds food nutrition data in-memory
    • Storage - Prepares data files for reading, writing and saving of information
  3. Once the objects have been created, Storage then loads any current data from data files (if any) into local memory for the application to access. If no data files are found, Storage creates new data files for future storage.
  4. All relevant components have now been initialised and the application is ready to be run.

Design and Enhancements

The modular system of initialising the application serves several purposes:

  1. Reducing coupling and dependence between essential components upon startup
  2. Aid in debugging by isolating the components
  3. Future enhancements which might include the construction of additional components

This implementation can be further enhanced by further abstracting initialisation of different components, which would be useful in the future when more components are added to enhance this application.

Logic Management

Logic Flow

Implementation

The logic flow of DietManager was intentionally made to be modular in design, and allow AppManager to be the sole handler of all logic-based executions.

Upon running the application:

  1. A check is done for the ui.exitStatus() of the application, and exits the loop if the user entered the exit command during the previous iteration.
  2. UI calls readInput() to read in user input.
  3. The String value of user input then gets passed back to AppManager.
  4. The String value then gets parsed through CommandParser to generate a specific Command.
  5. This command will then be passed back to AppManager.
  6. AppManager checks if the command is valid using isCommandValid().
  7. If the command is valid, AppManger executes the command using execute().
  8. The command Result then gets returned to AppManager, where it will be displayed to the user.
  9. The loop then continues, from steps 1 to 9.
  10. If the user exits the application, the application will terminate and all created components will be destroyed.

Design and Enhancements

The modular system of running the application serves several purposes:

  1. Reducing coupling and dependence between essential components upon startup
  2. Aid in debugging by isolating the components
  3. Future enhancements which might include the construction of additional components

The design of AppManager was done to prevent the possibility of errors occurring in multiple components due to potential bugs, and narrows down the scope of potentially flawed components.

This aids in testing and debugging of the application, as well as leaves space for future enhancements, by allowing other components to interact with the application without having to change multiple different components to achieve this. This allows for greater accessibility and modularity.

This implementation can be further enhanced by abstracting the logic flow of different components into separate classes. Thus each individual class will be responsible for the logic management of a particular component thus would allow for more modularity, testability and expandability.