A task tracker implemented by go lang. Link to project.
- User: Interacts with the CLI to manage tasks.
- Add Task: Add a new task with a title and description.
- Update Task: Modify an existing task.
- Delete Task: Remove a task.
- Mark Task: Change the status of a task to "In Progress" or "Done."
- List All Tasks: View all tasks.
- List Done Tasks: View tasks marked as "Done."
- List Not Done Tasks: View tasks that are not marked as "Done."
- List In Progress Tasks: View tasks marked as "In Progress."
-
Task
- Attributes:
id: stringtitle: stringdescription: stringstatus: string(e.g., "Not Done", "In Progress", "Done")
- Methods:
updateTitle(newTitle: string): voidupdateDescription(newDescription: string): voidchangeStatus(newStatus: string): void
- Attributes:
-
TaskManager
- Attributes:
tasks: Task[]filePath: string
- Methods:
addTask(title: string, description: string): voidupdateTask(id: string, title?: string, description?: string): voiddeleteTask(id: string): voidmarkTask(id: string, status: string): voidlistAllTasks(): Task[]listTasksByStatus(status: string): Task[]loadTasks(): voidsaveTasks(): void
- Attributes:
-
CLI
- Attributes:
taskManager: TaskManager
- Methods:
parseInput(input: string[]): voidhandleCommand(command: string, args: string[]): void
- Attributes:
[
{
"id": "1",
"title": "Learn UML",
"description": "Understand how to create UML diagrams",
"status": "In Progress"
},
{
"id": "2",
"title": "Build CLI",
"description": "Create a command line interface for task tracking",
"status": "Not Done"
}
]- User: Inputs command
add "Learn UML" "Understand UML basics". - CLI: Parses the input and calls
taskManager.addTask("Learn UML", "Understand UML basics"). - TaskManager: Creates a new
Taskobject and adds it to thetaskslist. - TaskManager: Saves the updated tasks to the JSON file.
- CLI: Displays a success message.
- User selects the "List All Tasks" command.
- CLI calls
taskManager.listAllTasks(). - TaskManager reads the tasks from memory or loads them from the JSON file if not already loaded.
- TaskManager returns the list of tasks to the CLI.
- CLI formats and displays the tasks to the user.
This UML design provides a structured overview of the system's functionality and components, making implementation straightforward and modular.