PROJECT: Sharkie


Overview

Sharkie is a desktop expense tracker application. The user interacts with it using a CLI, and it has a GUI created with JavaFX. It is written in Java, and has about 10 kLoC.

Summary of contributions

  • Major enhancement: implemented the model layer for Wallet #41

    • What it does: creates the in-memory objects that are required for monetary tracking.

  • Major enhancement: implemented the storage layer for Wallet #111, #154

    • What it does: allows saving of monetary-related data.

    • Credits: adapted from existing AddressBook code.

  • Major enhancement: implemented commands to record transactions #100

    • What it does: allows user input of monetary-related data.

  • Minor enhancement: converted money representation from double to long #161

    • This was done for accuracy in calculations, preventing floating-point errors.

  • Code contributed: [Functional & Test code]

  • Other contributions:

    • Documentation:

      • Updated the project README #57

      • Updated the UG introduction, features and commands #69

      • Added product surveys to the DG #72

    • Community:

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.

Introduction

Welcome to Sharkie!

Ui
Figure 1. GUI of Sharkie

Sharkie is an all-in-one personal finance tracking desktop application designed for university students, who would like to monitor their spending. It manages your incomes and expenses, organises your contacts and keeps track of debts your friends owe you, so that your loans always come with a money-back guarantee!

Sharkie boasts a sleek, trendy Graphical User Interface (GUI) while being at its core, a Command Line Application - this means that the faster you type, the faster you can get those pesky finances out of your head and into Sharkie's management system.

Have we reeled you in? Dive into [quick-start] to get on board with Sharkie. Enjoy!

Adding an expense: expense

Suppose you have paid for an expense and wish to record it down in Sharkie, you may enter the wallet expense command to do so.

Format: wallet expense n/<description> $/<amount> [d/<date: dd/mm/yyyy>] [t/<tag>]

Command Format

The following are the restrictions of the wallet expense command, which you would need to take note of:

  • The <description> should not be blank.

  • The <amount> should be non-negative and have only up to two decimal places.

  • If no <date: dd/mm/yyyy> is specified, your expense will default to today’s date.

  • If no <tag> is specified, your expense will be given a default tag "Misc".

The first letter of the <tag> will be converted to uppercase.

Example:

  • Suppose you purchased "Chicken Rice" for "$3.50" on "10th October 2010". You wish to record it as a food item.

    • The command you would enter is wallet expense n/Chicken Rice $/3.50 d/10/10/2010 t/food.

    • This records down an expense with the specified details.

Expected Outcome:

  • A new expense will be added into your wallet, automatically updating your wallet’s statistics.

    New expense added: Chicken Rice Description: Chicken Rice Amount: $3.50 Date: 2010-10-10 Tag: [Food]
    Your expenditure for OCTOBER 2010 is: $3.50/$0.00

Adding an income: income

Suppose you have earned an income and wish to record it down in Sharkie, you may enter the wallet income command to do so.

Format: wallet income n/<description> $/<amount> [d/<date: dd/mm/yyyy>] [t/<tag>]

Command Format

The following are the restrictions of the wallet income command, which you would need to take note of:

  • The <description> should not be blank.

  • The <amount> should be non-negative and have only up to two decimal places.

  • If no <date: dd/mm/yyyy> is specified, your expense will default to today’s date.

  • If no <tag> is specified, your expense will be given a default tag "Misc".

The first letter of the <tag> will be converted to uppercase.

Example:

  • Suppose you teach "P6 Tuition" and have just received your paycheck for "$3000" on "10th October 2010". You wish to record it as a job item.

    • The command you would enter is wallet income n/P6 Tuition $/3000 d/10/10/2010 t/job.

    • This records down an income with the specified details.

Expected Outcome:

  • A new income will be added into your wallet, automatically updating your wallet’s statistics.

    New income added: P6 Tuition Description: P6 Tuition Amount: $3000.00 Date: 2010-10-10 Tag: [Job]

Expenditure Summary

Sharkie displays an overview of your monthly spending and income so that you know where all your money has gone to!

If you are more visually inclined, you can view statistics such as the different proportions of your spending on different items and how close you are to reaching your self-imposed budget.

All statistics are automatically updated and located in the wallet tab.

Check out Section 5.2.1, “Setting a budget” to learn how to budget your monthly spending with Sharkie.

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.

Appendix A: Product Survey

Money Lover

Pros / Good Features

  • Wallet

    • Multiple wallets to further organise spending/income

  • Transaction

    • Attach images to transactions

    • Add location data to transactions

    • Add recurring transactions (monthly, weekly, etc)

    • Option to exclude certain expenses/incomes from statistics

    • Search for transactions by amount, date, description, category, location

  • Debt

    • Set reminders to self on when to pay back debts

  • Budget

    • Set custom date range for budget

    • Set budget for specific categories (e.g. food, clothes)

    • Calculate recommended daily spending

  • Statistics

    • View statistics for custom date ranges

  • NFR

    • Cross-platform (syncs between devices)

    • Appealing, clean UI

Cons / Bad Features

  • Transaction

    • Unable to create custom tags/categories for transactions

  • Debt

    • Unable to tag debts to a specific contact (no underlying address book)

  • NFR

    • Requires network

    • GUI-reliant (slow input)

    • Certain features locked behind paywall, advertisements

Link to Product: https://web.moneylover.me

Spendee

Pros / Good Features

  • Wallet

    • Can import .csv files to add data more quickly

  • Transaction

    • Attach images to transactions

    • Create custom tags for transactions

    • Add recurring transactions (monthly, weekly, etc)

    • Search for transactions by amount, date, description, category

    • Can also filter by multiple categories at once

  • Budget

    • Calculate recommended daily spending

  • Statistics

    • View statistics for custom date ranges

  • NFR

    • Cross-platform (syncs between devices)

    • Appealing, clean UI

Cons / Bad Features

  • Debt

    • Unable to tag debts to a specific contact (no underlying address book)

  • NFR

    • Requires network

    • GUI-reliant (slow input)

    • Certain features locked behind paywall, advertisements

Link to Product: https://app.spendee.com

Storage component

StorageClassDiagram
Figure 2. Structure of the Storage Component

API : Storage.java

The Storage converts Model objects to saveable data and vice versa. It comprises four main parts: UserPrefsStorage, UserDataStorage, AddressBookStorage and WalletStorage. Each of these interfaces have a JSON-based implementation that convert their specific data to and from JSON.

The Storage component,

  • can save UserPref objects in JSON format and read it back.

  • can save UserData in JSON format and read it back.

  • can save the Address Book data in JSON format and read it back.

  • can save the Wallet data in JSON format and read it back.

Transactions

The Transaction forms the basis for Sharkie’s monetary-related features. It contains a Description, Amount, Date and Tag.

There are currently four classes that inherit from this abstract class, namely Expense, Income, Debt and Loan.

TransactionClassDiagram
Figure 3. Class diagram of Transaction

Expense and Income can be created using the WalletExpenseCommand and the WalletIncomeCommand.

These commands can be accessed from Logic#execute(). It records an expense of an indicated Description, Amount, Date and Tag.

As the two commands are similar, it is sufficient to trace the WalletExpenseCommand. The following activity diagram illustrates what happens when the user enters a wallet expense command:

ExpenseActivityDiagram
Figure 4. Activity diagram of recording an expense

Implementation of wallet expense command

  1. When entering the expense command, the user will specify the Description, Amount and optionally, the Date and Tag.

  2. The WalletExpenseCommandParser will create an Expense object based on the details provided, and return the resulting WalletExpenseCommand that has a reference to the Expense created.

  3. The LogicManager then executes the command and adds the previously created Expense object to the Wallet model.

  4. CommandResult is returned.

The following sequence diagram summarizes what happens during the execution of a wallet expense command:

ExpenseSequenceDiagram
Figure 5. Sequence diagram of the wallet expense command
The lifeline for WalletExpenseCommandParser and WalletExpenseCommand should end at the destroy marker (X) but due to a limitation of PlantUML, the lifeline reaches the end of diagram.

Design Considerations

Aspect: Representing the Amount of a Transaction.
  • Alternative 1 (previous implementation): Amounts are stored in dollars as double.

    • Pros: Easier to implement.

    • Cons: Floats are inexact. Floating point errors may cause rounding errors or unexpected bugs(e.g. checking if an amount is equal to zero).

  • Alternative 2 (current implementation): Amounts are stored in cents as long.

    • Pros: Arithmetic involving amounts will be exact.

    • Cons: Conversion is needed between cents and dollars. All Sharkie programmers have to be aware of the necessary conversion else bugs may occur.

  • Alternative 3: Amounts are stored as the inbuilt BigDecimal class.

    • Pros: Arithmetic involving amounts will be exact.

    • Cons: BigDecimal is slower in performance and if many calculations are performed, runtime is considerably slower.