Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Backend Task Data Source THIRD PARTY API URL: ( Consider a . json url ) which has records like ( { id :

Backend Task
Data Source
THIRD PARTY API URL: (Consider a .json url) which has records like ({"id": 1, "title": "Fjallraven Foldsack No 1 Backpack Fits 15 Laptops", "price": 329.85, "description": "Your perfect pack for everyday use and walks in the forest. Stash your laptop up to 15 inches in the padded sleeve your everyday", "category": "men's clothing", "image: abc.jpg, "sold": false, "dateOfSale": "2021-11-27T20:29:54+05:30"})
REQUEST METHOD: GET
RESPONSE FORMAT : JSON
GET
Create API to initialize the database. fetch the JSON from the third party API and initialize the database with seed data. You are free to define your own efficient table collection structure
Instruction
All the APIs below should take month ( expected value is any month between January to December) as an input and should be matched against the field dateOfSale regardless of the year.
GET
Create an API to list the allitransactions- API should support search and pagination on product transactions- Based on the value of search parameters, it should match search text on product title/description/price and based on matching result it should return the product transactions- If search parameter is empty then based on applied pagination it should retur all the records of that page numberDefault pagination values will be like page =1, per page =10
GET
Create an API for statistics- Total sale amount of selected month- Total number of sold items of selected month- Total number of not sold items of selected month
GET
Create an API for bar chart ( the response should contain price range and the number of items in that range for the selected month regardless of the year )-0-100-101-200-201-300-301-400-401-500-501-600-601-700-701-800-801-900-901-above
GET
Create an API for pie chart Find unique categories and number of items from that category for the selected month regardless of the year.For example- X category : 20(items)- Y category : 5(items)- Z category : 3(items)
GET
Create an API which fetches the data from all the 3 APIs mentioned above, combines the response and sends a final response of the combined JSON
Tech Stack :
Node.js , Express.js , MongoDB, React.js
Give me code with respect to above tech stack.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions