Skip to content

VagnerNerves/nodejs-fundamentals-challenge-ignitenode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Project Backend With Nodejs Logo

Project Backend with Nodejs

I developed the backend in Node.js to create a task API with the following functionalities:

  • Task Creation:

    • Route: POST - /tasks
    • Type: POST
    • Description: You can create a new task in the database by sending the title and description fields in the request body. When creating a task, the fields id, created_at, updated_at, and completed_at are automatically filled.
  • Task Listing:

    • Route: GET - /tasks
    • Type: GET
    • Description: You can list all tasks saved in the database. Additionally, you can perform a search by filtering tasks based on title and description.
  • Task Update:

    • Route: PUT - /tasks/:id
    • Type: PUT
    • Description: You can update a task by its id. In the request body, you can send only the title and/or description for updating. If you send only one of them, the other will not be updated. Before updating, we perform validation to check if the id belongs to an existing task in the database.
  • Task Deletion:

    • Route: DELETE - /tasks/:id
    • Type: DELETE
    • Description: You can remove a task by its id. Before performing the removal, we verify if the id belongs to an existing task in the database.
  • Task Completion Status:

    • Route: PATCH - /tasks/:id/complete
    • Type: PATCH
    • Description: You can mark a task as complete or revert it to the "normal" state using the id. Before making the change, we perform validation to check if the id belongs to an existing task in the database.

Additionally, we provide the ability to import tasks in bulk through a CSV file.

The structure of each task includes the following fields:

  • id: Unique identifier for the task.
  • title: Task title.
  • description: Detailed description of the task.
  • completed_at: Completion date of the task (initially set to null).
  • created_at: Creation date of the task.
  • updated_at: Date of the last update to the task.

This backend was developed in Node.js to meet your task management needs with a robust API and the ability to import tasks in bulk from CSV files.

🧭 Table of contents

💡 Technologies Used

🚀 Running the Project

Back-end

Clone the project

  git clone https://github.com/VagnerNerves/nodejs-fundamentals-challenge-ignitenode.git

Enter the project directory

  cd nodejs-fundamentals-challenge-ignitenode

Install with dependencies

  npm install

Start the server

  npm run dev

To run the CSV file, execute the command:

  node ./stream/import-csv-stream.js

📝 Routes

Run in Insomnia

🌎 License

This project is under the MIT license. See the LICENSE file for more details.

✒ Author

Author Vagner Nerves

Vagner Nerves

Made with love and hate 😅, get in touch!

Linkedin Badge Gmail Badge GitHub Badge

About

I developed the backend in Node.js to create a task API.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published