Skip to content

Latest commit

ย 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ“ Todo List App

A simple and responsive Todo List application built with React.js, Vite, Tailwind CSS, and React Context API.

The application allows users to add, edit, and delete tasks while automatically storing todo data in the browser using LocalStorage.

๐Ÿš€ Live Demo

๐Ÿ‘‰ View Live Demo

๐Ÿ“ธ Preview

Todo List App

โœจ Features

  • โž• Add new tasks
  • โœ๏ธ Edit existing tasks
  • ๐Ÿ—‘๏ธ Delete tasks
  • ๐Ÿ’พ Save tasks using LocalStorage
  • ๐Ÿ”„ Restore tasks after refreshing the browser
  • โš›๏ธ Global state management using React Context API
  • ๐Ÿ”” SweetAlert2 notifications
  • ๐ŸŽจ Responsive user interface
  • ๐Ÿ“ฑ Mobile-friendly layout
  • โšก Fast development and production build using Vite
  • ๐ŸŒ Deployed on Vercel

๐Ÿ› ๏ธ Technologies Used

Technology Purpose
React.js Building the user interface
Vite Development server and build tool
JavaScript Application logic
Tailwind CSS Styling and responsive design
React Context API Global state management
React Hooks State and lifecycle management
LocalStorage Persistent browser storage
React Icons UI icons
SweetAlert2 User notifications
Vercel Deployment

๐Ÿ“‚ Project Structure

Todo-list/
โ”‚
โ”œโ”€โ”€ public/
โ”‚   โ”œโ”€โ”€ image.png
โ”‚   โ”œโ”€โ”€ home.png
โ”‚   โ””โ”€โ”€ logo.png.png
โ”‚
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ components/
โ”‚   โ”‚   โ”œโ”€โ”€ AddTodo.jsx
โ”‚   โ”‚   โ””โ”€โ”€ AllTodo.jsx
โ”‚   โ”‚
โ”‚   โ”œโ”€โ”€ context/
โ”‚   โ”‚   โ””โ”€โ”€ ContextTodo.jsx
โ”‚   โ”‚
โ”‚   โ”œโ”€โ”€ App.jsx
โ”‚   โ”œโ”€โ”€ main.jsx
โ”‚   โ””โ”€โ”€ index.css
โ”‚
โ”œโ”€โ”€ .gitignore
โ”œโ”€โ”€ eslint.config.js
โ”œโ”€โ”€ index.html
โ”œโ”€โ”€ package.json
โ”œโ”€โ”€ package-lock.json
โ”œโ”€โ”€ vite.config.js
โ””โ”€โ”€ README.md

๐Ÿง  How the Application Works

1. Add a Todo

The user enters a task into the input field and clicks the add button.

The task is passed to the Context API:

addTodo(input)

The input is then cleared after adding the task.

2. Manage Todo State

Todo data is managed through React Context API.

The context provides:

addTodo()
deleteTodo()
updateTodo()
todos

This allows different components to access and modify the todo state without passing props through multiple component levels.

3. LocalStorage Persistence

The application stores todo data in the browser's LocalStorage.

The LocalStorage key is:

my_todos

Todo data is converted into JSON before being stored.

localStorage.setItem(
    "my_todos",
    JSON.stringify(todos)
)

4. Restore Todos

When the application starts, it checks LocalStorage for previously saved tasks.

localStorage.getItem("my_todos")

If saved tasks are found, they are loaded into React state.

This allows tasks to remain available after refreshing the browser.

5. Edit Todos

Users can click the edit button to modify an existing task.

After saving the change, the updated task is stored in React state and LocalStorage.

6. Delete Todos

Users can delete an existing task using the delete button.

The task is removed from the todo state and the updated list is saved to LocalStorage.

โš›๏ธ React Concepts Used

This project demonstrates:

  • Functional Components
  • useState
  • useEffect
  • useContext
  • Context API
  • Controlled Components
  • Event Handling
  • Conditional Rendering
  • Component Composition
  • State Management
  • LocalStorage Integration

๐Ÿ’พ Data Persistence

The application uses browser LocalStorage instead of a backend database.

Example:

[
    "Learn React",
    "Practice JavaScript",
    "Build a project"
]

Because the data is stored locally in the browser, it is specific to the user's browser/device.

๐ŸŽจ UI & Design

The interface uses:

  • Tailwind CSS
  • React Icons
  • Responsive layout
  • Background image
  • Blur/glass-style visual effects
  • Scrollable todo container
  • SweetAlert2 notifications

๐Ÿ“ฑ Responsive Design

The application is designed for different screen sizes:

  • ๐Ÿ’ป Desktop
  • ๐Ÿ’ป Laptop
  • ๐Ÿ“ฑ Tablet
  • ๐Ÿ“ฑ Mobile

โš™๏ธ Installation

Clone the repository:

git clone https://github.com/naved2001/Todo-list.git

Move into the project directory:

cd Todo-list

Install dependencies:

npm install

Start the development server:

npm run dev

Open the local development URL provided by Vite.

๐Ÿงช Available Scripts

Development

npm run dev

Production Build

npm run build

Preview Production Build

npm run preview

ESLint

npm run lint

๐Ÿš€ Deployment

The application is deployed using Vercel.

๐ŸŒ Live Demo:

https://todo-list-naved5.vercel.app/

๐Ÿ”ฎ Future Improvements

The following features can be added in future versions:

  • Mark tasks as completed
  • Active / Completed / All filters
  • Search tasks
  • Task priority
  • Due dates
  • Categories
  • Dark / Light theme
  • Drag-and-drop task ordering
  • User authentication
  • Backend API
  • Database integration
  • Supabase integration
  • Synchronization across multiple devices

๐Ÿ‘จโ€๐Ÿ’ป Developer

Naved Ansari

Full Stack Web Developer

๐Ÿ“„ License

This project is created for learning and portfolio purposes.


โญ If you found this project useful, feel free to explore the repository.

Made with โค๏ธ using React.js

About

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages