Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
0d5d223
Update name and add greeting
Aug 24, 2023
68f2743
Add echo function and exit functionality
Aug 29, 2023
d49c61b
Add list functionality and improve structure
Aug 29, 2023
93a262a
Add task completion feature
Aug 29, 2023
0160070
Add Todo, Deadline, and Event functionality
Sep 5, 2023
39066db
Modularise code and handle errors
Sep 13, 2023
1e8e89c
Handle blank input
Sep 13, 2023
7497866
Merge branch 'branch-Level-5'
Sep 13, 2023
53fe1c1
Update logo and README
Sep 13, 2023
573753f
Divide classes into packages
Sep 13, 2023
2f26c3e
Merge branch 'branch-A-Packages'
Sep 13, 2023
d4a0275
Add delete functionality
Sep 19, 2023
7d83a76
Add functionality to auto-load from save file
Oct 3, 2023
94e3ec6
Add automatic local save of newly added tasks
Oct 3, 2023
a0d2920
Merge branch-Level-7
Oct 3, 2023
e7544e2
Extract storage functionality into HerbertReader class
Oct 4, 2023
97df355
Extract UI and parsing functionality
Oct 4, 2023
cf187a1
Rename and refactor packages
Oct 4, 2023
5abc26c
Add JavaDoc comments
Oct 4, 2023
70bf7fe
Add dates to deadlines and events
Oct 4, 2023
4e07a60
Add search functionality for tasks
Oct 4, 2023
3cafb52
Add "find" to list of commands
Oct 4, 2023
b7a2649
Update documentation regarding dates
Oct 4, 2023
09561d8
Merge pull request #1 from antrikshdhand/branch-Level-8
antrikshdhand Oct 4, 2023
82dea9e
Merge branch 'master' into branch-Level-9
antrikshdhand Oct 4, 2023
91935c9
Merge pull request #2 from antrikshdhand/branch-Level-9
antrikshdhand Oct 4, 2023
a374ae0
Update Javadoc comments
Oct 4, 2023
5658758
Update User Guide
Oct 5, 2023
927be26
Update README.md
Oct 5, 2023
3c37c92
Fix save functionality on deletion and update of tasks
Oct 5, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,9 @@ bin/

/text-ui-test/ACTUAL.TXT
text-ui-test/EXPECTED-UNIX.TXT

# Ignore .class files
*.class

# Ignore ./data directory
/data
67 changes: 43 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,43 @@
# Duke project template

This is a project template for a greenfield Java project. It's named after the Java mascot _Duke_. Given below are instructions on how to use it.

## Setting up in Intellij

Prerequisites: JDK 11, update Intellij to the most recent version.

1. Open Intellij (if you are not in the welcome screen, click `File` > `Close Project` to close the existing project first)
1. Open the project into Intellij as follows:
1. Click `Open`.
1. Select the project directory, and click `OK`.
1. If there are any further prompts, accept the defaults.
1. Configure the project to use **JDK 11** (not other versions) as explained in [here](https://www.jetbrains.com/help/idea/sdk.html#set-up-jdk).<br>
In the same dialog, set the **Project language level** field to the `SDK default` option.
3. After that, locate the `src/main/java/Duke.java` file, right-click it, and choose `Run Duke.main()` (if the code editor is showing compile errors, try restarting the IDE). If the setup is correct, you should see something like the below as the output:
```
Hello from
____ _
| _ \ _ _| | _____
| | | | | | | |/ / _ \
| |_| | |_| | < __/
|____/ \__,_|_|\_\___|
```
# Project Herbert

```
__ __ _______ ______ _______ _______ ______ _______
| | | || || _ | | _ || || _ | | |
| |_| || ___|| | || | |_| || ___|| | || |_ _|
| || |___ | |_||_ | || |___ | |_||_ | |
| || ___|| __ || _ | | ___|| __ | | |
| _ || |___ | | | || |_| || |___ | | | | | |
|__| |__||_______||___| |_||_______||_______||___| |_| |___|
```

Welcome to Herbert, the newest and friendliest AI assistant on the market.

## Getting started

1. Download the `.jar` file from the latest release and move it to a folder of your choice.
2. In your terminal, navigate to the folder containing the `.jar` file.
3. Run `java -jar ip.jar`.


## Commands

Visit our [user guide](https://antrikshdhand.github.io/ip) for a full explanation of each command!

| Command | Usage |
|----------|-----------------------------------------------------------|
| list | `list` |
| mark | `mark <task number>` |
| unmark | `unmark <task number>` |
| delete | `delete <task number>` |
| todo | `todo <description>` |
| deadline | `deadline <description> /by <YYYY-MM-DD>` |
| event | `event <description> /from <YYYY-MM-DD> /to <YYYY-MM-DD>` |
| find | `find <search query>` |
| help | `help` |
| bye | `bye` |

## Contact

Antriksh Dhand – `A0278458J` – `e1139698@u.nus.edu`

Project link: https://github.com/antrikshdhand/ip
147 changes: 131 additions & 16 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,144 @@
# User Guide
# Project Herbert

## Features
```
__ __ _______ ______ _______ _______ ______ _______
| | | || || _ | | _ || || _ | | |
| |_| || ___|| | || | |_| || ___|| | || |_ _|
| || |___ | |_||_ | || |___ | |_||_ | |
| || ___|| __ || _ | | ___|| __ | | |
| _ || |___ | | | || |_| || |___ | | | | | |
|__| |__||_______||___| |_||_______||_______||___| |_| |___|
```

### Feature-ABC
Welcome to Herbert, the newest and friendliest AI assistant on the market.

Description of the feature.
## Features

### Feature-XYZ
Herbert's main purpose is to help you organise your life's never-ending list of todos, deadlines, and events.

Description of the feature.
Through a simple command-line interface, you can add and remove tasks, mark tasks as complete or incomplete, and even search through your existing tasks by keyword!

## Usage
![Herbert's main menu](chatbot_home.png)

### `Keyword` - Describe action
### How Herbert handles tasks

Describe the action and its outcome.
There are three main types of tasks you can input into your chatbot: `Todo`, `Deadline` and `Event`. Of course, all three types must contain a description surrounding what the task entails; the distinction between the three comes with the metadata stored alongside the description.

Example of usage:
#### [T] Todo

`keyword (optional arguments)`
A todo is the simplest type of task you can input into Herbert. All that is stored in a todo is a description of what the task is about.

Expected outcome:
e.g. `[T][ ] Put the bins out`, `[T][X] Wash the dishes`

Description of the outcome.
There is no sense of time associated with the todo: only a sense of whether the task has been completed or not.

```
expected output
```
#### [D] Deadline

A deadline is a todo which has a temporal property associated with it, namely _when_ the task must be completed by.

e.g. `[D][ ] CS2113 Individual Project (by: 2023-10-06)`

A deadline must always have a due date associated with it. The due date must be specified by the user in ISO-8601 format: `YYYY-MM-DD`.

#### [E] Event

An event is a task which takes places over a period of time. Therefore, associated with each event are _two_ dates to signify the _start_ and _end_ of the task.

e.g. `[E][ ] CS2113 tP Iteration 1 (from: 2023-10-09 to: 2023-10-19)`

Both the `from` and `to` dates must be specified by the user in ISO-8601 format: `YYYY-MM-DD`.

### Local storage of tasks

Herbert wouldn't be very helpful if he forgot your list of tasks each time you restarted him! But you can rest assured that at any moment, a copy of your tasks is stored to your local hard-drive from which Herbert will automatically repopulate your task list from on startup. Whenever you add, delete, or update a task, the changes will be reflected in the local storage.

## Commands

### `list`

Lists all current tasks stored by Herbert.

Usage: `list`

### `mark`

Mark a task as completed.

- The task number must be a positive integer [1, 2, ...]

Usage: `mark <task number>`

### `unmark`

Mark a task as incomplete.

- The task number must be a positive integer [1, 2, ...]

Usage: `unmark <task number>`

### `delete`

Delete a task from the list.

- The task number must be a positive integer [1, 2, ...]

Usage: `delete <task number>`

### `todo`

Add a new todo to the list of tasks.

Usage: `todo <description>`

### `deadline`

Add a new deadline to your list of tasks.

- Due date must be specified in YYYY-MM-DD format.

Usage: `deadline <description> /by <YYYY-MM-DD>`

### `event`

Add a new event to your list of tasks.

- Start and end dates must be specified in YYYY-MM-DD format.

Usage: `event <description> /from <YYYY-MM-DD> /to <YYYY-MM-DD>`

### `find`

Search for keywords amongst all tasks in your list.

- The search is case-insensitive. e.g `assignment` will match `Assignment`
- The order of the keywords matters. e.g. `final exam` will not match `exam final`
- The search query is atomic; that is, individual words in the search query are not searched for but rather the complete string.

Usage: `find <search query>`

### `help`

Show all possible user inputs with usage prompts.

Usage: `help`

### `bye`

Exit the Herbert application.

Usage: `bye`

### Command summary

| Command | Usage |
|----------|-----------------------------------------------------------|
| list | `list` |
| mark | `mark <task number>` |
| unmark | `unmark <task number>` |
| delete | `delete <task number>` |
| todo | `todo <description>` |
| deadline | `deadline <description> /by <YYYY-MM-DD>` |
| event | `event <description> /from <YYYY-MM-DD> /to <YYYY-MM-DD>` |
| find | `find <search query>` |
| help | `help` |
| bye | `bye` |
Binary file added docs/chatbot_home.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 0 additions & 10 deletions src/main/java/Duke.java

This file was deleted.

3 changes: 3 additions & 0 deletions src/main/java/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Manifest-Version: 1.0
Main-Class: Main

10 changes: 10 additions & 0 deletions src/main/java/Main.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import herbert.Herbert;

public class Main {

public static void main(String[] args) {
Herbert herbert = new Herbert();
herbert.run();
}

}
89 changes: 89 additions & 0 deletions src/main/java/herbert/Command.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
package herbert;

/**
* Stores all legal Herbert commands, mostly for documentation purposes.
* The toString() method has been overridden with descriptive text for each command. This is printed when the
* `help` command is input by the user into the chatbot.
*/
public enum Command {
LIST {
@Override
public String toString() {
return "\tList all current tasks."
+ System.lineSeparator()
+ "\tUsage: list";
}
},
MARK {
@Override
public String toString() {
return "\tMark a task as completed."
+ System.lineSeparator()
+ "\tUsage: mark <task number>";
}
},
UNMARK {
@Override
public String toString() {
return "\tMark a task as incomplete."
+ System.lineSeparator()
+ "\tUsage: unmark <task number>";
}
},
DELETE {
@Override
public String toString() {
return "\tDelete a task from your list."
+ System.lineSeparator()
+ "\tUsage: delete <task number>";
}
},
TODO {
@Override
public String toString() {
return "\tAdd a new todo to your list of tasks."
+ System.lineSeparator()
+ "\tUsage: todo <task description>";
}
},
DEADLINE {
@Override
public String toString() {
return "\tAdd a new deadline to your list of tasks. Due date must be specified in YYYY-MM-DD format."
+ System.lineSeparator()
+ "\tUsage: deadline <task description> /by <due date>";
}
},
EVENT {
@Override
public String toString() {
return "\tAdd a new event to your list of tasks. Start and end dates must be specified in YYYY-MM-DD format."
+ System.lineSeparator()
+ "\tUsage: event <task description> /from <start> /to <end>";
}
},
FIND {
@Override
public String toString() {
return "\tSearch for keywords amongst all tasks in your list."
+ System.lineSeparator()
+ "\tUsage: find <search query>";
}
},
HELP {
@Override
public String toString() {
return "\tShow this help menu."
+ System.lineSeparator()
+ "\tUsage: help";
}
},
BYE {
@Override
public String toString() {
return "\tExit the Herbert application."
+ System.lineSeparator()
+ "\tUsage: bye";
}
}
}
7 changes: 7 additions & 0 deletions src/main/java/herbert/DukeException.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package herbert;

public class DukeException extends Exception {
public DukeException(String errorMessage) {
super(errorMessage);
}
}
Loading