This is a simple command-line interface (CLI) application for managing tasks. The application allows users to add, update, delete, and list tasks. Tasks are stored in a JSON file (tasks.json) for persistence, and the application can update and read from this file as users interact with it. It is a solution to the following project: https://roadmap.sh/projects/task-tracker
- Add a Task: Create a new task with a unique ID, description, and initial status.
- Update a Task: Modify the description or status of an existing task.
- Delete a Task: Remove a task by its unique ID.
- List All Tasks: View all tasks along with their details such as ID, description, status, creation, and update timestamps.
- Persist Tasks: Tasks are saved to a
tasks.jsonfile, allowing for data persistence between application sessions.
Each task has the following properties:
- ID: A unique identifier for each task.
- Description: A brief summary of the task.
- Status: One of three states (
TO_DO,IN_PROGRESS,DONE). - Created At: The date and time when the task was created.
- Updated At: The date and time when the task was last updated.
- Java: Make sure you have Java installed on your system.
- JSON: The application uses the native Java I/O functionality to read from and write to a JSON file (
tasks.json).
To run the application, compile and execute the Runner class in your terminal or IDE.
javac taskTracker/Runner.java
java taskTracker.RunnerWhen you run the application, you will be presented with the following menu options:
- Create New Task: Allows you to enter a new task with a unique ID and description.
- Update Task: Allows you to update a task by its ID, changing either the description, status, or both.
- Delete Task: Allows you to delete a task by its ID.
- Exit: Exits the application.
Choose an option:
1. Create New TaskYou will be prompted to enter:
- A unique task ID (integer).
- A description of the task (string).
The task will automatically be assigned a status of TO_DO and stored in tasks.json.
Choose an option:
2. Update TaskYou will be prompted to:
- Select a task by its ID.
- Choose what to update: description, status, or both.
- Update the description or change the status (
TO_DO,IN_PROGRESS,DONE).
Choose an option:
3. Delete TaskYou will be prompted to enter the ID of the task to delete. The task will be removed from the list and the tasks.json file.
Currently, tasks are automatically listed during update and delete operations to help users identify task IDs. A separate method (listTasks) is available to display all tasks in the console.
Feel free to submit issues or pull requests to suggest improvements or fix bugs!
This project is open-source and licensed under the MIT License.