Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
bb2d95a
Level-0. Rename, Greet, Exit
yok2086 Feb 6, 2025
8a51432
Level-1: Echo
yok2086 Feb 6, 2025
1579809
Level 2: Add, List
yok2086 Feb 6, 2025
5c1f7d5
Level-3: Mark as Done
yok2086 Feb 6, 2025
adca4dd
A-CodeStandard
yok2086 Feb 6, 2025
303d7cb
Level 4: ToDo, Events, Deadlines
yok2086 Feb 6, 2025
7d56a7d
A-TextUiTesting
yok2086 Feb 7, 2025
f9fc435
A-CodeQuality
yok2086 Feb 8, 2025
4f9f867
Revert "A-CodeQuality"
yok2086 Feb 8, 2025
317a6ea
Committed A-Code-Quality code in Level 5 Branch
yok2086 Feb 8, 2025
1b29810
Level 5. Handle Errors
yok2086 Feb 8, 2025
8d42585
Created David Exceptions to handle errors
yok2086 Feb 8, 2025
5f0320f
A-Packages : Organize into packages
yok2086 Feb 14, 2025
ec1266d
Level-6 Delete
yok2086 Feb 19, 2025
6411425
Level-7 Save
yok2086 Feb 20, 2025
0abe3f1
A-Jar
yok2086 Feb 20, 2025
08a7e42
Deleted Comments
yok2086 Feb 22, 2025
d46c87b
Fixed Load Data Delete Issues
yok2086 Mar 4, 2025
c4fd83f
A-MoreOOP : Use More OOP
yok2086 Mar 12, 2025
5c2c1e4
Level 9. Find
yok2086 Mar 12, 2025
fef593d
Merge pull request #1 from yok2086/branch-Level-9
yok2086 Mar 12, 2025
35fcfcf
A-JavaDoc : Add JavaDoc Comments
yok2086 Mar 13, 2025
3e4dc79
Merge branch 'branch-A-JavaDoc'
yok2086 Mar 13, 2025
e7b24da
A-UserGuide: User Guide
yok2086 Mar 13, 2025
5608655
Merge pull request #3 from yok2086/branch-A-UserGuide
yok2086 Mar 13, 2025
a4b0571
Added Image to David ReadMe
yok2086 Mar 13, 2025
fe8fe33
Fixed ReadMe Format
yok2086 Mar 13, 2025
f1b149a
Fixed Minor Unmark/Mark Tasks Bug
yok2086 Mar 13, 2025
68630ae
Fixed Image Issue in Readme
yok2086 Mar 13, 2025
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
203 changes: 189 additions & 14 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,205 @@
# Duke User Guide
# David User Guide

// Update the title above to match the actual product name
```
Hello from
______ ____ ,---. ,---..-./`) ______ .---.
| _ `''. .' __ `. | / | |\ .-.')| _ `''. \ /
| _ | ) _ \/ ' \ \| | | .'/ `-' \| _ | ) _ \ | |
|( ''_' ) ||___| / || | _ | | `-'`"`|( ''_' ) | \ /
| . (_) `. | _.-` || _( )_ | .---. | . (_) `. | v
|(_ ._) '.' _ |\ (_ o._) / | | |(_ ._) ' _ _
| (_.\.' / | _( )_ | \ (_,_) / | | | (_.\.' / (_I_)
| .' \ (_ o _) / \ / | | | .' (_(=)_)
'-----'` '.(_,_).' `---` '---' '-----'` (_I_)

____________________________________________________________
Hello! I'm David
What can I do for you?
____________________________________________________________


```
David is a chatbot and task manager designed to help users stay organized effortlessly. Using David, users can add,
find, track, and manage different types of tasks, such as to-dos, deadlines, and events with ease. It features a simple
command-line interface and supports automatic task saving, ensuring that users never lose track of what needs to be
done.

----------------------------------------------------------------------------------------------------

## Adding a Todo: `todo`

Adds a todo task to the task list. <br>
Description: tasks without any date/time attached to it <br>
Format: todo `DESCRIPTION`<br>
Example: `todo CS2113` <br>
Expected output:

// Product screenshot goes here
```
----------------------------------------------------------------------------------------------------
Got it. I've added this task:
[T][ ] CS2113
Now you have 6 tasks in the list.
Tasks saved to ./data/tasks.txt
----------------------------------------------------------------------------------------------------
```

## Adding a Deadline: `deadline`

Adds a deadline task to the task list. <br>
Description: tasks that need to be done before a specific date/time <br>
Format: deadline `DESCRIPTION` /by `SPECIFIC_DATE` `SPECIFIC_TIME` <br>
`SPECIFIC_DATE` should be in the format of year/month/day and `SPECIFIC_TIME` should be in `Hour:Minutes` <br>
Example: `deadline hw /by 2020/03/04 3` <br>
Expected output:
```
----------------------------------------------------------------------------------------------------
Got it. I've added this task:
[D][ ] hw (by: 2020/03/04 3)
Now you have 8 tasks in the list.
____________________________________________________________
Tasks saved to ./data/tasks.txt
----------------------------------------------------------------------------------------------------
```

----------------------------------------------------------------------------------------------------

## Adding an Event: event

Adds an event to the task list. <br>
Description: tasks that start at a specific date/time and ends at a specific date/time <br>
Format: event `DESCRIPTION` /from `START` /to `END` <br>
`START` and `END` should follow the format of `Year/Month/Day` and/or `Hour:Minutes` <br>
Example: `event project meeting /from Mon 2pm /to 4pm` <br>
Expected output:
```
----------------------------------------------------------------------------------------------------
Got it. I've added this task:
[E][ ] project meeting (from: Mon 2pm to: 4pm)
Now you have 9 tasks in the list.
____________________________________________________________
Tasks saved to ./data/tasks.txt
----------------------------------------------------------------------------------------------------
```

## Listing all tasks: list <br>

Shows a list of all tasks in the task list. <br>
Format: list <br>
Example: list <br>
Expected output: <br>

----------------------------------------------------------------------------------------------------

```
____________________________________________________________
Here are the tasks in your list:

1.[D][ ] hw (by: 2020/03/04 3)
____________________________________________________________
2.[E][ ] project meeting (from: Mon 2pm to: 4pm)
____________________________________________________________
3.[T][ ] CS2113
____________________________________________________________
```

// Product intro goes here
----------------------------------------------------------------------------------------------------

## Adding deadlines
## Marking Task as Done: mark

// Describe the action and its outcome.
Marks a task as done in the task list. <br>
Format: mark `INDEX_NUMBER` <br>
Example: `mark 1` <br>
Expected output of mark 1:

// Give examples of usage
```
____________________________________________________________
Nice! I've marked this task as done:
[X] project meeting
____________________________________________________________
```

## Marking Task as Not Done: unmark

Marks a task as not done in the task list. <br>
Format: unmark `INDEX_NUMBER` <br>
Example: `unmark 1` <br>
Expected output of unmark 1: <br>

```
____________________________________________________________
Okay! I've marked this task as not done:
[ ] hw
____________________________________________________________
Tasks saved to ./data/tasks.txt
```

----------------------------------------------------------------------------------------------------

## Deleting a task: delete

Delete a specified task from the task list. <br>
Format: delete `INDEX_NUMBER`
Example: `delete 1` <br>
Expected output of delete 1: <br>

```
----------------------------------------------------------------------------------------------------
There you go. I've removed this task for you:
[T][ ] revise CS2113 OOP
Now you have 2 tasks in the list.
----------------------------------------------------------------------------------------------------
```

----------------------------------------------------------------------------------------------------

## Finding tasks by keyword: find

Finds tasks which descriptions contain the given keyword. If task not found then, print out not found. <br>
Format: find `KEYWORD` <br>
Example: `find hw` <br>
Expected output: <br>

```
____________________________________________________________
1.[D][ ] hw (by: 2020/03/04 3)
____________________________________________________________
These tasks were found
____________________________________________________________
```

Example: find CS1231
Expected output:

```
____________________________________________________________
Could not be found
____________________________________________________________

```
----------------------------------------------------------------------------------------------------

Example: `keyword (optional arguments)`
## Leaving the program: bye

// A description of the expected outcome goes here
Leaves the program. <br>
Format: bye <br>
Example: `bye` <br>
Expected output:

```
expected output
____________________________________________________________
Bye. Hope to see you again soon!
____________________________________________________________
```
----------------------------------------------------------------------------------------------------
## Saving the Data

## Feature ABC
Data is saved automatically after any command that results in the data being changed. <br>
If the program is closed unexpectedly or improperly, any unsaved changes will be lost, and the last saved version of the
task list will be used when the program is restarted.

// Feature details
## Editing the Data

All tasks are stored in a file named tasks.txt, located in the current directory. <br>
Users can manually edit this file if needed, but modifications outside the program may lead to unexpected behavior.

## Feature XYZ

// Feature details
72 changes: 72 additions & 0 deletions src/main/java/David.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
import David.Storage;
import David.Ui;
import David.TaskList;
import David.Parser;
import David.ui.DavidException;


/**
* The main class of the David application, responsible for initializing
* the core components and handling user interactions.
*/
public class David {
private Storage storage;
private TaskList tasks;
private Ui ui;
private Parser parser;


/**
* Constructor for the David application.
* Initializes the UI, storage, task list, and command parser.
*
* @param filePath The file path where tasks are stored.
*/
public David(String filePath) {
ui = new Ui();
storage = new Storage(filePath);
try {
tasks = new TaskList(storage.loadTasks());
} catch (DavidException e) {
ui.showLoadingError();
tasks = new TaskList();
}
parser = new Parser(ui, tasks, storage);
}


/**
* Runs the main event loop of the application, handling user input.
* The loop continues until the user enters the exit command.
*/
public void run() {
ui.printGreeting();
ui.printHello();
boolean isExit = false;
while (!isExit) {
String input = ui.readLine();
isExit = parser.readCommand(input);
}
ui.printBye();
}


/**
* The main entry point of the program.
* Initializes the application and starts the event loop.
*
* @param args Command-line arguments (not used).
*/
public static void main(String[] args) {
new David("./data/tasks.txt").run();
}
}









Loading