diff --git a/.gitignore b/.gitignore index 2873e189e1..deda43cc32 100644 --- a/.gitignore +++ b/.gitignore @@ -15,3 +15,4 @@ bin/ /text-ui-test/ACTUAL.TXT text-ui-test/EXPECTED-UNIX.TXT +EventList.txt \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000000..c5f3f6b9c7 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "java.configuration.updateBuildConfiguration": "interactive" +} \ No newline at end of file diff --git a/build.gradle b/build.gradle index d5e548e85f..eb15d4f52b 100644 --- a/build.gradle +++ b/build.gradle @@ -29,11 +29,11 @@ test { } application { - mainClass = "seedu.duke.Duke" + mainClass = "seedu.moneymind.Moneymind" } shadowJar { - archiveBaseName = "duke" + archiveBaseName = "moneymind" archiveClassifier = null } @@ -44,3 +44,7 @@ checkstyle { run{ standardInput = System.in } + +run{ + enableAssertions = true +} diff --git a/docs/AboutUs.md b/docs/AboutUs.md index 0f072953ea..db5d8fa2ca 100644 --- a/docs/AboutUs.md +++ b/docs/AboutUs.md @@ -1,9 +1,8 @@ # About us -Display | Name | Github Profile | Portfolio ---------|:----:|:--------------:|:---------: -![](https://via.placeholder.com/100.png?text=Photo) | John Doe | [Github](https://github.com/) | [Portfolio](docs/team/johndoe.md) -![](https://via.placeholder.com/100.png?text=Photo) | Don Joe | [Github](https://github.com/) | [Portfolio](docs/team/johndoe.md) -![](https://via.placeholder.com/100.png?text=Photo) | Ron John | [Github](https://github.com/) | [Portfolio](docs/team/johndoe.md) -![](https://via.placeholder.com/100.png?text=Photo) | John Roe | [Github](https://github.com/) | [Portfolio](docs/team/johndoe.md) -![](https://via.placeholder.com/100.png?text=Photo) | Don Roe | [Github](https://github.com/) | [Portfolio](docs/team/johndoe.md) +Display | Name | Github Profile | Portfolio +--------|:--------------------------:|:-------------------------------------------:|:---------: +![](https://avatars.githubusercontent.com/u/88603534?s=400&u=3007dc79299805aa3b8f71aeb61899ea9fb64f6e&v=4) | Zhao Lixiuqi | [Github](https://github.com/alexgoexercise) | [Portfolio](team/Zhao_Lixiuqi.md) +![](https://via.placeholder.com/100.png?text=Photo) | Toh Hongfeng | [Github](https://github.com/Toh-HongFeng) | [Portfolio](team/toh-hongfeng.md) +![](https://via.placeholder.com/100.png?text=Photo) | Li Mingyuan | [Github](https://github.com/mingyuannus) | [Portfolio](team/johndoe.md) +![](https://via.placeholder.com/100.png?text=Photo) | Nguyen Duc Thang | [Github](https://github.com/Mnsd05) | [Portfolio](team/mnsd05.md) diff --git a/docs/DeveloperGuide.md b/docs/DeveloperGuide.md index 64e1f0ed2b..45cd328431 100644 --- a/docs/DeveloperGuide.md +++ b/docs/DeveloperGuide.md @@ -1,38 +1,382 @@ -# Developer Guide +--- +layout: page +title: Developer Guide +--- + +
+

MoneyMind Developer Guide

+

"Mind your Money"

+
+ +Moneymind is a Command Line Interface (CLI) application that helps you manage your personal finances. With Moneymind, you can keep track of your budgets, expenses, and categorize them for better organization. + +* Table of Contents +{:toc} ## Acknowledgements {list here sources of all reused/adapted ideas, code, documentation, and third-party libraries -- include links to the original source as well} -## Design & implementation +## Design {Describe the design and implementation of the product. Use UML diagrams and short code snippets where applicable.} +### Architecture + + + +The ***Architecture Diagram*** given above explains the high-level design of the App. + +Given below is a quick overview of how each component interact with each other. + +The main components in the architecture are: + +* `MoneyMind`: The main program of the application, +it initializes the other components in the correct sequence and is responsible for shut down the application. +* `UI`: The user interface of the application. +* `Storage`: The storage of data of the application. +* `Data`: The data classes used in the application, including Event, Category and CategoryList. +* `Command`: The command of the application, including AddCommand, DeleteCommand, ListCommand, etc. + + + +The *sequence diagram* above shows how the components interact with each other for the scenario +where the user issues the command `event buy lunch e/10`. + +The following sections will explain the architecture in more detail. + +### Storage component + +**API**: `Storage.java` + + + +The `Storage` component, +* can save category and event data in txt format, and read it back. (txt format is chosen because it is human readable) +* depended on by `CategoryList.java` and `CategoryCommand.java` to load data to ArrayList and HashMap, and takes in an ArrayList of Category objects as parameter to save data. + +When the user first starts the application:
+

+When the program is running:
+

+ +### Data component + +**API**: `Category.java`, `CategoryList.java`, `Event.java` + +The data structure of MoneyMind follows a very simple design. + +`CategoryList`: It uses an ArrayList to store all the categories. +Each category is an object of `Category` class. + +`Category`: It uses an ArrayList to store all the events. +Each event is an object of `Event` class. -## Product scope +`Event`: It stores the information of each event. + +The details of the definition of `Category` and `Event` can be found +in the [Glossary](#appendix-d--glossary) section. + +### Commands component + + + +**API**: `Command.java` + +The `Command` interface and classes, +* every command type is represented by a class that implements the Command interface +* can perform actions by executing different commands, such as adding category, adding event, deleting category, deleting event, viewing category, viewing event +* also depends on `CategoryList.java`, `CategoryCommand.java`, `Event.java`, to execute the commands. + +**API**: `Parser.java` + +The `Parser` class, +* responsible for parsing user input and creating the appropriate command classes +* also depends on `CategoryList.java`, `CategoryCommand.java`, `Event.java`, to execute the commands. + +## Implementation + +### Parser component + +The Parser class contains several private methods, each of which is responsible for creating a specific type of Command +object based on the user input. Each method takes in an array of strings as an argument, which contains +the user input split into keyword and the content. The method then checks the first word in the array to determine which +type of Command object to create. If the first word matches a specific keyword (e.g. "bye"), the corresponding Command +object is created and returned. If the keyword is not recognized, an InvalidCommandException is thrown. Some methods +also perform additional checks on the input string to ensure that it is formatted correctly. If the input is in correct +format, the corresponding Command object is created and returned. Otherwise, an InvalidCommandException is thrown. + +### Commands component + +The Command class is an interface that is implemented by all the different types of Command objects. It contains methods +that are common to all Command objects, such as execute() and isExit(). The execute() method contains the logic to +perform certain tasks and is called when the Command object is to be executed. The isExit() method is called to +check if the Command object is an ExitCommand object, which signals the end of the program. + +### Exceptions component + +The Exceptions class contains several types of custom Exception objects that are thrown when the user input is not +in the correct format. + +### Category component + +The components use arraylist to store events for each category and +store all categories in a category list. + +### Event component + +The components implement event class to store the information of each event. + +## Appendix A: Product Scope ### Target user profile -{Describe the target user profile} +------------------------- +

+ +
+ +* **Name**: NUS Student +* **Age**: 18-25 years old +* **Occupation**: Student +* **Education**: Currently enrolled in NUS +* **Income**: Limited income sources (part-time jobs, allowances from parents, etc.) +* **Technology usage**: Tech-savvy and comfortable using a CLI-based application +* **Interests**: Campus life, budgeting, saving, optimizing spending +* **Financial goals**: Prioritize spending, cut down on unnecessary expenses, improve financial health +* **Challenges**: Limited income, lack of financial knowledge, lack of financial discipline +* **Needs**: A simple, easy-to-use application to help manage expenses and track spending habits + +Overall, NUS Student is a financially-conscious individual who wants to prioritize spending and save for the future while +enjoying a good campus life. They are comfortable with technology and prefer an efficient and easy-to-use tool like MoneyMind +to manage their finances. They are interested in tracking their expenses by category and exploring new ways to +optimize their spending to achieve their financial goals. ### Value proposition -{Describe the value proposition: what problem does it solve?} +If you are a NUS Student who wants to prioritize spending and save for the future while enjoying a good campus life, +MoneyMind is the perfect application for you. It is a simple, easy-to-use application that helps you manage your expenses +and track your spending habits. You can easily categorize your expenses and view your spending history by category. + +As the application is CLI-based, you can easily navigate through the application and perform the necessary tasks if +you are a fast-typer. You can also use the application on any mainstream OS as long as you have Java 11 or above installed. + + +## Appendix B: User Stories + +| Version | As a ... | I want to ... | So that I can ... | +|-----|------|--------------------------------------------------------------------------------------------------------|------------------------------------------------------------| +| v1.0 | user | **add** an one time expense | keep track of how much I spend | +| | user | **delete** a one time expense | ammend the record in case I add the wrong expense | +| | user | **categorize** my expenses into different categories such as food, transportation, entertainment, etc. | better understand where my money is going | +| v2.0 | user | **edit** one time expenses | change when I type wrongly | +| | user | **search** for specific expenses by keyword or date range | easily find and review my past spending | + +## Appendix C: Non Functional Requirements + +1. MoneyMind should work on any mainstream OS as long as it has Java 11 or above installed. +2. The user is expected to be a fast-typer. MoneyMind is not optimised for users that are not +used to CLI applications. +3. This application is not built for mobile devices. It is recommended to use a laptop. +4. The user is expected to have a good habit of constantly and systematically recording their +expenses. MoneyMind is not optimised for users that only record their expense on ad-hoc basis. +5. Other than the above, please enjoy using MoneyMind! + +## Appendix D: Glossary + +* *budget* - A budget is a financial plan that outlines an individual's or +organization's expected income and expenses over a specific period of time. +In context given, the budget here is scaled down to NUS students' expenses over +different categories. +Budgets can typically include categories for different types of expenses, +such as housing, transportation, food, entertainment, and savings. +* *expense* - An expense is the cost incurred by an organization or individual. +In context given, the expense here is scaled down to NUS students' spending over +different events that they are engaged in. +* *event* - An event is a specific occurrence of expenses that is planned or occurs. +It can be a one time expense like buying a pair of sneakers or recurring expenses like +electricity bills. +* *category* - A category is a group of events that are related to each other. For example, +food, transportation, entertainment, etc. +* *one time expense* - An expense that occurs only once. +* *recurring expense* - An expense that occurs repeatedly, in the context of MoneyMind, the +frequency is set to monthly. + +## Appendix E: Instructions for Manual Testing + +### Launch + +1. Download the latest MoneyMind.jar and save it to an empty folder. +2. Open a command prompt in the folder and run the command java -jar MoneyMind.jar. The output should be similar to the below. + +``` +Loading file... +Welcome to Moneymind + __ __ __ __ _ _ + | \/ | | \/ (_) | | + | \ / | ___ _ __ ___ _ _| \ / |_ _ __ __| | + | |\/| |/ _ \| '_ \ / _ \ | | | |\/| | | '_ \ / _` | + | | | | (_) | | | | __/ |_| | | | | | | | | (_| | + |_| |_|\___/|_| |_|\___|\__, |_| |_|_|_| |_|\__,_| + __/ | + |___/ +How may I help you? +Type 'summary' to see the summary of all the commands you can use. +Type 'help' to see the details of all the commands. +``` + +### View summary of commands + +Type summary and press enter. The output should be similar to the below. + +``` +Here are the commands you can use: +1. help +2. summary +3. category +4. event +5. view +6. edit +7. delete +8. search +9. bye +``` + +### View details of commands + +Type help and press enter. The output should be similar to the below. + +``` +Here are the commands you can use: +1. help - show detailed instructions on how to use the app +Format: help +Example: help + +2. summary - show a summary of the commands that you can use +Format: summary +Example: summary + +3. category - add a category to your list +Format: category [(optional) b/] +Example: category food b/2000 + +4. event - add an event to a category +Format: event e/ [(optional) t/