the series is sponsored by tascade a real-time organization and collaboration platform make sure to check the description for 100 lifetime discount to your subscription hey everyone my name is vishwas and welcome to this mini series on json server in this video i'll talk about the what and why of json server and set up a very simple package.json in the remainder of the series we will take a look at the different features json server has to offer let's begin what is json server and why would you need it json server is an npm package that lets you create fake rest apis with zero coding the reason you might want to use it is the same reason why i use it as a front-end developer i constantly need mock data that i can use to quickly prototype front-end components i like the data to be fetched asynchronously and the apis should support not just get but also post put and delete requests creating a node plus express plus mongodb backend is pretty time consuming instead i rely on json server so if you are a front-end dev i highly recommend you learn and understand how to work with this package as it will save you a lot of time when prototyping in this mini-series i will show you how to create a simple json file that can be used as a database and supports api requests for a number of day-to-day requirements like querying a list of items querying by id filtering sorting pagination querying with operations like greater than or less than querying by full text search querying parent or child entities and making post put or delete requests all using json server we will wrap up the series with some configuration options now as prerequisites for this series you don't really need a knowledge of any front-end technology as such you just have to know about the json format and how an api is typically consumed in a front-end application everything else will seem straightforward as we explore the different features now before we get started i just want to point out that i have created a json file and included some data it contains two keys at the top level products and reviews products is an array of 10 items each product has a unique id title category price and description we then have an array of five reviews which correspond to the products listed above each review has a unique id a rating a comment and the product id to which it belongs to so review one belongs to product one so do reviews two and three review four belongs to product two and review five belongs to product three a pretty simple json file as you can see now we need to set up json server step one create a package.json file in the project folder for that in the terminal run the command npm init dash y you should have a package.json file created with some defaults step 2 install the json server package so in the terminal again run the command yarn add json hyphen server or npm install json hyphen server you should see it being listed as a dependency for the third and final step add a new script to start the server let's call the script serve json and the command to start is json hyphen server dash dash watch tb.json so our server will now continuously monitor db.json file and serve the latest data you can find this project setup on my github page in the json server tutorials repo let's run the script and make sure it works in the terminal run yarn serve hyphen json if you navigate to localhost port 3000 you should see a very nice jason silver homepage our setup is working as expected now what we will learn in this series is how to query and mutate this json file through api endpoints let's start with get requests in the next video