A comprehensive command-line task management application built with Object-Oriented Programming principles and persistent file storage.
- Belinda Belange Larose
- Grace Munezero
- Kevine Umutoni
- Plamedi Mayala
🎥 Watch the complete application demo: Task Manager Walkthrough
This video demonstrates all features and functionality of the Task Manager application.
- Project Overview
- Features
- Prerequisites
- Installation
- Usage
- Project Structure
- Object-Oriented Design
- Data Storage
- Testing
- Contributing
- License
This Task Manager application demonstrates advanced Object-Oriented Programming concepts while providing a practical solution for personal productivity and task organization. Users can create, manage, and track tasks through an intuitive command-line interface with persistent data storage.
- ✅ CRUD Operations: Create, Read, Update, Delete tasks
- 📋 Task Properties: Title, description, priority, due date, category, completion status
- 🎯 Task Types: Regular tasks, Work tasks, Personal tasks
- 💾 Data Persistence: JSON file-based storage with automatic backup
- 🔍 Search & Filter: Find tasks by keywords, category, priority, or status
- 📊 Sorting: Sort by creation date, due date, priority, or title
- 📈 Statistics: Track completion rates and task analytics
⚠️ Overdue Detection: Automatic identification of overdue tasks- 📅 Due Date Tracking: Monitor tasks approaching their due dates
- 🏷️ Categorization: Organize tasks by custom categories
- 📤 Export/Import: Backup and restore task data
- 🔒 Data Validation: Comprehensive input validation and error handling
- 🔄 Auto-backup: Automatic backup system prevents data loss
Before running this application, ensure you have:
- Node.js (version 14.0.0 or higher)
- npm (Node Package Manager)
You can check your versions by running:
node --version
npm --version-
Clone the repository
git clone <repository-url> cd task-manager
-
Install dependencies
npm install
-
Run the application
npm start
For development work, you can use these additional commands:
# Install development dependencies
npm install --dev
# Run with auto-restart during development
npm run dev
# Run tests
npm test
# Code linting
npm run lint
# Code formatting
npm run format-
Launch the application:
npm start
-
You'll see the main menu with numbered options. Enter the number corresponding to your desired action.
📺 For a complete visual guide, watch our video walkthrough showing all features in action.
| Option | Description |
|---|---|
| 1 | Add Task - Create a new task with full details |
| 2 | View All Tasks - Display all tasks in your list |
| 3 | View Tasks by Filter - Filter tasks by various criteria |
| 4 | Update Task - Modify existing task properties |
| 5 | Delete Task - Remove tasks from your list |
| 6 | Toggle Task Completion - Mark tasks as complete/incomplete |
| 7 | Search Tasks - Find tasks using keywords |
| 8 | Task Statistics - View productivity analytics |
| 9 | Export/Import - Backup or restore task data |
| 0 | Exit - Close the application |
When adding a new task, you'll be prompted to enter:
- Title (required): A brief name for your task
- Description (optional): Detailed information about the task
- Priority (optional): High, Medium, or Low (default: Medium)
- Due Date (optional): Deadline in YYYY-MM-DD format
- Category (optional): Custom category for organization (default: General)
- Task Type: Choose between Regular, Work, or Personal tasks
You can filter tasks by:
- Category: Show tasks from specific categories
- Priority: Filter by High, Medium, or Low priority
- Status: Show completed or incomplete tasks
- Overdue Tasks: Display tasks past their due date
- Due Soon: Show tasks due within the next 7 days
Use the search function to find tasks by entering keywords that match:
- Task titles
- Task descriptions
- Categories
task-manager/
├── index.js # Main application entry point
├── src/ # Source code directory
│ ├── Task.js # Task class and specialized classes
│ ├── TaskManager.js # Main task management logic
│ ├── FileHandler.js # File I/O operations
│ ├── Validator.js # Data validation utilities
│ └── CLI.js # Command-line interface
├── package.json # Project configuration and dependencies
├── README.md # This documentation file
├── tasks.json # Task data storage (auto-generated)
├── tasks_backup.json # Automatic backup file (auto-generated)
├── tests/ # Test files directory
│ ├── task.test.js # Task class tests
│ ├── taskManager.test.js # TaskManager tests
│ ├── fileHandler.test.js # File operations tests
│ └── validator.test.js # Validation tests
├── docs/ # Additional documentation
└── exports/ # Directory for exported task files
This application demonstrates key OOP principles through its class structure:
The base class for all tasks with encapsulation using private fields:
class Task {
// Private fields for data protection
#id; #title; #description; #priority; #dueDate;
#category; #completed; #createdAt;
// Public methods for controlled access
markComplete()
markIncomplete()
isOverdue()
getDaysUntilDue()
// ... getters and setters
}Inheritance is demonstrated through specialized task types:
class WorkTask extends Task {
// Work-specific properties and methods
}
class PersonalTask extends Task {
// Personal task specific features
}Handles all task management operations:
class TaskManager {
addTask(taskData)
updateTask(id, updates)
deleteTask(id)
searchTasks(keyword)
filterTasks(criteria)
sortTasks(sortBy)
getTaskStats()
exportTasks(filename)
importTasks(filename)
}Manages all file operations:
class FileHandler {
loadTasks()
saveTasks(tasks)
createBackup()
exportTasks(tasks, filename)
importTasks(filename)
}Handles data validation and sanitization:
class Validator {
validateTaskData(data)
validateId(id)
sanitizeInput(input)
isValidDate(dateString)
}Manages the command-line interface:
class CLI {
showMainMenu()
handleMenuChoice(choice)
addTaskFlow()
updateTaskFlow()
deleteTaskFlow()
}Encapsulation: Private fields protect data integrity, with controlled access through public methods.
Inheritance: Specialized task classes inherit from the base Task class, promoting code reuse.
Polymorphism: Different task types can be handled uniformly through the same interface.
Abstraction: Complex operations are hidden behind simple, intuitive method calls.
Tasks are stored in JSON format in the tasks.json file:
[
{
"id": "task_1234567890_abc123",
"title": "Complete project documentation",
"description": "Write comprehensive README and setup guide",
"priority": "High",
"dueDate": "2024-12-15T00:00:00.000Z",
"category": "Work",
"completed": false,
"createdAt": "2024-12-01T10:30:00.000Z"
}
]- Automatic backup creation before each save operation
- Backup stored in
tasks_backup.json - Automatic recovery if main file becomes corrupted
- Manual export/import for additional backups
The application includes comprehensive error handling for:
- File operation failures
- Invalid user input
- Data corruption
- Network issues (future cloud integration)
- Date format validation
Execute the test suite with:
npm testTests cover:
- Task class methods and properties
- TaskManager CRUD operations
- File handling and backup systems
- Search and filter functionality
- Data validation and sanitization
- Error handling scenarios
When adding new features, ensure you:
- Write unit tests for new methods
- Test error conditions
- Verify data persistence
- Test user input validation
- Efficient Search: Optimized algorithms for filtering and searching large task lists
- Memory Management: Proper cleanup of objects and resources
- File I/O: Minimized disk operations through intelligent caching
- Error Recovery: Graceful handling of failures without data loss
- Input Sanitization: All user inputs are validated and sanitized
- File Path Validation: Safe file operations prevent path traversal attacks
- Data Integrity: Validation ensures data consistency
- Error Messages: Secure error reporting without exposing sensitive information
We welcome contributions! Please follow these steps:
- Fork the repository
- Create a feature branch
git checkout -b feature/your-feature-name
- Make your changes
- Write or update tests
- Ensure all tests pass
npm test - Commit your changes
git commit -m "Add: brief description of changes" - Push to your fork
git push origin feature/your-feature-name
- Create a Pull Request
- Use meaningful variable and function names
- Follow existing code formatting
- Add comments for complex logic
- Write tests for new features
- Update documentation as needed
Planned features for upcoming versions:
- 📱 Web-based interface
- 🔄 Real-time collaboration
- 📊 Advanced analytics dashboard
- 🔔 Due date notifications
- ☁️ Cloud storage integration
- 📱 Mobile companion app
- 🔗 Third-party integrations (Google Calendar, Slack)
Application won't start
- Ensure Node.js is installed and updated
- Run
npm installto install dependencies - Check for error messages in the console
Tasks not saving
- Verify write permissions in the application directory
- Check available disk space
- Look for backup files if main storage fails
Invalid date formats
- Use YYYY-MM-DD format for dates
- Ensure dates are realistic (not in the past for due dates)
Search not working
- Check for typos in search terms
- Try broader search terms
- Ensure tasks exist in the specified category
This project is licensed under the MIT License. See the LICENSE file for details.
For questions, bug reports, or feature requests:
- 📧 Contact the development team through your course platform
- 🐛 Create an issue on the project repository
- 📖 Check the documentation in the
docs/directory - 🎥 Watch the video walkthrough for visual guidance
- Course instructors for guidance on OOP principles and best practices
- Node.js community for excellent documentation and tools
- Team members for collaborative development and peer review
- Beta testers for valuable feedback and suggestions
Task Manager v1.0.0 - Built with ❤️ by Team Task Masters