LoanOptions.ai - Task 2 (NodeJs) & Task 3 (SQL)

In this project, I have created a Nodejs application that gets data from an API, limits retrieved data, sorts it, and displays the transformed data.

As for the API used, I have identified that the API accepts the param for Category, thus improving the performance of our task. Furthermore, as the data was already sorted alphabetically, I reversed the array's order to achieve the requested order.

Moreover, in this project, we have the SQL task, and the file located for it is at the root of this project.

How to run it?

NodeJS

Show instructions
  1. Access the folder of the project via the terminal, or an IDE that enables prompt commands

  2. Install the required packages by using the command below:

    $ npm install
  3. Now, you can start the project in the development env by using the below command.

    $ npm run dev {Category} {Limit}

You can replace the arguments in the brackets for your desired category and limit. e.g. npm run dev Animals 5

If you want to compile it, you can continue in step 3

  1. Enter the below command to compile the code

    $ npm run build
  2. Now, you can run it using the below command.

    $ npm start {Category} {Limit}

    e.g. npm start Animals 5

After that, the program should run.

SQL

The sql query is located on the root of the project and is called task3.sql.

Please feel free to contact me if you have any questions. email: andre_rodrigueslima@outlook.com.au