Setting up a full-stack React project
Before we can start developing our frontend application, we first need to merge our previously created frontend boilerplate based on Vite with the backend service created in Chapter 3, Implementing a Backend Using Express, Mongoose ODM, and Jest. Let’s merge them now by following these steps:
- Copy the
ch1
folder to a newch4
folder, as follows:$ cp -R ch1 ch4
- Copy the
ch3
folder to a newch4/backend
folder, as follows:$ cp -R ch3 ch4/backend
- Delete the
.git
folder in the copiedch4/backend
folder, as follows:$ rm -rf ch4/backend/.git
- Open the new
ch4
folder in VS Code. - Remove the Husky
prepare
script (the line is highlighted in the code snippet) from thebackend/package.json
file, as we already have Husky set up in the root directory:"scripts": { "dev": "nodemon src/index.js", "start": "node src/index.js", &...