Skip to content

ReduxR/task-manager

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Task Manager with CLI (C++)

A simple, fast, and functional command-line task manager built in C++. Tasks are stored with deadlines, priorities, and completion status using an AVL tree for efficient lookup and organization. Data persists between sessions using a local file.

Originally developed as a university project — but polished to be a usable real-world tool.

🚀 Features

  • ✅ Add tasks with a title, description, priority, and deadline
  • 📅 Organize tasks by deadline with fast AVL-based access
  • 📂 Persistent storage to a file (tasks.db)
  • 🧹 Mark tasks as done or remove them
  • 🔍 List tasks with filters (e.g., only for today or only done)
  • ⚙️ Clean CLI interface with flexible commands (via cxxopts)

🛠 Quick Start

✅ Compile:

g++ -std=c++17 main.cpp -o task_manager

Requires C++17 and the cxxopts.hpp header (already included).

💡 Usage

Here are some example commands to get you started:

➕ Add a task:

./task_manager add --title "Study for exam" --desc "Math and Physics" --priority 3 --deadline 2025-06-15

✅ Mark task as done:

./task_manager done --title "Study for exam"

❌ Remove a task:

./task_manager remove --title "Study for exam"

📋 List all tasks:

./task_manager list

📅 Filter by deadline:

./task_manager list --today
./task_manager list --deadline 2025-06-15

🔎 List completed tasks:

./task_manager list --done

🆘 Help:

./task_manager --help

How It Works

The app is built around two main components:

🧩 Task class

Each task includes:

  • title (required)
  • description (optional)
  • priority (default: 5)
  • deadline (format: YYYY-MM-DD, defaults to today)
  • isCompleted (true/false)

All fields are serialized as a line like:

title|description|priority|deadline|status

🌲 AVLTree class

An AVL tree stores tasks ordered by deadline. Each node contains a list of tasks for the same date. The tree:

  • Balances itself on insert/delete
  • Allows fast filtering by date
  • Internally maps titles for fast access/removal

💾 Storage

All tasks are saved in a local file: tasks.db.
It’s created automatically and updated after every command.

Want to reset your task list? Just delete the file.

📁 Project Structure

main.cpp              # CLI entry point + logic
include/cxxopts.hpp   # CLI argument parser
include/utils.hpp     # String + file helpers
tasks.db              # Persistent task storage

🙋‍♂️ Why This Project?

This was a hands-on way to:

  • Practice implementing AVL trees from scratch
  • Work with classes, file I/O, and command-line arguments

🪪 License

MIT License — free to use, modify, and share.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages