Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Task Manager

An advanced Task Manager built with React (Vite, JavaScript) — filtering, theming, drag-and-drop reordering, and localStorage persistence. Fully self-contained in the repo root.

Live demo: https://limetrey-assignment.vercel.app/

Features (assignment checklist)

# Requirement Status
1a Add tasks ✅ empty/whitespace-only text is rejected
1b Mark tasks as completed ✅ strikethrough style
1c Delete tasks
1d Filter tasks (All / Completed / Pending) FilterBar
1e Persist tasks in Local Storage useLocalStorage hook
2a Custom hooks src/hooks/useLocalStorage.js
2b Context API instead of prop drilling TaskContext + ThemeContext
2c Performance: React.memo, useCallback, useMemo ✅ see Optimizations
2d Form validation (no empty tasks)
3a Theming (Dark / Light toggle) data-theme on <body>, CSS variables
3b Animations (add/remove task transitions) ✅ pure CSS: fade + slide-in on add, fade-out before delete (220ms)
3c Responsive design (mobile-first) ✅ single column → centered card ≥600px, 44px tap targets
3d Task drag-and-drop ✅ @hello-pangea/dnd
Submission: commit to GitHub ✅ see Deployment

What I used

  • Vite + React (JavaScript) — no TypeScript
  • React Context API — task state, actions and theme state, no prop drilling
  • Custom hookuseLocalStorage (lazy JSON parse read, useEffect write, fallback on error)
  • @hello-pangea/dnd — the maintained fork of react-beautiful-dnd, which is unmaintained and breaks under React 18+ Strict Mode. Rows are draggable; checkbox and Delete stay interactive (library blocks drag from those controls).
  • Plain CSS — mobile-first, CSS custom properties (--bg, --text, --card-bg, --border, --accent, ...) for light/dark theming; CSS keyframes + transitions for all animations (no animation library)
  • Oxlint (from the Vite template) for linting

How to run

npm install
npm run dev

then open the printed URL (http://localhost:5173). Node 18+ required.

Optimizations applied

  • useLocalStorage — localStorage read once via lazy initializer; writes via useEffect only, when value changes
  • TaskItem wrapped in React.memo — a row only re-renders when its own data changes
  • addTask, toggleTask, deleteTask, moveTask, toggleTheme wrapped in useCallback (empty deps via the updater form of setTasks) — stable references for memoization to work
  • filteredTasks in useMemo — recomputed only when tasks or filter change
  • Provider value objects wrapped in useMemo — stable context identity prevents needless consumer re-renders
  • moveTask reorders within the visible/filtered order (hidden tasks keep their position) and persists through useLocalStorage
  • Filtering logic shared via a single matchesFilter helper — no duplication
  • Animations are pure CSS (animation on mount, .exiting transition before removal) — no transform/drag conflicts, so drag-and-drop stays buttery while tasks fade in/out

Folder structure

.
├── README.md
├── .gitignore
├── index.html
├── package.json
├── vite.config.js
├── screenshots/
│   ├── light.png
│   ├── dark.png
│   └── lighthouse.png
└── src/
    ├── main.jsx                  React entry
    ├── App.jsx                   composition root (providers + layout)
    ├── App.css                   mobile-first styles + theme CSS variables
    ├── index.css                 base reset
    ├── components/
    │   ├── TaskForm.jsx          add-task input + validation
    │   ├── TaskItem.jsx          single task row (memoized, draggable, animated)
    │   ├── TaskList.jsx          list + DragDropContext + Droppable
    │   ├── FilterBar.jsx         All / Completed / Pending
    │   └── ThemeToggle.jsx       light/dark switch
    ├── context/
    │   ├── TaskContext.jsx       tasks, actions, filter, filteredTasks
    │   └── ThemeContext.jsx      theme state, syncs `data-theme` to <body>
    └── hooks/
        └── useLocalStorage.js    persistent useState

Screenshots

Light mode

Light mode

Dark mode

Dark mode

Lighthouse score

Google Lighthouse audit of the live demo — 100 in Performance, Accessibility, Best Practices, and SEO:

Lighthouse scores

Deployment

About

Advanced Task Manager - React + Vite (Context API, custom hooks, theming, animations, drag-and-drop)

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages