PROJECT: CoderLifeInsights

CoderLifeInsights (CLI) is a desktop application that provides you insights and suggestions to your social life as a programmer using a CLI (Command Line Interface)


My Role

I am responsible to complete the import, export features as well as the suggestion and time insights feature. Besides that I am also tasked to improve the Graphical User Interface (GUI) of the application. I have also made notable contributions to the User Guide and Developer Guide.

Listed in the table below are some notations that are used throughout the document.

Table 1. Legend table
Icon Description

command

Command that can be executed, or a component, class or object in the architecture of the application

Tips that might be helpful in navigating the application

Important information that should be noted

Useful information for a deeper understanding of the command

As shown in Table 1, “Legend table”, these icons associated to their following descriptions, such as commands, tips, important information and useful information, enable greater clarity in understanding the document. Note that useful information will have text enclosed in its box.

Summary of contributions

Major enhancements:

  • Major enhancement #1: Implemented import & export features

    • What it does: It allows the user to save his CoderLifeInsights data in an external file and modifies the data before importing it back into the application. It also allows the user to change between computers without a fear of losing his CoderLifeInsights data.

    • Justification: This feature improves the product significantly as the user may have existing data before starting to use the application and to export the CoderLifeInsights data if he/she would like to change between multiple computers.

    • Highlights: This enhancement functions well with existing commands as it adds more CoderLifeInsights into the list, all the other features such as groups, and events are updated as well. It required an in-depth analysis of design alternatives.

    • Credits: [Jackson]

  • Major enhancement #2: Implemented suggestion features

    • What it does: It allows the user to suggest a person, place or activity from based on their existing CoderLifeInsights data. Suggestion of person would return one person that the user spends the least time with sorted by lexicographical order of name. Suggestion of place would return one place that the user visits the least in terms of frequency. Suggestion of activity would return one activity that the user does the least in terms of frequency.

    • Justification: This feature improves the product significantly simplifies the process when deciding a person to hangout with, a place to go to or an activity to do.

    • Highlights: This enhancement functions well with existing commands. It required an in-depth analysis of design alternatives.

Minor enhancements:

  • Minor enhancement #1: Redesigned user interface

    • What it does: This enhancement allows the application to have a better-looking, more user-friendly colour theme as well as allows the application window size to be resizeable.

    • Justification: To better fit and light up the social life as a Coder, it would be more pleasing to view the application in a brighter color as compared to the dark theme provided in AddressBook - Level3.

    • Highlights: Window size is adjustable to fit all components in to the desired smaller window size. It allows the user to use the application in full screen mode or as a smaller window without disruption of coding productivity.

  • Minor enhancement #2: Added view time insights feature

    • What is does: This enhancement allows users to be able to view insights of individual time spent vs group time spent in the form of a pie chart.

    • Justification: Users are able to gain knowledge on whether they spend more time with individuals or group as a whole.

    • Highlights: This enhancement functions well with existing commands. It required an in-depth analysis of design alternatives.

  • Code contributed:[RepoSense]

  • Other contributions:

    • Project management:

      • Managed releases v1.1 - v1.4 (4 releases) on GitHub

      • Created all major milestones on GitHub page

    • Enhancements to existing features:

      • Updated the GUI color scheme and layout (Pull requests: #95, #69)

    • Documentation:

      • Added contents of the User Guide (Pull requests: #12, #13)

      • Added contents of the Developer Guide (Pull requests: #74, #80)

    • Community:

      • PRs reviewed: #11

    • Tools:

      • Integrated Netlify for the team repo to allow continuous deployment of documentation previews

      • Assisted in integrating Codeacy to allow continuous deployment of code quality.

Contributions to the User Guide

Given below are sections I contributed to the User Guide. They showcase my ability to write documentation targeting end-users.

Import Life CSV: import

[written by: Cheng Lit Yaw]

Imports your existing Life CSV into the application
Format: import l/LIFE_FILE_PATH g/GROUP_FILE_PATH e/EVENT_FILE_PATH

  • Imports your existing Life contacts into the application.

  • An existing CSV file exported from CoderLifeInsights must exist before import.

  • LIFE_FILE_PATH, GROUP_FILE_PATH and EVENT_FILE_PATH must match your existing file path.

  • ALL three parameters must be specified for successful import.

Examples:

Example Command Result

Import Life from file "life.csv", group data from "groups.csv" and event data from "events.csv"

import l/life.csv
g/groups.csv
e/events.csv

Imports your Life from life.csv , group data from groups.csv and event data from events.csv

Import Life from file "life.csv", "groups.csv" and "events.csv" at specific file path

import l/C:\Users\User\Documents\life.csv
g/C:\Users\User\Documents\groups.csv
e/C:\Users\User\Documents\events.csv

Imports your Life from C:\Users\Harry\Desktop\Documents\life.csv
, your Group from C:\Users\User\Documents\groups.csv
and your Events from C:\Users\User\Documents\events.csv.

Import Life from file "life.csv", "groups.csv" and "events.csv" at specific file path

import l/./Desktop/life.csv
g/./Desktop/groups.csv
e/./Desktop/events.csv

Imports your Life from ./Desktop/life.csv
, your Group from ./Desktop/groups.csv
and your Events from ./Desktop/events.csv.

Retrieving File Path

For Windows:

  • Navigate to the file where you saved CoderLifeInsights data files.

  • Click on the address bar of File Explorer window.

  • Refer to the diagram below for reference.

windowsPathFinding
Figure 1. File path finding in Windows

For Mac: * Navigate to the file where you saved CoderLifeInsights data files. * Right-click on the CSV File and select Get info. * Refer to the diagram below for reference.

macPathFinding
Figure 2. File path finding in MacOS

CSV File Constraints

For Life.csv:

Before using the import command with Life.csv, please ensure the following headers are present.

  • name

  • phone

  • email

  • address

  • tagged

  • time

  • places

  • activities

Refer to image below for reference:

lifeCSVFormat
Figure 3. Example Life.csv format

Tags, Places and Activities should be separated by a semi-colon.

Example:

  • friends;school-mate

  • Orchard;NUS

  • Gym;Rock-Climbing

For Groups.csv:

Before using the import command with Groups.csv, please ensure the following headers are present.

  • name

  • groupId

  • timeSpent

  • memberIDs

  • eventIDs

  • places

  • activities

eventCSVFormat
Figure 4. Example Groups.csv format

memberIDs, eventIDs should be separated by a semi-colon.

Example:

  • 1;2;3

  • 5;6

For Events.csv:

Before using the import command with Events.csv, please ensure the following headers are present.

  • eventId

  • activity

  • place

  • withPerson

  • withGroup

  • time

eventCSVFormat
Figure 5. Example Events.csv format

Export Life CSV: export

[written by: Cheng Lit Yaw]

Exports your existing Life into a CSV file.
Format: export l/LIFE_FILE_NAME g/GROUP_FILE_NAME e/EVENT_FILE_NAME

  • Exports your existing Life contacts, group data and event data into 3 CSV files respectively.

  • Specify the file name you want to export for life, group and event data.

  • ALL three parameters must be specified for successful export.

Remarks:

  • On the very first run of CoderLifeInsights, this command is invalid as there is no saved data and CoderLifeInsights is using a sample data file to display sample contacts. Please proceed to add events, groups or persons before trying to export the information to the respective CSV files.

Examples:

Example Command Result

Export current life, group and event data

export l/life.csv g/groups.csv e/events.csv

Exports your Life to life.csv
Exports your group data to groups.csv
Exports your event data to events.csv

Suggestions: suggest

[written by: Cheng Lit Yaw]

Suggests a person to hang out with, a place to go or an activity to do.
Format: suggest SUGGESTION_PARAMETER

  • Suggestion parameters include person, activity or place

  • CoderLifeInsights will suggest:

    • A person to hangout with.

      • Suggestion is based on time spent with a person.

      • CoderLifeInsights will return a person which the user has spent the least time with.

      • If there are multiple people with the same amount of time spent, CoderLifeInsights will return a person based on reverse-lexicographical order of the people with the least amount of time spent.

    • A place to go to.

      • Suggestion is based on frequency of place visited from events added.

      • CoderLifeInsights will return the events that happened at the suggested place which the user has visited the least in terms of frequency.

      • If there are multiple places with the same frequency, CoderLifeInsights will return a random selection among the places with the same frequency.

    • An activity to do.

      • Suggestion is based on frequency of activity done from events added.

      • CoderLifeInsights will return the events that happened with the suggested activity which the user has done the least in terms of frequency.

      • If there are multiple activities with the same frequency, CoderLifeInsights will return a random selection among the activities with the same frequency.

Examples:

Example Command Result

Look for a person to do something with.

suggest person

Returns a person to hangout with.

Look for a place to do something at.

suggest place

Returns events based on suggested place to go to.

Look for an activity to do.

suggest activity

Returns events based on suggested activity to do.

Contributions to the Developer Guide

Given below are 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.

Import feature

[written by: Cheng Lit Yaw]

Implementation

The import feature allows users to import data from a comma-separated values (CSV) file. It allows users to bulk import their contacts, groups and events from a previously exported data from CoderLifeInsights application.

Given below is the sequence diagram to illustrate how the import operation interacts with the command import l/life.csv g/group.csv e/event.csv :

][pdfwidth="70%"
Figure 6. Import feature sequence diagram.
  1. User enters import l/life.csv g/group.csv e/event.csv.

  2. All 3 files would then be parsed by ImportCommandParser to check if the files exist with the path specified.

  3. On successful check, ImportCommand would be created and calls ImportFile#importCsv, ImportFile#importGroupCsv and `ImportFile#importEventCsv`to check if the CSV file headers are valid.

  4. ImportCommand would then call Model#importCsvToAddressBook, Model#importCsvGroupsToAddressBook and Model#importCsvEventsToAddressBook to check if the persons, groups and events are duplicates of the current CoderLifeInsights.

  5. If the imported data are not duplicates, it will then create a valid list of persons, groups and events to be added to CoderLifeInsights.

  6. CoderLifeInsights will then populate the 3 lists to the current data.

Given below is an activity diagram to summarise the steps above.

][pdfwidth="40%"
Figure 7. Import feature activity diagram.

Csv file format and constraints

In order for data to be imported into CoderLifeInsights, the CSV file provided must be in the exact format.

For life.csv:

Headers required:

  • name

  • phone

  • email

  • address

  • tagged

  • time

  • places

  • activities

Cell Formatting

  • No leading and trailing spaces in a cell.

  • To specify a comma within a cell, the value of the cell should be inside double quotes. Eg:

    • "Friends, Family"

    • "High School, Colleague"

Design Considerations

Aspect Alternative 1 (current choice) Alternative 2

How import executes

Imports the entire Csv file, converts all the rows into a list of Person, Group and Event objects and add the list into the spending list.

Pros:
Better performance.

Cons:
Requires additional methods to implement the features.

Imports the Csv file, converts all the rows into a list of Person, Group and Event objects respectively and add each object accordingly.

Pros:
Easy to implement. Re-use existing methods.

Cons:
May cause performance issues regarding memory issues.

The first alternative was chosen as performance of the application is prioritised over ease of implementation. There would be risk of the application stop responding if the second alternative was chosen.

Export feature

[written by: Cheng Lit Yaw]

Implementation

The export feature allows users to export their current data into a comma-separated value file with file name specified.

Given below is a sequence diagram to illustrate how the export operation interacts with the command export l/life.csv g/group.csv e/event.csv :

][pdfwidth="70%"
Figure 8. Export feature activity diagram.
  1. User enters export l/life.csv g/group.csv e/event.csv

  2. All 3 files would then be parsed by ExportCommandParser to check if the files specified exist within the specified file path.

  3. This is necessary to avoid existing files being overwritten.

  4. If files do not exist, ExportCommand would then be created and calls ExportFile#exportCsv, ExportFile#exportGroupCsv and ExportFile#exportEventCsv.

  5. Life, groups and events data would then be exported life.csv, group.csv and event.csv respectively.

Given below is an activity diagram to summarise the steps above.

][pdfwidth="40%"
Figure 9. Export feature activity diagram.

Suggestion Feature

[written by: Cheng Lit Yaw]

Implementation

The suggestion feature allows users to get a person to hangout with, a place to hangout or an activity to do.

Given below is an sequence diagram illustrating how the suggestion operation works with the command suggest person.

][pdfwidth="70%"
Figure 10. Suggest person feature sequence diagram.
  1. User enters suggest person.

  2. SuggestCommandParser would then check if keyword entered corresponds to person, place or activity.

  3. Upon valid keyword entered, SuggestCommand would call Model#suggestPerson to return a suggested person.

  4. ObservableList of filteredPersons would be iterated to get suggested person based on least time spent and reverse lexicographical order of name as a tie breaker. Model would self-invoke the method Model#updateFilteredPersonList to update filteredPersonList.

  5. filteredPersonList would then be updated to reflect on the GUI as a suggestion.

A similar approach would apply to place and activity where instead of Model#suggestPerson, it would be Model#suggestPlace or Model#suggestActivity where an ObservableList of filteredEvents would be iterated to get suggested place or activity based on the least frequency of the place visited or activity done.

If there are multiple place visited or activity done has the same frequency, a tie breaker would be introduced where a random place/activity would be suggested among the same frequencies.

Given below is an activity diagram to summarise the steps above.

][pdfwidth="40%"
Figure 11. Suggest person feature activity diagram.