Artur-Poffo / 01-Tasks-Ignite

First challenge of the new Node track of the Ignite course

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

A tasks API developed with pure Node.js

Status: Finished

AboutFeaturesAPI RoutesHow it worksTech StackAuthor

About

Tasks API - is the first challenge of the Node.js track of the Ignite course by @Rocketseat


Features

  • List tasks
  • Search tasks
  • Add tasks
  • Update tasks
  • Delete tasks
  • Mark task as completed
  • Importing tasks in bulk from a CSV file
  • Persist data in local database (JSON file: db.json)

API Routes

  • GET /tasks
    • Listing with or without filters of tasks depending on the existence of the query paramter: 'search' and its value
  • POST /TASKS
    • Task creation in the local database (db.json file), it is necessary: title and description only
  • PUT /tasks/:id
    • Update task according to the content of the request body, it is necessary: title and description only
  • DELETE /tasks/:id
    • Delete task according to ID passed as route parameter
  • PATCH /tasks/:id/completed
    • Mark task as completed

How it works

Pre-requisites

Before you begin, you will need to have the following tools installed on your machine: Git, Node.js. In addition, it is good to have an editor to work with the code like VSCode and a REST client like Insomnia

Run the app

# Clone this repository
$ git clone https://github.com/Artur-Poffo/01-Tasks-Ignite.git

# Access the project folder cmd/terminal
$ cd 01-Tasks-Ignite

# install the dependencies
$ npm install

# Run the application in development mode
$ npm run dev

# The server will start at port: 3333 - You can now test in Insomnia or another REST client: http://localhost:3333

And the CSV?

To load the CSV you must populate the CSV file in the path: ./streams/tasks.csv or replace it with a ready-made CSV file but with the same name: tasks.csv and while running the project as described above, run it in the root directory of project: node ./streams/csv-load.js, this way the content of the CSV will be converted into tasks and saved in the local database, remembering that the format of the content of your CSV file must follow the same pattern as the default file: tasks.csv


Tech Stack

The following tools were used in the construction of the project:

  • Node.js
  • Javascript
  • csv-parse

See the file package.json


Author

  • Artur Poffo - Developer

Linkedin Badge Gmail Badge


About

First challenge of the new Node track of the Ignite course


Languages

Language:JavaScript 100.0%