Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
File renamed without changes.
5 changes: 3 additions & 2 deletions .env
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
DB_CON_STRING="mongodb+srv://abidrazaa:Abcd1234@cluster0.lr2rk.mongodb.net/?retryWrites=true&w=majority"
DB_CON_STRING='mongodb+srv://abidrazaa:Abcd1234@cluster0.lr2rk.mongodb.net/?retryWrites=true&w=majority'
TOKEN_KEY=seceret
PORT = 3000
PORT=3000
DO_SEEDING=false
18 changes: 16 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,16 @@
# node_modules
# public/uploads
node_modules
#public/uploads
.env
.eslintcache
.DS_Store

# mongo
.data
data

# logs
logs

# build
build
dist
5 changes: 5 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
node_modules
.DS_Store
build
dist
.env
9 changes: 9 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"arrowParens": "always",
"trailingComma": "all",
"singleQuote": true,
"printWidth": 100,
"endOfLine": "auto",
"tabWidth": 2,
"semi": true
}
19 changes: 19 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
FROM node:latest

WORKDIR /app

# Copy all the files from your file system to the container file system
COPY package*.json ./
COPY .env ./

# Install all dependencies
RUN npm install

# Copy other files as well
COPY . .

# Expose the port
EXPOSE 3000

# Command to execute when the image is instantiated
CMD ["npm", "run", "start"]
45 changes: 44 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,44 @@
# backend-node
# backend-node

## Getting Started

Follow these steps to set up the project on your local machine:

### Clone the Repository

Clone this repository to your local machine.

### Option 1 - Local

#### Install

Install the dependencies.

```bash
npm install
```

#### Start

Start the Backend:

```bash
npm run start
```

> Backend will available at <http://localhost:4000>.

### Option 2 - Docker

#### Install Docker

Install [docker](https://www.docker.com/products/docker-desktop/) required to run the Backend.

#### Start Docker

```bash
docker compose up --build
```

> Backend will available at <http://localhost:4000>.
> DB url for docker is <mongodb://mongo:27017/easycart-db>.
115 changes: 0 additions & 115 deletions app.js

This file was deleted.

10 changes: 0 additions & 10 deletions config/database.js

This file was deleted.

51 changes: 0 additions & 51 deletions controllers/admin/dashboard.js

This file was deleted.

81 changes: 0 additions & 81 deletions controllers/admin/orders.js

This file was deleted.

Loading