Code Monkey home page Code Monkey logo

ip's Introduction

Duke

User Interface of Duke

Duke is a Personal Assistant Chatbot with task management functionality that caters to fast typists. Keep track of all your tasks with ease!

Features

Manage Your Tasks

To best cater to your task management needs, Duke supports the creation of three different types of tasks:

  • Deadlines
  • Events
  • Todos

Deadlines

Deadlines are tasks that have to be completed by a specific date and time.

Events

Events are tasks that occur at a specific date and time.

Todos

Todos are tasks that do not have a specific date and time attached to them.

All of the above tasks track whether they have been completed. In addition, for deadline and event tasks, Duke is able to filter by overdue and upcoming tasks.

Theming

Duke sports a dark theme that is gentle on the eyes. This allows for prolonged usage of Duke without having to worry about eye strain.

Resizable window

It is also possible to resize Duke if you wish to make better use of your screen real estate.

Command History

Cycling of command history

The Duke graphical user interface has an in-built command history which remembers the last 50 commands. Just like in any other terminal, you can navigate through your previous inputs by pressing the up and down key.

Command Line Support

Command line interface mode

For users who have a strong preference for command line interfaces (CLI) over graphical user interfaces, Duke is able to run in CLI mode. Simply launch the .jar file with the -c or --console flag:

java -jar duke.jar --console

Mandarin Chinese Support

Mandarin support

Duke has been designed from the ground up for i18n. All user-facing strings are set in a resource file, making the task of supporting a new language simply a matter of adding the translated strings. In addition, Duke utilises UTF-8 encoding, allowing non-latin characters to be stored without issue.

Currently, Duke supports the following languages:

  • English (en)
  • Chinese (zh)

Switching between languages is as easy as calling the language command:

language chinese

Note that the language names can be substituted with the ISO 639-1 language codes as well:

language zh

Usage

alias - Defines an alias for a command

Associates an alias with a command.

Example of usage:

alias bye b

Expected outcome:

Alias 'b' successfully added for command 'bye'.

bye - Terminates the program

Exits the program gracefully.

Example of usage:

bye

Expected outcome:

Program exits

deadline - Adds a deadline task

Adds a new deadline task to the task manager. A deadline task is a task with a description and a due date.

Example of usage:

deadline User Guide /by 15/9/2020 2359

Expected outcome:

Got it. I've added this task:
  [D][✘] User Guide (by: Sep 15 2020, 11:59 PM)
Now you have 4 tasks in the list.

delete - Deletes a task

Deletes the task at the specified index from the task manager.

Example of usage:

delete 3

Expected outcome:

Noted. I've removed this task:
  [D][✘] User Guide (by: Sep 15 2020, 11:59 PM)
Now you have 3 tasks in the list.

done - Marks a task as done

Marks the task at the specified index in the task manager as done.

Example of usage:

done 3

Expected outcome:

Nice! I've marked this task as done:
  [D][✓] User Guide (by: Sep 15 2020, 11:59 PM)

event - Adds an event task

Adds a new event task to the task manager. An event task is a task with a description and a date/time.

Example of usage:

event CS2103T Lecture /at 18/9/2020 1600

Expected outcome:

Got it. I've added this task:
  [E][✘] CS2103T Lecture (at: Sep 18 2020, 04:00 PM)
Now you have 4 tasks in the list.

find - Finds tasks based on keywords

Searches for tasks in the task manager which match the provided keywords.

Example of usage:

find 2103 guide

Expected outcome:

Here are the matching tasks in your list:
1. [D][✓] User Guide (by: Sep 15 2020, 11:59 PM)
2. [E][✘] CS2103T Lecture (at: Sep 18 2020, 04:00 PM)

help - Displays the list of commands

Displays the list of available commands along with a brief description.

Example of usage:

help

Expected outcome:

Commands:
- alias
Defines an alias for a command
- bye
Terminates the program
- deadline
Adds a deadline task to the task manager
- delete
Deletes a task from the task manager
- done
Marks a task as done
- event
Adds an event task to the task manager
- find
Searches for tasks in the task manager which match the provided keywords
- help
Displays a list of all commands along with a brief description
- list
Lists all tasks in the task manager
- overdue
Lists all overdue tasks in the task manager
- todo
Adds a todo task to the task manager
- upcoming
Lists all upcoming tasks in the task manager

language - Sets the language of Duke

Sets the language which Duke will respond in. Currently, the following languages are supported:

  • English (en)
  • Chinese (zh)

Example of usage:

language zh

Expected outcome:

语言切换为中文!

list - Lists all tasks

Lists all tasks in the task manager.

Example of usage:

list

Expected outcome:

Here are the tasks in your list:
1. [D][✘] Add GUI to iP (by: Sep 1 2020, 11:59 PM)
2. [E][✓] Project meeting (at: Sep 5 2020, 10:00 PM)
3. [D][✓] User Guide (by: Sep 15 2020, 11:59 PM)
4. [E][✘] CS2103T Lecture (at: Sep 18 2020, 04:00 PM)

overdue - Lists all overdue tasks

Lists all overdue tasks in the task manager.

Example of usage:

overdue

Expected outcome:

Here are your overdue tasks:
1. [D][✘] Add GUI to iP (by: Sep 1 2020, 11:59 PM)

todo - Adds a todo task

Adds a new todo task to the task manager. A todo task is a task with only a description.

Example of usage:

todo CS2103T Quiz 6

Expected outcome:

Got it. I've added this task:
  [T][✘] CS2103T Quiz 6
Now you have 5 tasks in the list.

upcoming - Lists all upcoming tasks

Lists all upcoming tasks in the task manager.

Example of usage:

upcoming

Expected outcome:

Here are your upcoming tasks:
1. [E][✘] CS2103T Lecture (at: Sep 18 2020, 04:00 PM)

ip's People

Contributors

damithc avatar ianyong avatar j-lum avatar jiachen247 avatar

ip's Issues

A-BetterGui: Better GUI

  • A-BetterGui: Improve the GUI

Improve the GUI to make it more polished. Some examples:

  • Tweak the GUI to match the asymmetric nature of the conversation: As the conversation is between the user and the app (not between two humans), it is asymmetric in nature. Accordingly, it makes sense not to display both sides of the conversion in the same visual format.
  • Highlight errors e.g., when the user types a wrong command, the error should be shown in a different format to catch ther user's attention.
  • Tweak padding, fonts, colors, alignments to make the GUI more pleasing to look at.
  • Profile pictures: If your GUI shows profile pictures, you can tweak the way the picture is shown (e.g., crop as a circle or a square with rounded corners). In fact, an easy tweak is to use a picture with a transparent background so that it blends nicely with the background.

You can take inspiration from these past projects. If you adopt any ideas from them, don't forget to give credit to the original author.

Refer to https://nus-cs2103-ay2021s1.github.io/website/schedule/week6/project.html#a-bettergui.

Level 8: Dates and Times

Teach Duke how to understand dates and times. For example, if the command is deadline return book /by 2/12/2019 1800, Duke should understand 2/12/2019 1800 as 2nd of December 2019, 6pm, instead of treating it as just a String.

  • Minimal: Store deadline dates as a java.time.LocalDate in your task objects. Accept dates in a format such as yyyy-mm-dd format (e.g., 2019-10-15) and print in a different format such as MMM dd yyyy e.g., (Oct 15 2019).
  • Stretch Goal: Use dates and times in more meaningful ways. e.g., add a command to print deadlines/events occurring on a specific date.

Refer to https://nus-cs2103-ay2021s1.github.io/website/schedule/week3/project.html#level-8-dates-and-times.

Level 1: Greet, Echo, Exit

Implement a skeletal version of Duke that starts by greeting the user, simply echos commands entered by the user, and exits when the user types bye.

Example:

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

list
    ____________________________________________________________
     list
    ____________________________________________________________

blah
    ____________________________________________________________
     blah
    ____________________________________________________________

bye
    ____________________________________________________________
     Bye. Hope to see you again soon!
    ____________________________________________________________
  • The indentation and horizontal lines are optional.

Refer to https://nus-cs2103-ay2021s1.github.io/website/schedule/week2/project.html#level-1-greet-echo-exit.

A-UserGuide: User Guide

  • A-UserGuide: Add a User Guide

Add a User Guide to the project. Here is one simple way to do it.

  • Update the given docs\README.md. See this guide to GitHub flavored Markdown (GFMD).
  • Go to the settings page of your Duke fork and enable GitHub pages to publish from the docs folder (you can select a theme too).
  • Go to http://{your username}.github.io/{repo name}/ to view the user guide of your product. Note: it could take 5-10 minutes for GitHub to update the page.

Refer to https://nus-cs2103-ay2021s1.github.io/website/schedule/week6/project.html#a-userguide.

Level 3: Mark as Done

Add the ability to mark tasks as done.

Example:

list
    ____________________________________________________________
     Here are the tasks in your list:
     1.[✓] read book
     2.[✗] return book
     3.[✗] buy bread
    ____________________________________________________________

done 2
    ____________________________________________________________
     Nice! I've marked this task as done: 
       [✓] return book
    ____________________________________________________________

When implementing this feature, you are also recommended to implement the following extension:

  • A-Classes: Use a class to represent tasks
    • While it is possible to represent a task list as a multi-dimensional array containing primitive values, the more natural approach is to use a Task class to represent tasks.

Refer to https://nus-cs2103-ay2021s1.github.io/website/schedule/week2/project.html#level-3-mark-as-done.

A-Gradle: Use Gradle

  • A-Gradle: Automate project builds using Gradle

Use Gradle to automate some of the build tasks of the project.

Refer to the Gradle tutorial @SE-EDU to learn how to use Gradle.

Gradle support is provided as a separate branch (named add-gradle-support) in the Duke repo. Therefore, you can follow the scenario 2 in the above guide.

  • Minimal: Set up gradle so that you can build and run Duke using gradle.
  • Recommended: Set up gradle to run unit tests.
  • Stretch Goal: Use gradle to automate more things in your project.

Refer to https://nus-cs2103-ay2021s1.github.io/website/schedule/week4/project.html#a-gradle.

Level 7: Save

Save the tasks in the hard disk automatically whenever the task list changes. Load the data from the hard disk when Duke starts up. You may hard-code the file name and location e.g., [project_root]/data/duke.txt

The format of the file is up to you. Example:

T | 1 | read book
D | 0 | return book | June 6th
E | 0 | project meeting | Aug 6th 2-4pm
T | 1 | join sports club

If you use file paths in your code,

  • remember to use relative paths rather than absolute paths such as C:\data. If not, your app can cause unpredictable results when used in another computer.
  • remember to specify file paths in an OS-independent way. If not, your app might not work when used on a different OS.

Your code must handle the case where the file doesn't exist at the start. Reason: when someone else takes your Duke and runs it for the first time, the required file might not exist in their computer. Similarly, if you expect the data file to be in as specific folder (e.g., ./data/), you must also handle the 'folder does not exist yet' case.

Refer to https://nus-cs2103-ay2021s1.github.io/website/schedule/week3/project.html#level-7-save.

A-Jar: Create a JAR File

  • A-Jar: Package the App as a JAR file

Package the app as an executable JAR file so that it can be distributed easily.

You can assume the user will run the jar file in the following way only:

  • Copy the jar file into an empty folder
  • Open a command window in that folder
  • Run the command java -jar {filename}.jar e.g., java -jar Duke.jar (i.e., run the command in the same folder as the jar file)

Refer to the tutorial Working with JAR files @SE-EDU/guides to find how to create JAR files.

Do not commit the JAR file created. Instead, you can make the JAR file available in the following manner.

  • Go to your fork on GitHub and create a new release.
  • In the page where you fill the details of th release,
    • give an appropriate version number e.g., v0.1
    • attach the JAR file where it says Attach binaries by dropping them ....

Refer to https://nus-cs2103-ay2021s1.github.io/website/schedule/week3/project.html#a-jar.

Level 6: Delete

Add support for deleting tasks from the list.

Example:

list
    ____________________________________________________________
     Here are the tasks in your list:
     1.[T][✓] read book
     2.[D][✓] return book (by: June 6th)
     3.[E][✗] project meeting (at: Aug 6th 2-4pm)
     4.[T][✓] join sports club
     5.[T][✗] borrow book
    ____________________________________________________________

delete 3
    ____________________________________________________________
     Noted. I've removed this task: 
       [E][✗] project meeting (at: Aug 6th 2-4pm)
     Now you have 4 tasks in the list.
    ____________________________________________________________

When implementing this feature, you are also recommended to implement the following extension:

  • A-Collections: Use Java Collections classes
    • Use Java Collections classes for storing data. For example, you can use an ArrayList<Task> to store the tasks.

Refer to https://nus-cs2103-ay2021s1.github.io/website/schedule/week2/project.html#level-6-delete.

Level 2: Add, List

Add the ability to store whatever text entered by the user and display them back to the user when requested.

Example:

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

read book
    ____________________________________________________________
     added: read book
    ____________________________________________________________

return book
    ____________________________________________________________
     added: return book
    ____________________________________________________________

list
    ____________________________________________________________
     1. read book
     2. return book
    ____________________________________________________________
bye
    ____________________________________________________________
     Bye. Hope to see you again soon!
    ____________________________________________________________

  • There is no need to save the data to the hard disk.
  • Assume there will be no more than 100 tasks. If you wish, you may use a fixed size array (e.g., String[100]) to store the items.

Refer to https://nus-cs2103-ay2021s1.github.io/website/schedule/week2/project.html#level-2-add-list.

BCD-Extension: Add an extension

  • Add at least one extension of your choice, selected from category B, C, or D i.e., pick just one item from one category e.g., B-DoWithinPeriodTasks or C-Sort or D-Places
  • Recommended to add the extension via a branch (branch name is up to you). Optional to add it via a PR.
  • Add a tag named BCD-Extension to the corresponding commit.

Discuss with your team members to ensure that each member picks a different extension.

You may want to pick an extension that is relevant to your tP so that the code can be reused in the tP later.

Refer to https://nus-cs2103-ay2021s1.github.io/website/schedule/week5/project.html#4-add-an-extension.

Level 5: Handle Errors

Teach Duke to deal with errors such as incorrect inputs entered by the user.

Example:

todo
    ____________________________________________________________
     ☹ OOPS!!! The description of a todo cannot be empty.
    ____________________________________________________________

blah
    ____________________________________________________________
     ☹ OOPS!!! I'm sorry, but I don't know what that means :-(
    ____________________________________________________________

When implementing this feature, you are also recommended to implement the following extension:

  • A-Exceptions: Use Exceptions to handle errors
    • Use exceptions to handle errors. For example, define a class DukeException to represent exceptions specific to Duke.
    • Minimal: handle at least the two types of errors shown in the example above.
    • Stretch goal: handle all possible errors in the current version. As you evolve Duke, continue to handle errors related to the new features added.

Refer to https://nus-cs2103-ay2021s1.github.io/website/schedule/week2/project.html#level-5-handle-errors.

A-MoreOOP: Use More OOP

  • A-MoreOOP: Make the code more OOP

Refactor the code to extract out closely related code as classes.

  • Minimal: Extract the following classes:

    • Ui: deals with interactions with the user
    • Storage: deals with loading tasks from the file and saving tasks in the file
    • Parser: deals with making sense of the user command
    • TaskList: contains the task list e.g., it has operations to add/delete tasks in the list

    For example, the code of the main class could look like this:

    public class Duke {
    
        private Storage storage;
        private TaskList tasks;
        private Ui ui;
    
        public Duke(String filePath) {
            ui = new Ui();
            storage = new Storage(filePath);
            try {
                tasks = new TaskList(storage.load());
            } catch (DukeException e) {
                ui.showLoadingError();
                tasks = new TaskList();
            }
        }
    
        public void run() {
            //...
        }
    
        public static void main(String[] args) {
            new Duke("data/tasks.txt").run();
        }
    }
    
  • Stretch Goal: Consider extracting more classes. e.g., *Command classes (i.e., AddCommand, DeleteCommand, ExitCommand etc.) that inherits from an abstract Command class, so that you can write the main logic of the App as follows:

    public void run() {
        ui.showWelcome();
        boolean isExit = false;
        while (!isExit) {
            try {
                String fullCommand = ui.readCommand();
                ui.showLine(); // show the divider line ("_______")
                Command c = Parser.parse(fullCommand);
                c.execute(tasks, ui, storage);
                isExit = c.isExit();
            } catch (DukeException e) {
                ui.showError(e.getMessage());
            } finally {
                ui.showLine();
            }
        }
    }
    

    You can get some inspiration from how the code of the addressbook-level2 is organized.

Refer to https://nus-cs2103-ay2021s1.github.io/website/schedule/week3/project.html#a-moreoop.

Level 4: ToDos, Events, Deadlines

Add support for tracking three types of tasks:

  1. ToDos: tasks without any date/time attached to it e.g., visit new theme park
  2. Deadlines: tasks that need to be done before a specific date/time e.g., submit report by 11/10/2019 5pm
  3. Events: tasks that start at a specific time and ends at a specific time e.g., team project meeting on 2/10/2019 2-4pm

Example:

todo borrow book
    ____________________________________________________________
     Got it. I've added this task: 
       [T][✗] borrow book
     Now you have 5 tasks in the list.
    ____________________________________________________________

list
    ____________________________________________________________
     Here are the tasks in your list:
     1.[T][✓] read book
     2.[D][✗] return book (by: June 6th)
     3.[E][✗] project meeting (at: Aug 6th 2-4pm)
     4.[T][✓] join sports club
     5.[T][✗] borrow book
    ____________________________________________________________

deadline return book /by Sunday
    ____________________________________________________________
     Got it. I've added this task: 
       [D][✗] return book (by: Sunday)
     Now you have 6 tasks in the list.
    ____________________________________________________________

event project meeting /at Mon 2-4pm
    ____________________________________________________________
     Got it. I've added this task: 
       [E][✗] project meeting (at: Mon 2-4pm)
     Now you have 7 tasks in the list.
    ____________________________________________________________

At this point, dates/times can be treated as strings; there is no need to convert them to actual dates/times.

Example:

deadline do homework /by no idea :-p
    ____________________________________________________________
     Got it. I've added this task: 
       [D][✗] do homework (by: no idea :-p)
     Now you have 6 tasks in the list.
    ____________________________________________________________

When implementing this feature, you are also recommended to implement the following extension:

  • A-Inheritance: Use Inheritance to support multiple task types
    • As there are multiple types of tasks that have some similarity between them, you can implement classes Todo, Deadline and Event classes to inherit from a Task class.
      Furthermore, use polymorphism to store all tasks in a data structure containing Task objects e.g., Task[100].

Refer to https://nus-cs2103-ay2021s1.github.io/website/schedule/week2/project.html#level-4-todos-events-deadlines.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.