# Code, Cart, Checkout: Building a Full-Stack E-Commerce App Like a Pro!

# e-Commerce project

we are making a full-stack ecommerce project and document the whole process not as a tutorial and as dev who want to make a full stack system that maybe not very scaleable but must be functional at a small scale.

prerequisite :→

<details data-node-type="hn-details-summary"><summary>basics of this topics</summary><div data-type="detailsContent">html( basic tags), basic CSS and basic JS(loops ,function ,arrow function, variable and basic DOM, Async programming and syntax of it {if possible })</div></details>

so first let’s start the project with the :→

## 0» Folder structure :→

### a» making file and folder (higher level):→

make a empty folder in the desktop and give the name u wanna give :→ here is mine

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1743503789492/347a3961-5a4e-49dd-b913-cb5dd417abf9.png align="center")

in this there will be two sections overall to mange two different sections:→

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1743504686875/1042cf0d-b427-491d-836e-ed41c7c0ee05.png align="center")

1»server (handle backend / server part of the app)

2»Front-end (handle client part of the application )

---

## 1»making the setup :→

### a» Setting UP the backend server and DB:→

i» making packages.json :→

```bash
 npm init -y
```

---

b&gt;installing despondency:→

```bash
npm i dotenv mongoose express
```

```bash
npm i -d nodemon
```

---

if your package.json seems like this you aree good to go.

```bash
{
  "name": "server",
  "version": "1.0.0",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "description": "",
  "dependencies": {
    "dotenv": "^16.4.7",
    "express": "^5.1.0",
    "mongoose": "^8.13.1"
  },
  "devDependencies": {
    "nodemon": "^3.1.9"
  }
}
```

**point to remember :→**

a» make sure to change the type :→

place the “test script” and this 2 script this will help to run the code.

```bash
"name": "server",
  "version": "1.0.0",
  "main": "index.js",
  "type": "module", // you and this part in package.json
```

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1743505134717/58e18f58-c609-48bd-8cdd-4302c057e79d.png align="center")

b» change this the scripts:→

```bash
 "scripts": {
    "start": "node index.js",
    "dev":"nodemon index.js"
  },
```

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1743505355880/0d2f336c-b0f5-41f4-8b1e-28581f4eb3fa.png align="center")

---

## 2»making the server with express :→
