A simple and functional ToDo List application built using Node.js, Express.js, and MongoDB (via Mongoose). This backend-powered app allows users to create, read, update, and delete tasks efficiently using RESTful APIs.
-
✅ Add new ToDo items
-
📋 Get all ToDos
-
🔍 Get ToDo by ID
-
✏️ Update ToDo by ID
-
❌ Delete ToDo by ID
-
🌐 Built with Express.js and Mongoose
-
🗄️ MongoDB for data storage
📦 Environment variable management via dotenv
-
Backend: Node.js, Express.js
-
Database: MongoDB (Mongoose ODM)
-
Tools: Nodemon, Dotenv, Postman (for testing)
📦 todo-app/
├── modes/
│ └── Todo.js // Mongoose schema
├── routes/
│ └── todos.js // API route handlers
├── config/
└── database.js // MongoDB connection logic
├── controller/
└── createTodo.js
└── deleteTodo.js
└── updateTodo.js
└── getTodo.js
├── index.js // Main entry point
├── .env // Environment variables
├── package.json
└── README.md
- Clone the repository
git clone https://github.com/skyeyeye/todo-app.git
cd todo-app
- Install dependencies
npm install
- Set up environment variables Create a .env file in the root:
PORT=3000
DATABASE_URL=mongodb://127.0.0.1:27017/todoapp
- Run the app
nodemon index.js
| Method | Endpoint | Description |
| -------- | ------------ | ----------------- |
| `GET` | `/todos` | Get all todos |
| `GET` | `/todos/:id` | Get todo by ID |
| `POST` | `/todos` | Create new todo |
| `PUT` | `/todos/:id` | Update todo by ID |
| `DELETE` | `/todos/:id` | Delete todo by ID |
This project is ideal for:
- Beginners learning Node.js & Express
- Understanding RESTful API design
- Practicing Mongoose schema and queries
- Learning backend + database integration
Pull requests are welcome! If you have ideas or improvements, feel free to contribute.
This project is licensed under the MIT License. Feel free to use, modify, and distribute it.