3.ToggleState:Eachtodoitemincludesacheckbox.Checking/uncheckingthisboxtogglesthetodo's state between open and completed.
4.LocalStorage:Theapplicationwillusethebrowser's local storage to persist todos between sessions, ensuring that users do not lose their data upon reloading the application.
-Clickingthe"Add New Todo"buttonpromptstheusertoenteradescriptionforthenewtodo.Uponconfirmation,theapplicationaddsthenewtodo(withthedefaultstateofopen)tothelistandupdateslocalstorage.
-Todospersistbetweensessionsusingthebrowser's local storage. The application saves any changes to the todo list (additions or state changes) in local storage and retrieves this data when the application is reloaded.
-DataPersistence:Theapplicationusesthebrowser's local storage to persist todos between sessions. It stores the array of todos as a JSON string and parses this data on application load.
"""
EXAMPLE_PROJECT_ARCHITECTURE={
"architecture":(
"The application is a client-side React web application that uses local storage for data persistence. "
"It consists of a single page with components for listing todos, adding new todos, and toggling their completion status. "
"State management is handled directly within React components, leveraging useState and useEffect hooks for state manipulation and side effects, respectively. "
"Bootstrap 5 is used for styling to provide a responsive and accessible UI."
),
"system_dependencies":[
{
"name":"Node.js",
"description":"JavaScript runtime needed to run the React development tools and build the project.",
"test":"node --version",
"required_locally":True
}
],
"package_dependencies":[
{
"name":"react",
"description":"A JavaScript library for building user interfaces."
},
{
"name":"react-dom",
"description":"Serves as the entry point to the DOM and server renderers for React."
},
{
"name":"bootstrap",
"description":"Frontend framework for developing responsive and mobile-first websites."
}
],
"template":"javascript_react"
}
EXAMPLE_PROJECT_PLAN=[
{
"description":(
"Create a new component TodoList: This component will display the list of todo items. "
"Use localStorage directly to access the current state of todos and map over them, rendering each todo item as a list item. "
"Each item should display the todo's description and a checkbox that reflects the todo's state (checked for completed, unchecked for open). "
"When the checkbox is clicked, dispatch an action to toggle the state of the todo. "
"Also create AddTodo: This component will include a button that, when clicked, displays a prompt asking the user for a description of the new todo. "
"Upon confirmation, dispatch an action to add the new todo to the state with a default state of open. "
"Ensure the component also updates the local storage with the new list of todos. "
"Finally, use TodoList and AddTodo components in App component to implement the required functionality. "
"Integrate Boostrap 5 for styling - add CSS/JS to index.html, style App.jsx and other files as appropriate."