Skip to content

Swapnilden/Priorix

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

13 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Priorix

A feature-rich command-line task manager built in Java that helps you organize and manage your tasks efficiently with priority levels, due dates, and persistent storage.

Java Status

โœจ Features

  • โœ… Add Tasks with due dates and priority levels (LOW, MEDIUM, HIGH)
  • โœ… List Tasks sorted automatically by priority and due date
  • โœ… Mark Tasks as Done to track completion
  • โœ… Delete Tasks with confirmation prompts
  • โœ… Undo Deletion to restore accidentally deleted tasks
  • โœ… Persistent Storage in tasks.txt file
  • โœ… Smart Sorting by priority (HIGH โ†’ MEDIUM โ†’ LOW) and due date
  • โœ… User-Friendly CLI with input validation

๐Ÿš€ Quick Start

Prerequisites

  • Java Development Kit (JDK) 11 or higher
  • Command line / Terminal access

Installation & Running

  1. Clone the repository
git clone https://github.com/yourusername/task-manager-cli.git
cd task-manager-cli
  1. Compile the program
javac TaskManager.java TaskStorage.java Task.java
  1. Run the program
java TaskManager

๐Ÿ“ Project Structure

task-manager-cli/
โ”œโ”€โ”€ TaskManager.java      # Main program with CLI interface
โ”œโ”€โ”€ Task.java            # Task model with priority and date handling
โ”œโ”€โ”€ TaskStorage.java     # File I/O operations for persistence
โ”œโ”€โ”€ tasks.txt           # Auto-generated task storage file
โ””โ”€โ”€ README.md           # Project documentation

๐Ÿ“ Usage Guide

Main Menu Options

==================
 Task Manager 
==================
1. Add Task
2. List Tasks
3. Mark Task as Done
4. Delete Task
5. Undo Last Deletion
6. Exit

Detailed Usage

1๏ธโƒฃ Add a Task

Enter task description: Complete Java project
Enter due date (YYYY-MM-DD): 2024-12-31
Enter priority (LOW, MEDIUM, HIGH): HIGH
  • Description: Any text describing your task
  • Due Date: Format must be YYYY-MM-DD
  • Priority: Choose from LOW, MEDIUM, or HIGH

2๏ธโƒฃ List Tasks

Displays all tasks sorted by:

  1. Priority (HIGH โ†’ MEDIUM โ†’ LOW)
  2. Due date (earliest first)

Example output:

1. [done] Complete Java project | Due: 2024-12-31 | Priority: HIGH
2. [ ] Study for exam | Due: 2024-12-15 | Priority: MEDIUM
3. [ ] Buy groceries | Due: 2024-12-10 | Priority: LOW

3๏ธโƒฃ Mark Task as Done

  • View the list of tasks
  • Enter the task number to mark as complete
  • Task will be marked with [done] prefix

4๏ธโƒฃ Delete Task

  • View the list of tasks
  • Enter the task number to delete
  • Confirm deletion with yes or no
  • Deleted task is saved for undo functionality

5๏ธโƒฃ Undo Last Deletion

  • Restores the most recently deleted task
  • Multiple undos supported (Stack-based implementation)
  • Tasks are restored with original priority and position

6๏ธโƒฃ Exit

  • Saves all tasks automatically
  • Closes the application

๐ŸŽฏ Key Features Explained

Priority Levels

  • HIGH: Urgent and important tasks
  • MEDIUM: Important but not urgent
  • LOW: Nice to have tasks

Automatic Sorting

Tasks are automatically sorted using a custom Comparable implementation:

  1. First by priority (HIGH โ†’ MEDIUM โ†’ LOW)
  2. Then by due date (earliest first)

Persistent Storage

  • Tasks are saved to tasks.txt after every operation
  • File format: [status] description | Due: date | Priority: level
  • Automatically loads tasks on startup

Undo Feature

  • Uses a Stack data structure to store deleted tasks
  • Supports multiple consecutive undos
  • Restores tasks with original properties

๐Ÿ› ๏ธ Technical Details

Classes Overview

Task.java

  • Implements Serializable and Comparable<Task>
  • Properties: description, isDone, dueDate, priority
  • Custom sorting logic based on priority and due date
  • Formatted string representation

TaskManager.java

  • Main CLI interface with menu-driven navigation
  • Input validation and error handling
  • Stack-based undo functionality
  • Integrates with TaskStorage for persistence

TaskStorage.java

  • Handles file I/O operations
  • Loads tasks from tasks.txt on startup
  • Saves tasks after each operation
  • Parses task format from file

Data Structures Used

  • ArrayList: For storing the main task list
  • Stack: For implementing undo functionality
  • LocalDate: For date handling and formatting
  • Enum: For priority levels

๐ŸŽจ Example Workflow

# Start the program
$ java TaskManager

# Add a high-priority task
1. Add Task
Enter task description: Submit project report
Enter due date (YYYY-MM-DD): 2024-12-20
Enter priority (LOW, MEDIUM, HIGH): HIGH
Task added successfully.

# List all tasks
2. List Tasks
1. [ ] Submit project report | Due: 2024-12-20 | Priority: HIGH

# Mark task as done
3. Mark Task as Done
Enter task number to mark as done: 1
Task marked as done.

# Delete a task
4. Delete Task
Enter task number to delete: 1
Are you sure you want to delete this task? (yes/no): yes
Task deleted. You can undo this action.

# Undo deletion
5. Undo Last Deletion
Task restored successfully!

๐Ÿ”ง Customization

Adding New Priority Levels

Edit the Priority enum in Task.java:

public enum Priority { LOW, MEDIUM, HIGH, URGENT, CRITICAL }

Changing File Storage Location

Modify the FILE_NAME constant in TaskStorage.java:

private static final String FILE_NAME = "path/to/your/tasks.txt";

Custom Date Format

Update the DateTimeFormatter in Task.java:

DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd/MM/yyyy");

๐Ÿ› Error Handling

The application handles:

  • โœ… Invalid menu choices
  • โœ… Invalid date formats
  • โœ… Invalid priority values
  • โœ… Invalid task numbers
  • โœ… Empty task lists
  • โœ… File I/O errors
  • โœ… Non-numeric input

๐Ÿค Contributing

Contributions are welcome! Here's how you can help:

  1. Fork the repository
  2. Create a feature branch
   git checkout -b feature/AmazingFeature
  1. Commit your changes
   git commit -m 'Add some AmazingFeature'
  1. Push to the branch
   git push origin feature/AmazingFeature
  1. Open a Pull Request

Ideas for Contribution

  • ๐ŸŽจ Add color-coded output for priorities
  • ๐Ÿ“Š Add task statistics and reports
  • ๐Ÿ” Implement search functionality
  • ๐Ÿ“ฑ Add recurring tasks feature
  • ๐ŸŒ Export tasks to different formats (JSON, CSV)
  • โฐ Add reminder notifications
  • ๐Ÿท๏ธ Add task categories/tags

๐Ÿ‘จโ€๐Ÿ’ป Author

Your Name

๐Ÿ™ Acknowledgments

  • Java SE Documentation for best practices
  • Stack Overflow community for problem-solving insights
  • Open source community for inspiration

๐Ÿ“š Learning Resources

If you're new to Java or want to understand the concepts used:

๐Ÿ”ฎ Future Enhancements

  • Add task categories/tags
  • Implement recurring tasks
  • Add task search and filter
  • Color-coded priority display
  • Export to JSON/CSV
  • Task statistics dashboard
  • Email notifications
  • Multi-user support
  • GUI version using JavaFX

Made with โ˜• and Java

Happy Task Managing! ๐Ÿ“

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages