/marketplace

Primary LanguageJavaScript

Install hardhat first of all

npm install -g hardhat

Root

$ npx hardhat node
$ npx hardhat run --network localhost scripts/deploy.js

Frontend

$ cd /frontend
$ npm install
$ npm start

Backend

$ cd /backend
$ create directory public/uploads inside /src (dont forget to create directory)
$ npm install
$ Create file .env and set the variable MONGODB_URl with the url of the database in mongoDB, and JWT_PRIVATE_KEY with a private key for do the  hashing of the token
$ npm run dev

Postman

All Category

/api/categories (GET)
/api/categories (POST)

Body:

title: String
description: String
categoryId: Number (default: 0)

Category _id

/api/categories/:id (GET)

All Items

/api/items/item (GET)
/api/items/item (POST)

Params POST:

categoryId: Number (ej: 0)

Body:

title: String
price: String
description: String
condition: String
picture: Array

Item By Slug

/api/items/item/:slug (GET)