A simple to-do list web application built with Node.js, Express, MongoDB, and EJS.
- Project Overview
- Features
- Technologies Used
- Prerequisites
- Installation
- Usage
- Project Structure
- API Endpoints
- Future Improvements
This is a basic web application that allows users to create and manage a list of to-do items. It provides a simple and intuitive user interface for adding tasks. The application is built on the MVC (Model-View-Controller) architecture, with a Node.js and Express backend, EJS for the views, and MongoDB for the database.
- Create To-Do Items: Add new tasks to your to-do list.
- View To-Do Items: See a list of all your to-do items. (Currently under development)
- Edit To-Do Items: Update the content of existing tasks. (Future feature)
- Delete To-Do Items: Remove tasks from your list. (Future feature)
- Node.js: A JavaScript runtime for building the backend.
- Express.js: A web application framework for Node.js.
- MongoDB: A NoSQL database for storing the to-do items.
- Mongoose: An Object Data Modeling (ODM) library for MongoDB.
- EJS: A simple templating language for generating HTML.
- dotenv: A module for loading environment variables from a
.envfile. - Nodemon: A tool that automatically restarts the server during development.
Before you begin, ensure you have the following installed:
-
Clone the repository:
git clone https://github.com/LoneWolf728/TodoApp.git cd todo-app -
Install the dependencies:
npm install
-
Create a
.envfile:Create a
.envfile in the root of the project and add your MongoDB connection string:DB_CONNECT=mongodb+srv://<username>:<password>@<cluster-name>.mongodb.net/<database-name>?retryWrites=true&w=majorityReplace
<username>,<password>,<cluster-name>, and<database-name>with your actual MongoDB credentials. You can find this connection string in themongodbinfo.txtfile.
To start the application, run the following command:
npm startThis will start the server on http://localhost:3000. You can access the application by opening this URL in your web browser.
.
├── .env
├── index.js
├── mongodbinfo.txt
├── package-lock.json
├── package.json
├── models/
│ └── TodoTask.js
├── node_modules/
├── public/
│ └── stylesheets/
│ └── style.css
└── views/
└── todo.ejs
index.js: The main entry point of the application.models/TodoTask.js: Defines the Mongoose schema and model for the to-do tasks.views/todo.ejs: The EJS template for the user interface.public/: Contains static assets like stylesheets..env: Stores environment variables, including the database connection string.package.json: Lists the project's dependencies and scripts.
GET /: Renders the main to-do list page.POST /: Creates a new to-do item.
- Implement the ability to display all to-do items from the database.
- Add functionality to edit existing to-do items.
- Add functionality to delete to-do items.
- Improve the user interface and add more styling.
- Add user authentication to create personal to-do lists.
- Add due dates and priority levels to the to-do items.
- Write unit and integration tests for the application.