1.make the backend folder (server.js inside it)
2.in backend npx-create-react-app frontend
package.json of backend
"scripts": {
"start": "node server.js",
"frontend":"npm start --prefix ../frontend",
"dev": "concurrently \\"npm run start\\" \\"npm run frontend\\""
},
FOR VITE ASSSITANCE
package.json in frontend
"scripts": {
"dev": "vite",
"build": "vite build",
"lint": "eslint . --ext js,jsx --report-unused-disable-directives --max-warnings 0",
"preview": "vite preview"
},
it runs by npm run dev
package.json in backend
"scripts": {
"start": "node -r dotenv/config --experimental-json-modules server.js",
"frontend":"npm run dev --prefix ./frontend",
"dev": "concurrently \\"npm run start\\" \\"npm run frontend\\""
},
Your package.json scripts are set up for running a Node.js backend and a frontend (likely React or another JavaScript framework) using concurrently
. Here's what each script does:
"start": "node server.js"