ToDo List Application
ToDo List Application
```bash
npm init -y
```
```javascript
app.use(bodyParser.json());
app.use(cors());
// Routes
res.json(tasks);
});
const newTask = { id: uuidv4(), title, description, dueDate, status: "To Do" };
tasks.push(newTask);
res.status(201).json(newTask);
});
const { id } = req.params;
res.json(task);
});
const { id } = req.params;
});
```
```bash
cd todo-app
```
#### App.js
```javascript
const [newTask, setNewTask] = useState({ title: "", description: "", dueDate: "" });
useEffect(() => {
}, []);
setTasks([...tasks, res.data]);
});
};
axios.delete(`http://localhost:5000/tasks/${id}`).then(() => {
});
};
return (
<div>
<h1>To-Do List</h1>
<input
type="text"
placeholder="Title"
value={newTask.title}
/>
<input
type="text"
placeholder="Description"
value={newTask.description}
/>
<input
type="date"
value={newTask.dueDate}
/>
<ul>
{tasks.map((task) => (
<li key={task.id}>
{task.title} - {task.status}
</li>
))}
</ul>
</div>
);
};
```
### Conclusion
This setup covers the basics of a full-stack To-Do List application with Node.js backend and React
frontend. Extend this application with advanced features like authentication and persistent storage