Skip to content

πŸ“ A simple console-based To-Do List Manager built in C++ with file persistence, task categorization, and task management features.

Notifications You must be signed in to change notification settings

musagithub1/To-do-list-manager-cpp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

πŸ“ To-Do List Manager (C++)

C++ Platform License

A feature-rich command-line To-Do List Manager built with C++11.
This application allows you to add tasks with categories, due dates, priority levels, mark them as completed, and sort them efficiently. All tasks are automatically saved to tasks.txt for persistence.


πŸš€ Features

  • βž• Add Tasks with title, category, due date, and priority
  • πŸ‘€ View All Tasks with completion status and detailed information
  • βœ… Mark Tasks as Completed with task numbering
  • πŸ”„ Sort Tasks by priority, due date, or completion status
  • πŸ’Ύ Persistent Storage (automatically saves to tasks.txt)
  • πŸ“‚ Clean project structure with Makefile support
  • 🎯 Intuitive command-line interface with emoji indicators

πŸ“Š System Architecture

graph TD
    A[main.cpp] --> B[Task.h]
    A --> C[Task.cpp]
    A --> D[tasks.txt]
    A --> E[Makefile]
    
    B --> F[Task Class Definition]
    C --> G[Task Implementation]
    C --> H[File I/O Operations]
    C --> I[Sorting Functions]
    
    D --> J[Persistent Storage<br/>Format: title;category;dueDate;priority;completed]
    E --> K[Build Automation<br/>C++11 Standard]
    
    style A fill:#e1f5fe
    style B fill:#f3e5f5
    style C fill:#f3e5f5
    style D fill:#e8f5e8
    style E fill:#fff3e0
Loading

πŸ“‚ Project Structure

To-do-list-manager-cpp/
β”œβ”€β”€ πŸ“„ main.cpp           # Main application logic with menu system
β”œβ”€β”€ πŸ“„ Task.cpp           # Task class implementation with all methods
β”œβ”€β”€ πŸ“„ Task.h             # Task class header with declarations
β”œβ”€β”€ πŸ“„ Makefile           # Build automation (g++ with C++11)
β”œβ”€β”€ πŸ“„ requirements.txt   # System requirements and compilation guide
β”œβ”€β”€ πŸ“„ tasks.txt          # Task storage file (auto-created)
β”œβ”€β”€ πŸ“„ README.md          # Project documentation
└── πŸ“„ .gitignore         # Ignore build files and executables

πŸ› οΈ Requirements

Component Version Status
C++ Compiler C++11 or higher Required
g++/clang/MSVC Latest stable Required
Make Any version Optional
OS Support Windows/Linux/macOS βœ… Tested

βš™οΈ Build & Run

🐧 Linux / macOS (Recommended)

# Clone the repository
git clone https://github.com/musagithub1/To-do-list-manager-cpp.git
cd To-do-list-manager-cpp

# Build using Makefile
make

# Run the application
./todo_app

# Clean build files when needed
make clean

πŸͺŸ Windows (Command Prompt/PowerShell)

# Clone the repository
git clone https://github.com/musagithub1/To-do-list-manager-cpp.git
cd To-do-list-manager-cpp

# Compile manually
g++ -std=c++11 -Wall main.cpp Task.cpp -o todo_app.exe

# Run the application
.\todo_app.exe

πŸ”§ Manual Compilation (Cross-platform)

# Standard compilation
g++ -std=c++11 -Wall main.cpp Task.cpp -o todo_app

# With debugging symbols
g++ -std=c++11 -Wall -g main.cpp Task.cpp -o todo_app

# Optimized release build
g++ -std=c++11 -Wall -O2 main.cpp Task.cpp -o todo_app

πŸ“Œ Usage Guide

Application Flow

flowchart TD
    A[Start Application] --> B[Load tasks.txt]
    B --> C[Main Menu Display]
    C --> D{User Choice}
    
    D -->|1| E[Add Task]
    D -->|2| F[View Tasks]
    D -->|3| G[Mark Completed]
    D -->|4| H[Save & Exit]
    
    E --> E1[Enter Title]
    E1 --> E2[Enter Category]
    E2 --> E3[Enter Due Date]
    E3 --> E4[Set Priority]
    E4 --> E5[Add to Vector]
    E5 --> C
    
    F --> F1[Display All Tasks<br/>with Status & Details]
    F1 --> C
    
    G --> G1[Enter Task Number]
    G1 --> G2[Mark as Completed]
    G2 --> C
    
    H --> H1[Save to tasks.txt]
    H1 --> I[Exit Program]
    
    style A fill:#4CAF50
    style I fill:#f44336
    style C fill:#2196F3
    style E fill:#FF9800
    style F fill:#9C27B0
    style G fill:#4CAF50
    style H fill:#607D8B
Loading

Menu Options

===== TO-DO LIST MANAGER =====
1. βž• Add Task
2. πŸ“‹ View Tasks
3. βœ… Mark Task as Completed
4. πŸ’Ύ Save & Exit

Sample Session

===== TO-DO LIST MANAGER =====
1. βž• Add Task
2. πŸ“‹ View Tasks
3. βœ… Mark Task as Completed
4. πŸ’Ύ Save & Exit
Enter your choice: 1

Enter task title: Complete C++ project
Enter category (optional): Programming

βœ… Task added successfully!

===== TO-DO LIST MANAGER =====
1. βž• Add Task
2. πŸ“‹ View Tasks
3. βœ… Mark Task as Completed
4. πŸ’Ύ Save & Exit
Enter your choice: 2

===== TASK LIST =====
1. [ ] Complete C++ project (Category: Programming)
2. [βœ…] Buy groceries (Category: Personal)

Enter your choice: 3
Enter task number to mark as completed: 1
βœ… Task marked as completed!

πŸ—οΈ Class Structure & Implementation

Task Class Design

classDiagram
    class Task {
        -string title
        -string category
        -string dueDate
        -string priority
        -bool completed
        
        +Task(title, category)
        +Task(title, category, dueDate, priority)
        +getTitle() string
        +getCategory() string
        +getDueDate() string
        +getPriority() string
        +isCompleted() bool
        +markDone() void
        
        +viewTasks(vector~Task~) static void
        +markCompleted(vector~Task~, int) static void
        +saveTasks(vector~Task~) static void
        +loadTasks(vector~Task~) static void
        +sortTasks(vector~Task~, int) static void
    }
Loading

File Format Specification

The tasks.txt file uses a semicolon-delimited format:

title;category;dueDate;priority;completed
Complete C++ project;Programming;2024-12-01;High;0
Buy groceries;Personal;2024-11-20;Medium;1
Study algorithms;Education;;Low;0

Field Descriptions:

  • title: Task description (required)
  • category: Task category (optional, can be empty)
  • dueDate: Due date in YYYY-MM-DD format (optional)
  • priority: High/Medium/Low (optional)
  • completed: 0 for pending, 1 for completed

πŸ”„ Data Flow & File Operations

sequenceDiagram
    participant User
    participant Main
    participant TaskVector
    participant FileSystem
    
    User->>Main: Start Application
    Main->>FileSystem: Load tasks.txt
    FileSystem-->>TaskVector: Parse & populate tasks
    
    loop Application Runtime
        Main-->>User: Display Menu
        User->>Main: Select option
        
        alt Add Task
            Main->>User: Request task details
            User-->>Main: Provide title, category
            Main->>TaskVector: Add new Task object
            
        else View Tasks
            Main->>TaskVector: Get all tasks
            TaskVector-->>User: Display formatted list
            
        else Mark Complete
            User->>Main: Provide task number
            Main->>TaskVector: Update task status
            
        else Sort Tasks
            User->>Main: Select sort criteria
            Main->>TaskVector: Sort by priority/date/status
        end
    end
    
    User->>Main: Exit (Option 4)
    Main->>FileSystem: Save tasks.txt
    FileSystem-->>User: Confirmation & exit
Loading

πŸ§ͺ Testing & Validation

Manual Testing Checklist

  • Basic Operations

    • Add task with title only
    • Add task with title and category
    • View empty task list
    • View populated task list
    • Mark task as completed
    • Try invalid task number
  • File Persistence

    • Add tasks and restart app
    • Verify tasks are loaded correctly
    • Check tasks.txt file format
    • Handle missing tasks.txt file
  • Edge Cases

    • Empty title input
    • Special characters in titles
    • Very long task names
    • Invalid menu choices

File Testing Commands

# Check if tasks.txt is created
ls -la tasks.txt

# View file contents
cat tasks.txt

# Verify file format
head -5 tasks.txt

πŸ“‹ Makefile Details

The included Makefile provides these targets:

# Build the application (default target)
make

# Build specific object files
make main.o
make Task.o

# Clean all build artifacts
make clean

# Force rebuild
make clean && make

Compiler Flags Used:

  • -std=c++11: Use C++11 standard
  • -Wall: Enable all common warnings
  • -c: Compile without linking (for object files)

🚧 Future Enhancements

Planned Features

  • πŸ—“οΈ Enhanced Due Dates: Date validation and overdue notifications
  • πŸ” Search & Filter: Find tasks by keyword, category, or status
  • πŸ“Š Statistics: Task completion rates and productivity metrics
  • 🎨 Colored Output: Terminal colors for better visual distinction
  • πŸ“± Export Options: JSON, CSV, and XML export formats
  • πŸ”’ Data Encryption: Optional task data encryption

Technical Improvements

  • ⚑ Performance: Optimize for large task lists (1000+ tasks)
  • πŸ›‘οΈ Error Handling: More robust file I/O error handling
  • πŸ§ͺ Unit Tests: Comprehensive test suite with assertions
  • πŸ“š Documentation: API documentation with Doxygen

πŸ—‘οΈ Maintenance Commands

# Clean build files
make clean

# Force rebuild everything
rm -f *.o todo_app && make

# Remove all generated files
make clean && rm -f tasks.txt

# Create backup of tasks
cp tasks.txt tasks_backup_$(date +%Y%m%d).txt

🀝 Contributing

We welcome contributions! Here's how to get started:

Development Setup

# Fork and clone the repository
git clone https://github.com/musagithub1/To-do-list-manager-cpp.git
cd To-do-list-manager-cpp

# Create a feature branch
git checkout -b feature/your-feature-name

# Make your changes and test
make clean && make
./todo_app

# Run manual tests
# Add some tasks, restart app, verify persistence

# Commit your changes
git add .
git commit -m "Add: your feature description"
git push origin feature/your-feature-name

Contribution Guidelines

  • Follow existing code style and formatting
  • Add comments for complex logic
  • Test your changes thoroughly
  • Update documentation if needed
  • Keep commits focused and atomic

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.


πŸ™ Acknowledgments

  • Built with modern C++11 features and best practices
  • Inspired by productivity tools and task management systems
  • Thanks to the open-source community for continuous support
  • Special recognition for clean code principles and maintainability

πŸ“ž Support

If you encounter any issues or have questions:

  1. Check the Issues: Look for existing solutions in GitHub Issues
  2. Create New Issue: Report bugs or request features
  3. Discussions: Join community discussions for help

⭐ Star this repository if you found it helpful!

Made with ❀️ and C++11

GitHub

About

πŸ“ A simple console-based To-Do List Manager built in C++ with file persistence, task categorization, and task management features.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published