The Advanced Time Management System is a comprehensive console-based application designed to help users manage their tasks and track the time spent on each task efficiently. Built using TypeScript, the application leverages the inquirer library for interactive command-line prompts and fs-extra for file operations, ensuring that all task data is persistently stored and retrievable.
-
Add Task:
- Allows users to create new tasks by providing a title and description.
- Each task is assigned a unique ID for easy identification and management.
-
Start Task:
- Enables users to start a timer for a selected task.
- Records the start time of the task, allowing for precise time tracking.
-
Stop Task:
- Allows users to stop the timer for a selected task.
- Records the end time and calculates the total time spent on the task, adding it to the task's cumulative time.
-
View Tasks:
- Displays a list of all tasks, including their details such as ID, title, description, total time spent, and individual time logs.
- Provides a clear and organized view of each task’s time logs, showing start and end times for each logged session.
- index.ts: The main file containing all the logic and functionality of the time management system. It includes functions for adding tasks, starting and stopping timers, and viewing task logs.
- tasks.json: A JSON file used to store task data persistently. This file is read and written to by the application to maintain the state of tasks between sessions.
-
Initialization:
- The project is set up by initializing a Node.js project and installing the necessary dependencies, including TypeScript,
ts-node,inquirer, andfs-extra.
- The project is set up by initializing a Node.js project and installing the necessary dependencies, including TypeScript,
-
Main Menu:
- The application starts by displaying a main menu with options to add a task, start a task, stop a task, view tasks, or exit the application.
- Users interact with the menu using command-line prompts provided by the
inquirerlibrary.
-
Task Management:
- Add Task: Users are prompted to enter a title and description for a new task. The task is then added to the list and saved to the
tasks.jsonfile. - Start Task: Users select a task by ID to start the timer. The start time is recorded, and the task’s details are updated in the
tasks.jsonfile. - Stop Task: Users select a task by ID to stop the timer. The end time is recorded, the total time spent on the task is updated, and the task’s details are saved to the
tasks.jsonfile. - View Tasks: The application displays all tasks with their details, including the total time spent and individual time logs.
- Add Task: Users are prompted to enter a title and description for a new task. The task is then added to the list and saved to the
- The application uses the
fs-extralibrary for file operations, ensuring that all task data is saved to thetasks.jsonfile. - Tasks are loaded from the file when the application starts, and any changes (e.g., adding tasks, starting/stopping timers) are saved back to the file immediately.
- Efficiency: Helps users manage their time more effectively by tracking the time spent on various tasks.
- Organization: Provides a clear and organized way to view tasks and their associated time logs.
- Persistence: Ensures that task data is not lost between sessions by storing it in a JSON file.
This project provides a robust solution for time management, allowing users to keep track of their tasks and the time spent on each, thus improving productivity and time management skills.