Koh Ming En’s Project PortFolio Page
Koh Ming En’s Project PortFolio Page
Project: LifeTracker
LifeTracker is a desktop application used for encouraging users to lead a healthier life by tracking their net calorie intake. The user interacts with it using a CLI. LifeTracker is written in Java 11 and has about 4 kLoC.
Given below are my contributions to the project.
Databases
The databases generated by LifeTracker stores all of the users information. The primary file type used in this project is csv
and I used the OpenCSV v5.6
library to read and write to the databases. The databases I created are:
- Food Database
- Meal Database
- Exercise Database
The sections below will discuss each database, its implementation and its contribution to the project.
Food Database
- What it does: Stores a copy of food sold in Technoedge and its nutritional value
- Justification: This enables a more streamlined user experience as the user did not need to recall the exact food eaten and its nutritional value before inputting it in LifeTracker. The database also included methods to filter the foods for use in other parts of the project.
- Highlights: The database was designed to be as general as possible, such that it could be “plugged” into any part of the project and used.
Meal Database
- What it does: Stores the meals that the user previouslty ate, including date of meal, type of meal (Breakfast, Lunch, Dinner) and food eaten.
- Justfication: The information stored is used to calculate the calories consumed per day so that the user is able to better manage their weight.
Exercise Database
- What it does: Stores the exercises that the user previously did, the amount of calories burnt and the date of exercise
- Justification: The information stored is used to calculate the calories burnt per day so that the user is able to better manage their weight.
- Highlights: The enhancement complemented the existing meal database, which tracked the meals that the user ate. The database was planned and implemented such that changes to existing code was minimised, thus ensuring low coupling. The existing command to track calories which had to be updated, was done in a way to not break its usage in other parts of the code.
Entities
To complement the database, I also created entities to hold the information from the databases. These are the entities I created and a brief description of what they do.
Food
: Holds the name of food, the store that sells it, and the nutritional content of the food. Has 3 child classes that further divides the foodDish
: A main courseSide
: A side dishIngredient
: Combined to make a full dish
Meal
: Holds the date of meal eaten, the type of meal, and foods eaten.User
: Holds the user current information
Exceptions
For error handling, I also created some custome exceptions. These are the exceptions I created and a brief description of their purpose.
LifeTrackerException
: Base Custom Exception that the rest of the exceptions inherits fromInvalidArgumentsException
: Raised when the user included arguments in the command that cannot be parsed.InvalidDateException
: Raised when the user included dates that cannot be parsed.InvalidIndexException
: Raised when the user selected an option that is out of selectable range.InvalidMealException
: Raised when the user entered an invalid type of mealMissingArgumentException
: Raised when the user did not include some arguments for the commandUnableToSaveDatabaseException
: Raised when the information entered could not be saved.
Code Contributed
Project Management
- Released
v1.0
on Github - Managed uploading of UML diagrams to repository
- Resolved
Gradle
andRuntest
violations
Enhancements to existing features
- Implemented Sorting for meals by date (PR #75)
- Implemented single line CLI option for
add
command (PR #77) - Enhanced tracking to include exercises on top of meals (PR #99)
Documentation
- User Guide:
- Added documentation for
add
,update
,view
,delete
,filter
,nutrition
,exercise
andtrack
(PR #100)
- Added documentation for
- Developer Guide: