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
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
Project link - https://vendistore.netlify.app
Demo video - https://youtu.be/3e5llQUz7Vc
- Update the
allowedOrigins
value in thesrc/utils/origins.js
- Check
Hedera setup
to setup hedera client (the big boy of the project) - Check
MongoDB setup
to setup the database (for indexing product infos, user infos, etc) - Check
Cloudinary setup
to setup image storing (for products) - Check
Pinata setup
to pin and unpin JSONs to/from IPFS (for storingHIP412
metadatas)
- This is used to interact with the hedera network
- Create an
testnet
account of typeed25519
from https://portal.hedera.com/ and paste theDER Encoded Private Key
into the.env
file with the variablePRIVATE_KEY
, similarly copy theAccount Id
into theACCOUNT_ID
variable - Uncomment
line 47
from the file./index.js
to a create consensus topic. Paste the topic id the function printed toTOPIC_ID
variable in the.env
file
- This is primarily used foe CRUD on non WEB3 related data in
Vendi
- Create a
MongoDB
database from https://www.mongodb.com/ with a collection namedVendi
- Create
.env
file in the root directory with variableMONGO_URL
assigned to themongodb uri
which can be found in theConnect -> Connect your application
section of your mongo db database - Make sure to select the
Node.JS
driver with the version4.1 or later
- This is used to store
product
and other uploaded images - Create an account in
Cloudinary
from https://cloudinary.com/ and paste theAPI credentials
in your.env
file
- This is used to pin and unpin HIP412 metadata JSON into IPFS
- Create an account
Pinata
from https://www.pinata.cloud/ and paste the jwt token and gateway intoPINATA_JWT
andPINATA_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 =
npm / yarn install
npm / yarn run dev-[win/mac] (in development)
npm / yarn start (in production)