This is a todo app built with Node.js, Express and MongoDB.
This application allows the user to add new todo tasks. Once a task is added, the user can view all the tasks in progress. When a task is completed, the user can move the task to Completed Tasks by checking the box before each task.
First install all the frameworks: Express, EJS, body-parser and Mongoose using npm install
.
Next, set up views and index.js
. Use Bootstrap to style the webpage. Run node index.js
to start the application in the browser. Implement the add todo
functionality.
Without using mongoose, create an array of tasks and display them on the webpage to ensure
the app is working. Introduce mongoose to the program, set up the database connection and integrate
database into the add todo
functionality.
Add a checkbox in front of each task so that when the user clicks on it, the task is completed (removed from
the collection). Create a new collection for completed tasks. When a task is completed, it's added to Completeds
.
Finally display all the completed tasks on the webpage.
A todo application is fairly simple to develop, but there are a lot of details to focus on. Overall, it's a good practice to touch base with Node.js and Express.