Skip to content

Backend of Vendi built with NodeJs using ExpressJs, MongoDB, Hashgraph JS SDK, and Socket.IO

Notifications You must be signed in to change notification settings

its-me-sv/vendi-backend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Vendi - Your Business, Your Tokens, Your Way

wakatime

Note: This is the back end code of Vendi and the front end code can be found in this repository - https://github.com/its-me-sv/vendi-frontend

Pow

To verify that the code was written during the official hack period (22 July to 20 August 2024), kindly check the first commit here which is August 6, 2024 (15 days after the opening ceremony). The same goes for the frontend code as well

Links

Project link - https://vendistore.netlify.app

Demo video - https://youtu.be/3e5llQUz7Vc

Setup:

  1. Update the allowedOrigins value in the src/utils/origins.js
  2. Check Hedera setup to setup hedera client (the big boy of the project)
  3. Check MongoDB setup to setup the database (for indexing product infos, user infos, etc)
  4. Check Cloudinary setup to setup image storing (for products)
  5. Check Pinata setup to pin and unpin JSONs to/from IPFS (for storing HIP412 metadatas)

Hedera setup:

  1. This is used to interact with the hedera network
  2. Create an testnet account of type ed25519 from https://portal.hedera.com/ and paste the DER Encoded Private Key into the .env file with the variable PRIVATE_KEY, similarly copy the Account Id into the ACCOUNT_ID variable
  3. Uncomment line 47 from the file ./index.js to a create consensus topic. Paste the topic id the function printed to TOPIC_ID variable in the .env file

MongoDB setup:

  1. This is primarily used foe CRUD on non WEB3 related data in Vendi
  2. Create a MongoDB database from https://www.mongodb.com/ with a collection named Vendi
  3. Create .env file in the root directory with variable MONGO_URL assigned to the mongodb uri which can be found in the Connect -> Connect your application section of your mongo db database
  4. Make sure to select the Node.JS driver with the version 4.1 or later

Cloudinary setup:

  1. This is used to store product and other uploaded images
  2. Create an account in Cloudinary from https://cloudinary.com/ and paste the API credentials in your .env file

Pinata setup:

  1. This is used to pin and unpin HIP412 metadata JSON into IPFS
  2. Create an account Pinata from https://www.pinata.cloud/ and paste the jwt token and gateway into PINATA_JWT and PINATA_GATEWAY

Note: Your .env file should look something like this. (kindly refer step 2-4 of Setup to fill the secrets)

ACCOUNT_ID =
PRIVATE_KEY =
PUBLIC_KEY =
TOPIC_ID =

MONGO_URL =

CLOUDINARY_CLOUD_NAME =
CLOUDINARY_API_KEY =
CLOUDINARY_API_SECRET =
CLOUDINARY_PRESET =

PORT =

PINATA_JWT =
PINATA_GATEWAY =

Usage:

npm / yarn install
npm / yarn run dev-[win/mac] (in development)
npm / yarn start (in production)

About

Backend of Vendi built with NodeJs using ExpressJs, MongoDB, Hashgraph JS SDK, and Socket.IO

Topics

Resources

Stars

Watchers

Forks