A simple and efficient To-Do List application built using Vite. This application allows users to manage their tasks by adding, editing, deleting, and marking tasks as complete. The tasks are saved in the browser's localStorage
, ensuring persistence across page reloads.
- Add new tasks with details like name, description, due date, and priority.
- Edit existing tasks.
- Delete tasks.
- Mark tasks as complete with a strike-through.
- Highlight and select different projects.
- Persistence of tasks using
localStorage
.
https://rushil-todo-list.netlify.app/
Before you begin, ensure you have the following installed on your system:
-
Clone the Repository
git clone https://github.com/RushilJalal/todo-list.git cd todo-list
-
Install Dependencies
If you're using npm:
npm install
Or if you're using Yarn:
yarn install
-
Run the Development Server
If you're using npm:
npm run dev
Or if you're using Yarn:
yarn dev
-
Open in Browser
Open your browser and navigate to
http://localhost:3000
to see the application in action.
This application uses the browser's localStorage
to save tasks. This ensures that your tasks persist even after you reload the page or close the browser. The tasks are saved automatically whenever you add, edit, or delete a task.
The todoList
array is saved to localStorage
whenever it is modified:
function saveTodoList() {
localStorage.setItem('todoList', JSON.stringify(todoList));
}
The todoList
array is loaded from localStorage
when the application initializes:
function loadTodoList() {
const savedTodoList = localStorage.getItem('todoList');
if (savedTodoList) {
return JSON.parse(savedTodoList);
} else {
return []; // Return an empty array if nothing is saved
}
}
export let todoList = loadTodoList();
Feel free to fork the repository and submit pull requests. For major changes, please open an issue first to discuss what you would like to change.