Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Ajay Shanker] iP #117

Open
wants to merge 99 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
99 commits
Select commit Hold shift + click to select a range
4dfe0fb
Rename Chatbot from Duke to Jarvis
AjayShanker-geek Aug 22, 2024
24dd1c8
Add method to print breakline and exit
AjayShanker-geek Aug 22, 2024
07de1ac
:tada: Level-0
AjayShanker-geek Aug 22, 2024
84ac324
:memo: Level-0
AjayShanker-geek Aug 22, 2024
8e1d496
:art: Level-0
AjayShanker-geek Aug 22, 2024
833c440
Reformat code
AjayShanker-geek Aug 30, 2024
0209dec
Add Scanner
AjayShanker-geek Aug 30, 2024
bd7745e
Add method to echo user input
AjayShanker-geek Aug 30, 2024
e9fe9bd
Revert from using indention
AjayShanker-geek Aug 30, 2024
9acfbc9
Support adding and showing list
AjayShanker-geek Aug 30, 2024
ab1fe40
:sparkles: Add Task Class
AjayShanker-geek Aug 30, 2024
0fa9514
Rename items to tasks and cleanup
AjayShanker-geek Aug 30, 2024
c9e9cb7
Add more methods to Task
AjayShanker-geek Aug 30, 2024
cd600a1
Switch to switch to support more commands
AjayShanker-geek Aug 30, 2024
55ed565
:bulb: Add comments and cleanup
AjayShanker-geek Aug 30, 2024
6cc1c39
Cleanup variable inconsistancy
AjayShanker-geek Aug 30, 2024
61a974e
Formate Code
AjayShanker-geek Aug 30, 2024
20c0876
Update Task
AjayShanker-geek Sep 6, 2024
ef26b1d
Add Todo Class
AjayShanker-geek Sep 6, 2024
92e35d8
Add Dealine Class
AjayShanker-geek Sep 6, 2024
c1df0a4
Add Event
AjayShanker-geek Sep 6, 2024
51852f1
Update Javis
AjayShanker-geek Sep 6, 2024
96dc844
Improve readability
AjayShanker-geek Sep 6, 2024
a26b212
Update `runtest.sh` with correct chatbot name
AjayShanker-geek Sep 6, 2024
6b610c3
Add Input Test Cases
AjayShanker-geek Sep 6, 2024
8698da0
Update Expected output
AjayShanker-geek Sep 6, 2024
2d1dfa9
Add comments and improve code quality
AjayShanker-geek Sep 8, 2024
3e6aeaf
Create JarvisException
AjayShanker-geek Sep 11, 2024
2436660
Add class to handle errors
AjayShanker-geek Sep 11, 2024
4d30f12
Add task catch expection
AjayShanker-geek Sep 11, 2024
cf51eb5
Add Todo, Event and Deadline to catch expections
AjayShanker-geek Sep 11, 2024
bccee11
Add Error class to handle error messages and code
AjayShanker-geek Sep 11, 2024
7a5b750
Catch exceptions
AjayShanker-geek Sep 11, 2024
dfdb78c
Merge branch 'branch-Level-5'
AjayShanker-geek Sep 11, 2024
a0483b2
Divide task classes
AjayShanker-geek Sep 11, 2024
9ad849f
Divide expection classes
AjayShanker-geek Sep 11, 2024
13a9539
Update runtest script
AjayShanker-geek Sep 11, 2024
9e36e0a
Merge branch 'branch-A-Packages'
AjayShanker-geek Sep 11, 2024
71efd91
Clean up catching exceptions
AjayShanker-geek Sep 12, 2024
f1077d7
Merge branch 'A-Exceptions'
AjayShanker-geek Sep 12, 2024
0954bf6
Update Readme
AjayShanker-geek Sep 13, 2024
0733df5
Add support task as ArrayList
AjayShanker-geek Sep 18, 2024
693f805
Add support task as ArrayList
AjayShanker-geek Sep 18, 2024
2451c3b
Add support to delete task
AjayShanker-geek Sep 18, 2024
98badc3
Add saving and loading of tasks
AjayShanker-geek Sep 18, 2024
69e9c52
Add catch exceptions index out of bound
AjayShanker-geek Sep 18, 2024
586c155
Add Class to save and load
AjayShanker-geek Sep 18, 2024
24a5d7a
Merge branch 'branch-Level-6'
AjayShanker-geek Sep 18, 2024
6ed8b7e
Merge branch 'branch-Level-7'
AjayShanker-geek Sep 18, 2024
9ade014
Add checks if the data file exists
AjayShanker-geek Sep 18, 2024
42468e8
Improve test cases
AjayShanker-geek Sep 18, 2024
a31001b
Create jar manifest
AjayShanker-geek Sep 18, 2024
4a5e43a
Abstaract prompt relate as Prompt Class
AjayShanker-geek Sep 19, 2024
ee892de
Remove wild card import
AjayShanker-geek Sep 19, 2024
879414c
Clean up main after abstraction Prompt class
AjayShanker-geek Sep 19, 2024
ad8c4a2
Convert and move exit command to prompt
AjayShanker-geek Sep 19, 2024
3f4dc8c
Improve runtest.sh script
AjayShanker-geek Sep 24, 2024
db87a4c
Clean Task Class and Add TaskList
AjayShanker-geek Sep 24, 2024
f7fbb98
Add Parser and Constants
AjayShanker-geek Sep 24, 2024
637f85e
Rename Prompt to Ui
AjayShanker-geek Sep 24, 2024
1ab279b
Cleanup Main
AjayShanker-geek Sep 24, 2024
483f4cb
Restructure code to make the code more OOP
AjayShanker-geek Oct 5, 2024
0810124
Move exception into data folder
AjayShanker-geek Oct 5, 2024
841d2f3
Add TaskList and move into data folder
AjayShanker-geek Oct 5, 2024
36a8f23
Split each command into OOP
AjayShanker-geek Oct 5, 2024
5eb7fc7
Cleanup exceptions catches
AjayShanker-geek Oct 5, 2024
843aa5e
Remove variable to keep track of number of task
AjayShanker-geek Oct 5, 2024
179d7cc
Update text-ui-test
AjayShanker-geek Oct 5, 2024
369fed1
Merge pull request #1 from AjayShanker-geek/moreOOP
AjayShanker-geek Oct 5, 2024
6d16d99
Formate and delete unused codes
AjayShanker-geek Oct 5, 2024
c113d20
Add find command using stream
AjayShanker-geek Oct 10, 2024
b206860
Merge branch 'branch-Level-9'
AjayShanker-geek Oct 10, 2024
39d08af
Ensure storage file and folder exist
AjayShanker-geek Oct 10, 2024
e007cbb
Add support to catch invalid commands
AjayShanker-geek Oct 10, 2024
9cf42fe
Add support to catch deadline is not found
AjayShanker-geek Oct 10, 2024
5312669
Add support to catch event keyword not found
AjayShanker-geek Oct 10, 2024
dc1a56e
Add support to catch out of bound index
AjayShanker-geek Oct 10, 2024
befc96e
Add support catch empty datetime
AjayShanker-geek Oct 11, 2024
89488d3
Improve test cases to include edge cases
AjayShanker-geek Oct 11, 2024
d0b252b
Merge branch 'fix/exceptions'
AjayShanker-geek Oct 11, 2024
9223f71
Clean up UI
AjayShanker-geek Oct 11, 2024
5118288
Merge branch 'feature/clean-up'
AjayShanker-geek Oct 11, 2024
1ff7ade
Add JavaDoc for entry of the program
AjayShanker-geek Oct 11, 2024
c00c7dd
Add JavaDoc for storage
AjayShanker-geek Oct 11, 2024
22f850b
Add JavaDoc Tasks and Commands
AjayShanker-geek Oct 11, 2024
4c427c5
Merge branch 'branch-JavaDoc'
AjayShanker-geek Oct 11, 2024
ce50c7b
Update Docs readme
AjayShanker-geek Oct 11, 2024
1e57f41
Merge branch 'branch-UserGuide'
AjayShanker-geek Oct 11, 2024
def515e
Update runtest
AjayShanker-geek Oct 11, 2024
9d7fc3e
Update image path
AjayShanker-geek Oct 11, 2024
4e090f2
Fix image path
AjayShanker-geek Oct 11, 2024
4d5dc58
Resize image
AjayShanker-geek Oct 11, 2024
604bd97
Reduce size of the image
AjayShanker-geek Oct 11, 2024
5411175
Clean up docs
AjayShanker-geek Oct 11, 2024
caae126
Intergrated docsify
AjayShanker-geek Oct 11, 2024
9e2ba7c
Update User guide info
AjayShanker-geek Oct 11, 2024
7df86cb
Update User Guide image path
AjayShanker-geek Oct 11, 2024
ccc4f75
Fix jarvis cli image not showing
AjayShanker-geek Oct 11, 2024
fc396cb
Update repo README.md
AjayShanker-geek Oct 11, 2024
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
253 changes: 229 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,229 @@
# 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 17, 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 17** (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
____ _
| _ \ _ _| | _____
| | | | | | | |/ / _ \
| |_| | |_| | < __/
|____/ \__,_|_|\_\___|
```
# J.A.R.V.I.S project

**Jarvis** is a desktop app for managing tasks, optimized for use via a Command Line Interface (CLI). If you can type fast, Jarvis can help you manage your tasks faster than traditional Graphical User Interface (GUI) apps.

---

## Table of Contents

- [J.A.R.V.I.S project](#jarvis-project)
- [Table of Contents](#table-of-contents)
- [Quick Start](#quick-start)
- [Features](#features)
- [Adding a Todo Task: `todo`](#adding-a-todo-task-todo)
- [Adding a Deadline Task: `deadline`](#adding-a-deadline-task-deadline)
- [Adding an Event Task: `event`](#adding-an-event-task-event)
- [Listing All Tasks: `list`](#listing-all-tasks-list)
- [Marking a Task as Done: `mark`](#marking-a-task-as-done-mark)
- [Unmarking a Task: `unmark`](#unmarking-a-task-unmark)
- [Finding Tasks: `find`](#finding-tasks-find)
- [Deleting a Task: `delete`](#deleting-a-task-delete)
- [Exiting the Application: `bye` or `exit`](#exiting-the-application-bye-or-exit)
- [Saving Data](#saving-data)
- [FAQ](#faq)
- [Q: How do I transfer my data to another computer?](#q-how-do-i-transfer-my-data-to-another-computer)
- [Editing the Data File](#editing-the-data-file)
- [Command Summary](#command-summary)

---
## Quick Start

Ensure you have `Java 17` or above installed on your computer. You may download `Java 17` for your respective system [here](https://www.oracle.com/java/technologies/javase/jdk17-archive-downloads.html).

1. Download the latest Jarvis JAR file from the releases page [here](https://github.com/AjayShanker-geek/ip/releases).

2. Copy the file to the folder you want to use as the home folder for Jarvis.

3. Locate Your JAR File and copy the file path. Example:`C:\Users\YourUsername\Downloads`

4. Open a command terminal
- Windows: Click on the Start button and type `cmd`, then press `Enter` to open the Command Prompt.
- macOS/Linux: Press `Command + Space`, type `Terminal`, and hit `Enter` to open the Terminal.

5. Use `cd` to go to the folder where your JAR file is located. Example:

`cd C:\Users\YourUsername\Downloads`

6. Run the application using the following command:

`java -jar jarvis.jar`

7. After a few seconds, the application will launch in your terminal. You should see the user interface output for Jarvis as shown below: Some example commands you can try:

![Jarvis User-Interface](https://raw.githubusercontent.com/AjayShanker-geek/ip/refs/heads/master/docs/_images/ui.png)

1. Type the command in the terminal and press Enter to execute it. e.g. typing **`help`** and pressing Enter will print the list of commands available:
- *list* : Lists all tasks.
- *todo* Read book : Adds a task named "Read book" to your task list.
- *deadline* Submit report /by Aug 20 11pm : Adds a deadline task for "Submit report".
- *event* Team meeting /from Sept 1 2pm /to 4pm : Adds an event named "Team meeting" with start and end times.
- *delete* 2 : Deletes the 2rd task shown in the current list.
- *bye* or *exit* : Exits the application.

2. Refer to the Features section below for more details about each command.

---

## Features
<div markdown="block" class="alert alert-info">

**:information_source:: Notes about the command format:**<br>

* Parameters cannot be in any order for `event`.<br>
e.g. For event, the `/from` is require **comes before** `/to`. Improper ordering will result in an error. Will improve in future versions.

* Extraneous parameters for commands that do not take in parameters (such as `help`, `list` and `exit`) will be ignored.<br>
e.g. if the command specifies `help 123`, it will be interpreted as `help`.

* If you are using a PDF version of this document, be careful when copying and pasting commands that span multiple lines as space characters surrounding line-breaks may be omitted when copied over to the application.
</div>

### Adding a Todo Task: `todo`

Adds a general task.

**Format**:
```todo DESCRIPTION```

**Examples**:
- `todo Read book` Adds a todo task named "Read book" to the list.
- `todo buy groceries` Adds "buy groceries" as a todo task to the list.


### Adding a Deadline Task: `deadline`

Adds a task with a specific deadline. Useful for time-sensitive tasks.

**Format**:
```deadline DESCRIPTION /by DATE_TIME```

**Examples**:
- `deadline Submit CG2113 assignment /by Oct 10 6pm` Adds a task "Submit CS2113 assignment" with a deadline of 10th October 2024 at 6PM.
- `deadline pay rent /by Dec 1` Adds "pay rent" with a deadline of Dec 1.


### Adding an Event Task: `event`

Adds a task with both a start and end time. Ideal for scheduling events like meetings.

**Format**:
```event DESCRIPTION /from START_DATE_TIME /to END_DATE_TIME```

- Note: Ensure that the /from is require **comes before** /to.

**Examples**:
- `event Team lunch /from Dec 13 2pm 4pm` Adds "Team lunch" from 2PM on 13th December 2024 to 4PM on same day.
- `event dinner with friends /from 6pm /to 9pm` Adds "dinner with friends" from 6PM to 9PM.



### Listing All Tasks: `list`

Displays a list of all tasks currently saved.

**Format**:
```list```

**Example**:
- `list` Lists all tasks in your task list, showing their status (done or pending).



### Marking a Task as Done: `mark`

Marks a task as completed.

**Format**:
```mark TASK_NUMBER```

**Examples**:
- `mark 1` Marks the 1st task in the list as done.
- `mark 3` Marks the 3nd task in the list as done.



### Unmarking a Task: `unmark`

Marks a task as not completed (undoes the 'done' status).

**Format**:
```unmark TASK_NUMBER```

**Examples**:
- `unmark 1` Unmarks the 1st task in the list as not done.
- `unmark 2` Unmarks the 2rd task in the list as not done.

### Finding Tasks: `find`

Searches for tasks that contain a specific keyword. The number shown on the result corresponds to the original list.

**Format**:
```find KEYWORD```

- Note: The search is case-sensitive. For example, `book` will not match `Book` and `BOOK`.

**Examples**:
- `find book` Searches for all tasks that contain the word "book" and displays the results.
- `find meeting` Searches for tasks that contain the word "meeting".


### Deleting a Task: `delete`

Removes a task from the task list.

**Format**:
```delete TASK_NUMBER```

**Examples**:
- `list` followed by `delete 2` deletes the 2nd task in the list.


### Exiting the Application: `bye` or `exit`

Exits the Jarvis application.

**Format**:
```bye``` or ```exit```

**Example**:
- `bye` or `exit` Closes the application.



### Saving Data

Jarvis automatically saves your tasks to the `data/jarvis.txt` file after any changes. There is no need for manual saving.

---

## FAQ

### Q: How do I transfer my data to another computer?

A: Install the Jarvis application on the other computer and copy the `data/jarvis.txt` file to the new computer. Ensure that the file is located in the same directory as the JAR file. When you run the application, your tasks will be loaded from the file.

---

## Editing the Data File

Jarvis automatically saves your task data in a text file located at `./data/jarvis.txt`, relative to the directory where you run the program. Advanced users can update their tasks by directly editing this file.

> ⚠️**Caution:** Be cautious when editing the file directly, as improper formatting may cause errors or data loss when the application is next launched.

---

## Command Summary

| **Action** | **Format, Examples** |
|-----------|---------------------------------------------------------------------------------------------------------------------|
| **Todo** | ```todo DESCRIPTION```<br>e.g., ```todo Read a book``` |
| **Deadline** | ```deadline DESCRIPTION /by DATE_TIME```<br>e.g., ```deadline Submit report /by Sept 9 1pm``` |
| **Event** | ```event DESCRIPTION /from START_DATE_TIME /to END_DATE_TIME```<br>e.g., ```event Team meeting /from 2pm /to 4pm``` |
| **List** | ```list``` |
| **Mark** | ```mark TASK_NUMBER```<br>e.g., ```mark 1``` |
| **Unmark** | ```unmark TASK_NUMBER```<br>e.g., ```unmark 1``` |
| **Find** | ```find KEYWORD```<br>e.g., ```find book``` |
| **Delete** | ```delete TASK_NUMBER```<br>e.g., ```delete 2``` |
| **Exit** | ```bye``` or ```exit``` |

---
5 changes: 5 additions & 0 deletions data/jarvis.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
D | 1 | weekly CS2113 quiz | Monday 9pm
T | 0 | Answer CS2113 tutorial questions
T | 0 | read book
D | 0 | return book | June 6th
T | 0 | todo todo
Empty file added docs/.nojekyll
Empty file.
Loading