An open API service indexing awesome lists of open source software.

https://github.com/moaraby/to-do-list-nodejs

REST API APP
https://github.com/moaraby/to-do-list-nodejs

docker dotenv error-handler expressjs mongodb mongoose nodejs nodemon restful-api

Last synced: 12 days ago
JSON representation

REST API APP

Awesome Lists containing this project

README

          

toDoList - Backend


This repository contains the backend code for a toDoList built using Node.js, Express, and MongoDB.

Features


CRUD operations for managing tasks
Middleware for request validation and error handling
Separation of concerns using controllers, models, and routes

Technologies Used



  • Node.js

  • Express.js

  • Docker

  • MongoDB

  • dotenv

  • express-async-handler

  • mongoose

  • nodemon

Setup Instructions


  • >Clone the repository:

  • >> bash

  • >> git clone https://github.com/your-username/to-do-list-nodeJS.git

Install dependencies:


  • > bash

  • > cd contact-management-backend

  • > npm install


  • > Create a .env file in the root directory.

  • > Add the following environment variables:

  • >> makefile

  • >> PORT=3000

  • >> MONGODB_URI=your-mongodb-connection-string


Configure environment variables:

  • > Start the server:

  • >> bash

  • >> npm start

API Endpoints



  • GET /api/tasks: Get all tasks

  • POST /api/tasks: Create a new task

  • GET /api/tasks/:id: Get a task by ID.

  • PUT /api/tasks/:id: Update a task by ID.


Folder Structure



  • middlewares/: Custom middleware functions.

  • controllers/: Request handlers for each route.

  • models/: Mongoose schemas and models.

  • routes/: Express routes for different endpoints.

Contributing


Contributions are welcome! Please fork the repository and submit a pull request.

License


This project is licensed under the MIT License.