First of all setup backend project:
- Create a folder and open in any code editor like: VsCode
Open Terminal and run this code:
npm init -y
- Lets Setup Project Folder Structure and files
create importants folder like:
.
└── root/
├── public/
│ └── temp
├── src/
│ ├── app.js
│ ├── index.js
│ ├── constants.js
│ ├── controllers/
│ │ └── index.js
│ ├── middlewares/
│ │ └── index.js
│ ├── routes/
│ │ └── index.js
│ ├── utils/
│ │ └── index.js
│ ├── db/
│ │ └── index.js
│ └── models/
│ └── index.js
├── .env
├── .env.sample
├── .gitignore
├── .prettierrc
└── .pretterignore
After this you need to install some NPM packages* like
Nodemon and Pretttier
Open your terminal from root directory and run the following code:
npm i -D nodemon prettier
after successfully installed goto package.json
file and update it with the following code snippet:
{
"name": "node",
"version": "1.0.0",
"description": "",
"main": "index.js",
"type": "module",
"scripts": {
"dev": "nodemon src/index.js"
},
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"nodemon": "^3.1.0",
"prettier": "^3.2.5"
}
}
then add your gitignore and prettier setup
Read part -2
Top comments (0)