|
| 1 | +# Task Manager |
| 2 | + |
| 3 | +A simple and efficient task management application built with React and TypeScript. Keep track of your tasks, mark them as complete, and organize them with filtering and sorting capabilities. |
| 4 | + |
| 5 | +## Features |
| 6 | + |
| 7 | +- **Add Tasks**: Quickly add new tasks with a simple input form |
| 8 | +- **Mark Complete**: Toggle tasks between active and completed states |
| 9 | +- **Filter Tasks**: View all tasks, only active tasks, or only completed tasks |
| 10 | +- **Sort Tasks**: Alphabetically sort your tasks in ascending or descending order |
| 11 | +- **Persistent Storage**: Tasks are automatically saved to localStorage and persist between sessions |
| 12 | +- **Keyboard Shortcuts**: Press Escape to clear the input field |
| 13 | +- **Task Counter**: See how many tasks you've added in the current session |
| 14 | + |
| 15 | +## Usage |
| 16 | + |
| 17 | +### Adding Tasks |
| 18 | + |
| 19 | +1. Type your task in the input field |
| 20 | +2. Press Enter or click the "Add Task" button |
| 21 | +3. Your task will appear in the list below |
| 22 | + |
| 23 | +### Managing Tasks |
| 24 | + |
| 25 | +- **Complete a task**: Click the checkbox next to a task to mark it as complete |
| 26 | +- **Delete a task**: Click the "Delete" button to remove a task |
| 27 | +- **Filter tasks**: Use the "All", "Active", or "Completed" buttons to filter your view |
| 28 | +- **Sort tasks**: Click the "Sort" button to toggle between ascending, descending, and unsorted views |
| 29 | + |
| 30 | +### Keyboard Shortcuts |
| 31 | + |
| 32 | +- **Escape**: Clear the input field (useful for quickly starting over) |
| 33 | + |
| 34 | +## Technical Details |
| 35 | + |
| 36 | +### Built With |
| 37 | + |
| 38 | +- React 18 |
| 39 | +- TypeScript |
| 40 | +- Local Storage API for persistence |
| 41 | + |
| 42 | +### Components |
| 43 | + |
| 44 | +- **TaskList**: Main container component managing state and task operations |
| 45 | +- **TaskItem**: Individual task display with checkbox and delete button |
| 46 | +- **AddTaskForm**: Input form for creating new tasks |
| 47 | +- **useLocalStorage**: Custom hook for localStorage persistence |
| 48 | + |
| 49 | +### Data Persistence |
| 50 | + |
| 51 | +All tasks are automatically saved to your browser's localStorage. Your tasks will be available even after closing and reopening the browser, as long as you're using the same browser on the same device. |
| 52 | + |
| 53 | +## Development |
| 54 | + |
| 55 | +This is a TypeScript React application. The components follow React best practices with proper state management, memoization, and effect cleanup. |
| 56 | + |
| 57 | +### File Structure |
| 58 | + |
| 59 | +``` |
| 60 | +├── task-list.tsx # Main component with task management logic |
| 61 | +├── task-item.tsx # Individual task display component |
| 62 | +├── add-task-form.tsx # Form for adding new tasks |
| 63 | +└── use-local-storage.ts # Custom hook for localStorage integration |
| 64 | +``` |
| 65 | + |
| 66 | +## Browser Support |
| 67 | + |
| 68 | +Works in all modern browsers that support: |
| 69 | +- ES6+ JavaScript |
| 70 | +- localStorage API |
| 71 | +- React 18 |
| 72 | + |
| 73 | +## Notes |
| 74 | + |
| 75 | +- Tasks are stored per-browser, not synced across devices |
| 76 | +- Maximum storage is limited by browser localStorage limits (typically ~5-10MB) |
| 77 | +- Task IDs are generated using timestamps for uniqueness |
0 commit comments