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
ch1folder to a newch4folder, as follows:$ cp -R ch1 ch4
- Copy the
ch3folder to a newch4/backendfolder, as follows:$ cp -R ch3 ch4/backend
- Delete the
.gitfolder in the copiedch4/backendfolder, as follows:$ rm -rf ch4/backend/.git
- Open the new
ch4folder in VS Code. - Remove the Husky
preparescript (the line is highlighted in the code snippet) from thebackend/package.jsonfile, as we already have Husky set up in the root directory:Â Â "scripts": { Â Â Â Â "dev": "nodemon src/index.js", Â Â Â Â "start": "node src/index.js", &...