Skip to content

anand-devx/TodoReactAndContextAPI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

✅ React Todo App with Context API & localStorage

A modern and minimalist Todo app built with React, leveraging the Context API for global state and localStorage to persist tasks across sessions.


🌟 Features

  • Add, edit, and delete todos
  • Mark todos as completed/incomplete
  • Persist data using browser localStorage
  • Context API-based global state (no Redux)

🛠 Tech Stack

  • React (Vite)
  • Context API
  • localStorage
  • JavaScript
  • Tailwind CSS

📂 Project Structure

todo-app/
├── public/
│   └── vite.svg
├── src/
│   ├── components/
│   │   ├── TodoForm.jsx
│   │   └── TodoItem.jsx
│   ├── context/
│   │   └── TodoContext.js
│   ├── App.jsx
│   ├── index.css
│   └── main.jsx
├── .gitignore
├── package-lock.json
├── eslint.config.json
├── LICENSE
├── package.json
├── vite.config.json
├── index.html
└── README.md

⚙️ Getting Started

📦 Prerequisites

  • Node.js (v18+)
  • npm or yarn

🚀 Installation

git clone https://github.com/anand11206/TodoReactAndContextAPI.git
cd TodoReactAndContextAPI

npm install
# or
yarn install

🧪 Running the Application

npm run dev      # For Vite

Then visit:

http://localhost:5173 or what terminal shows

📦 Building for Production

npm run build

The output will be in the dist/ (Vite) or build/ (CRA) directory.


🧠 How It Works

  • The Context API provides a global state that holds the todo list and related actions.
  • The todo list is synced to localStorage using useEffect, so tasks persist after a page refresh or browser restart.

📄 License

This project is licensed under the MIT License.
See the LICENSE file for details.


👤 Author

Your Name
GitHub: @anand11206


🤝 Contributions

All contributions are welcome.
Feel free to fork, raise issues, or submit pull requests.


About

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published