Skip to content

Latest commit

Β 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

About the Site πŸš€

Blockchain-based eCommerce warranty system using NFTs The objective is to replace the physical warranty and have block chain based warranty using NFT which will ensure authenticity and security.
● Converting ownership authenticity and product warranty cards into decaying NFTs.πŸ“‰
● For instance, allow brands and retailers to introduce an NFT for each of their products, which allows customers to receive the physical product along with a digital version of it.πŸš€
● Customers can then use the digital NFT to verify the authenticity of their product, prove their ownership of their product, and transfer ownership of them upon resale.🎯
● The brand/retailer should also be able to tie the digital NFT to its warranty program, allowing owners to trackrepairs and replacements to the original item.🀩
● Decay the NFT once the warranty is over.πŸ₯Έ
● WE used the Polygon blockchain to deploy our solution and demo the final product as a web prototypeπŸ”—

How to execute? πŸ’»

Clone project:

git clone https://github.com/mollybeach/ecommerce_chain.git

Go to root directory:

cd nft-warranty-system

First install the packages using follow cmd:

npm run install-all

Now start the project using concurrently:

npm start

Tech Stack πŸ’»

WEB 3.0 :

  • Hardhat
  • Moralis
  • Solidity
  • Ethereum

Frontend :

Backend :

Express.js MongoDB NodeJS

Project Goals

Skill Test The goal of this test is to confirm you can integrate the smart contracts into backend. You have to add a new API into "server/index.js" named [Your Name]ApiTest. And you have to fetch some info on any pre-deployed or public smart contracts through your API. No need for any front-end to show the result. Just the result on the console is enough to show your work. Once you complete the test, you can send a short video to show your work.

Steps to complete the test

  1. Add a new API into "server/index.js" named [Your Name]ApiTest.
  2. Fetch some info on any pre-deployed or public smart contracts through your API.
  3. No need for any front-end to show the result.
  4. Just the result on the console is enough to show your work.

⌘K to generate a command help me with the skill test

I'll help you create an API endpoint to fetch information from a smart contract. Here's how we can implement the skill test requirement: First, we'll need to add the ethers.js library to interact with smart contracts. Add it to the server directory: Bash ethers Here's an example implementation to add to server/index.js:

help me with the skill test

I'll help you create an API endpoint to fetch information from a smart contract. Here's how we can implement the skill test requirement: First, we'll need to add the ethers.js library to interact with smart contracts. Add it to the server directory: Bash ethers Here's an example implementation to add to server/index.js: index.js . This implementation:

  1. Creates a new GET endpoint /api/YourNameApiTest Connects to the Polygon Mumbai testnet Queries a USDC token contract for basic information (name, symbol, total supply) Logs the results to console and returns them as JSON To test it: Start your server Make a GET request to http://localhost:YOUR_PORT/api/YourNameApiTest Check your server console for the logged data You can modify this example to: Use a different network (Ethereum mainnet, other testnets) Query different smart contracts Call different contract methods Add more complex interactions Remember to: Replace "YourName" in the endpoint with your actual name Record a short video showing: The code implementation Making the API request The console output showing the contract data This demonstrates your ability to integrate smart contracts with a backend API, which is the main goal of the skill test.

Project Structure

repo_ecommerce/
β”œβ”€β”€ .git/
β”œβ”€β”€ client/
β”‚   β”œβ”€β”€ public/
β”‚   β”‚   β”œβ”€β”€ favicon.ico
β”‚   β”‚   β”œβ”€β”€ index.html
β”‚   β”‚   β”œβ”€β”€ logo192.png
β”‚   β”‚   β”œβ”€β”€ logo512.png
β”‚   β”‚   β”œβ”€β”€ manifest.json
β”‚   β”‚   └── robots.txt
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ Assets/
β”‚   β”‚   β”‚   β”œβ”€β”€ Home/
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ 1.png
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ 2.png
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ 3.png
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ 4.png
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ 5.png
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ bag1.png
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ bag2.png
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ bagpacks.png
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ hoddie2.png
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ hoodie1.png
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ hoodie2.png
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ hoodies.png
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ index.js
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ shoe1.png
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ shoe2.png
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ sneakers.png
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ tshirt1.png
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ tshirt2.png
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ tshirts.png
β”‚   β”‚   β”‚   β”‚   └── waves.svg
β”‚   β”‚   β”‚   β”œβ”€β”€ cart.svg
β”‚   β”‚   β”‚   β”œβ”€β”€ changePass.svg
β”‚   β”‚   β”‚   β”œβ”€β”€ create.svg
β”‚   β”‚   β”‚   β”œβ”€β”€ edit.svg
β”‚   β”‚   β”‚   β”œβ”€β”€ error.png
β”‚   β”‚   β”‚   β”œβ”€β”€ footer_img.png
β”‚   β”‚   β”‚   β”œβ”€β”€ logout.svg
β”‚   β”‚   β”‚   β”œβ”€β”€ nishant.png
β”‚   β”‚   β”‚   β”œβ”€β”€ not_found.png
β”‚   β”‚   β”‚   β”œβ”€β”€ profile.svg
β”‚   β”‚   β”‚   β”œβ”€β”€ purchased.svg
β”‚   β”‚   β”‚   β”œβ”€β”€ saurabh.png
β”‚   β”‚   β”‚   β”œβ”€β”€ spider.png
β”‚   β”‚   β”‚   β”œβ”€β”€ trial1.png
β”‚   β”‚   β”‚   β”œβ”€β”€ trial2.png
β”‚   β”‚   β”‚   β”œβ”€β”€ trial3.png
β”‚   β”‚   β”‚   β”œβ”€β”€ trial4.png
β”‚   β”‚   β”‚   └── trial5.png
β”‚   β”‚   β”œβ”€β”€ Components/
β”‚   β”‚   β”‚   β”œβ”€β”€ Cart/
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ Cart.jsx
β”‚   β”‚   β”‚   β”‚   └── Cart.module.css
β”‚   β”‚   β”‚   β”œβ”€β”€ CategoryPage/
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ CategoryPage.jsx
β”‚   β”‚   β”‚   β”‚   └── CategoryPage.module.css
β”‚   β”‚   β”‚   β”œβ”€β”€ Explore/
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ Explore.jsx
β”‚   β”‚   β”‚   β”‚   └── Explore.module.css
β”‚   β”‚   β”‚   β”œβ”€β”€ Footer/
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ Footer.jsx
β”‚   β”‚   β”‚   β”‚   └── Footer.module.css
β”‚   β”‚   β”‚   β”œβ”€β”€ Home/
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ Home.jsx
β”‚   β”‚   β”‚   β”‚   └── Home.module.css
β”‚   β”‚   β”‚   β”œβ”€β”€ Login/
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ Login.jsx
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ Login.module.css
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ LoginHero.jsx
β”‚   β”‚   β”‚   β”‚   └── LoginHero.module.css
β”‚   β”‚   β”‚   β”œβ”€β”€ Navbar/
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ Dropdown.jsx
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ Dropdown.module.css
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ MenuItems.js
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ Navbar.jsx
β”‚   β”‚   β”‚   β”‚   └── Navbar.module.css
β”‚   β”‚   β”‚   β”œβ”€β”€ NotFound/
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ NotFound.jsx
β”‚   β”‚   β”‚   β”‚   └── NotFound.module.css
β”‚   β”‚   β”‚   β”œβ”€β”€ Product/
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ Product.jsx
β”‚   β”‚   β”‚   β”‚   └── Product.module.css
β”‚   β”‚   β”‚   β”œβ”€β”€ Retailer/
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ ChangePass/
β”‚   β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ ChangePass.jsx
β”‚   β”‚   β”‚   β”‚   β”‚   └── ChangePass.module.css
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ CreateProduct/
β”‚   β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ CreateProduct.jsx
β”‚   β”‚   β”‚   β”‚   β”‚   └── CreateProduct.module.css
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ EditProfile/
β”‚   β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ EditProfile.jsx
β”‚   β”‚   β”‚   β”‚   β”‚   └── EditProfile.module.css
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ LogoutModal/
β”‚   β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ LogoutModal.jsx
β”‚   β”‚   β”‚   β”‚   β”‚   └── LogoutModal.module.css
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ MyItems/
β”‚   β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ MyItems.jsx
β”‚   β”‚   β”‚   β”‚   β”‚   └── MyItems.module.css
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ Profile/
β”‚   β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ Profile.jsx
β”‚   β”‚   β”‚   β”‚   β”‚   └── Profile.module.css
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ index.js
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ Retailer.jsx
β”‚   β”‚   β”‚   β”‚   └── Retailer.module.css
β”‚   β”‚   β”‚   β”œβ”€β”€ Signup/
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ Signup.jsx
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ Signup.module.css
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ SignupHero.jsx
β”‚   β”‚   β”‚   β”‚   └── SignupHero.module.css
β”‚   β”‚   β”‚   β”œβ”€β”€ UI/
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ Card/
β”‚   β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ Card.jsx
β”‚   β”‚   β”‚   β”‚   β”‚   └── Card.module.css
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ CartIcon/
β”‚   β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ CartIcon.jsx
β”‚   β”‚   β”‚   β”‚   β”‚   └── CartIcon.module.css
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ CustomButton/
β”‚   β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ CustomButton.jsx
β”‚   β”‚   β”‚   β”‚   β”‚   └── CustomButton.module.css
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ InputField/
β”‚   β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ InputField.jsx
β”‚   β”‚   β”‚   β”‚   β”‚   └── InputField.module.css
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ LandingHero/
β”‚   β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ LandingHero.jsx
β”‚   β”‚   β”‚   β”‚   β”‚   └── LandingHero.module.css
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ Loading/
β”‚   β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ Loading.jsx
β”‚   β”‚   β”‚   β”‚   β”‚   └── Loading.module.css
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ Logo/
β”‚   β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ Logo.jsx
β”‚   β”‚   β”‚   β”‚   β”‚   └── Logo.module.css
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ Modal/
β”‚   β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ Modal.jsx
β”‚   β”‚   β”‚   β”‚   β”‚   └── Modal.module.css
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ ProductCard/
β”‚   β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ ProductCard.jsx
β”‚   β”‚   β”‚   β”‚   β”‚   └── ProductCard.module.css
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ SingleProductCard/
β”‚   β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ SingleProductCard.jsx
β”‚   β”‚   β”‚   β”‚   β”‚   └── SingleProductCard.module.css
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ SplineModel/
β”‚   β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ SplineModel.jsx
β”‚   β”‚   β”‚   β”‚   β”‚   └── SplineModel.module.css
β”‚   β”‚   β”‚   β”‚   └── index.js
β”‚   β”‚   β”‚   β”œβ”€β”€ User/
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ ChangePass/
β”‚   β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ ChangePass.jsx
β”‚   β”‚   β”‚   β”‚   β”‚   └── ChangePass.module.css
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ EditProfile/
β”‚   β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ EditProfile.jsx
β”‚   β”‚   β”‚   β”‚   β”‚   └── EditProfile.module.css
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ LogoutModal/
β”‚   β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ LogoutModal.jsx
β”‚   β”‚   β”‚   β”‚   β”‚   └── LogoutModal.module.css
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ Profile/
β”‚   β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ Profile.jsx
β”‚   β”‚   β”‚   β”‚   β”‚   └── Profile.module.css
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ PurchasedItems/
β”‚   β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ PurchasedItems.jsx
β”‚   β”‚   β”‚   β”‚   β”‚   └── PurchasedItems.module.css
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ index.js
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ User.jsx
β”‚   β”‚   β”‚   β”‚   └── User.module.css
β”‚   β”‚   β”‚   β”œβ”€β”€ VerifyNft/
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ VerifyHero.jsx
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ VerifyHero.module.css
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ VerifyNft.jsx
β”‚   β”‚   β”‚   β”‚   └── VerifyNft.module.css
β”‚   β”‚   β”‚   └── index.js
β”‚   β”‚   β”œβ”€β”€ Constants/
β”‚   β”‚   β”‚   β”œβ”€β”€ abi.json
β”‚   β”‚   β”‚   └── social.contact.js
β”‚   β”‚   β”œβ”€β”€ Contexts/
β”‚   β”‚   β”‚   β”œβ”€β”€ ProductContext/
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ productContext.js
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ productReducer.js
β”‚   β”‚   β”‚   β”‚   └── ProductState.js
β”‚   β”‚   β”‚   β”œβ”€β”€ SellerAuthContext/
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ sellerAuthContext.js
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ sellerAuthReducer.js
β”‚   β”‚   β”‚   β”‚   └── SellerState.js
β”‚   β”‚   β”‚   β”œβ”€β”€ UserAuthContext/
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ userAuthContext.js
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ userAuthReducer.js
β”‚   β”‚   β”‚   β”‚   └── UserState.js
β”‚   β”‚   β”‚   β”œβ”€β”€ index.js
β”‚   β”‚   β”‚   └── types.js
β”‚   β”‚   β”œβ”€β”€ Fonts/
β”‚   β”‚   β”‚   β”œβ”€β”€ Starcraft-Italic.otf
β”‚   β”‚   β”‚   β”œβ”€β”€ Starcraft-Normal.ttf
β”‚   β”‚   β”‚   └── Starcraft.otf
β”‚   β”‚   β”œβ”€β”€ PrivateRoutes/
β”‚   β”‚   β”‚   β”œβ”€β”€ index.js
β”‚   β”‚   β”‚   β”œβ”€β”€ SellerPrivateRoute.js
β”‚   β”‚   β”‚   └── UserPrivateRoute.js
β”‚   β”‚   β”œβ”€β”€ utils/
β”‚   β”‚   β”‚   └── setAuthToken.js
β”‚   β”‚   β”œβ”€β”€ App.css
β”‚   β”‚   β”œβ”€β”€ App.jsx
β”‚   β”‚   └── index.js
β”‚   β”œβ”€β”€ .env
β”‚   β”œβ”€β”€ .gitignore
β”‚   β”œβ”€β”€ package.json
β”‚   └── README.md
β”œβ”€β”€ readme_assets/
β”‚   β”œβ”€β”€ create_account.png
β”‚   β”œβ”€β”€ customer_profile.png
β”‚   β”œβ”€β”€ ethereum.png
β”‚   β”œβ”€β”€ featured_products.png
β”‚   β”œβ”€β”€ flipkart_grid.png
β”‚   β”œβ”€β”€ hardhat.png
β”‚   β”œβ”€β”€ log_in.png
β”‚   β”œβ”€β”€ logo.png
β”‚   β”œβ”€β”€ mockup_main.png
β”‚   β”œβ”€β”€ moralis.svg
β”‚   β”œβ”€β”€ popup.png
β”‚   β”œβ”€β”€ product_page.png
β”‚   β”œβ”€β”€ retailer_profile.png
β”‚   β”œβ”€β”€ solidity.png
β”‚   └── verify_warranty.png
β”œβ”€β”€ server/
β”‚   β”œβ”€β”€ config/
β”‚   β”‚   └── db.js
β”‚   β”œβ”€β”€ controllers/
β”‚   β”‚   β”œβ”€β”€ AuthControllers/
β”‚   β”‚   β”‚   β”œβ”€β”€ sellerAuth.js
β”‚   β”‚   β”‚   └── userAuth.js
β”‚   β”‚   β”œβ”€β”€ product.js
β”‚   β”‚   β”œβ”€β”€ seller.js
β”‚   β”‚   └── user.js
β”‚   β”œβ”€β”€ helpers/
β”‚   β”‚   └── auth.js
β”‚   β”œβ”€β”€ middleware/
β”‚   β”‚   β”œβ”€β”€ errorMiddleware.js
β”‚   β”‚   β”œβ”€β”€ sellerAuth.js
β”‚   β”‚   └── userAuth.js
β”‚   β”œβ”€β”€ models/
β”‚   β”‚   β”œβ”€β”€ Product.js
β”‚   β”‚   β”œβ”€β”€ Seller.js
β”‚   β”‚   └── User.js
β”‚   β”œβ”€β”€ routes/
β”‚   β”‚   β”œβ”€β”€ authRoutes/
β”‚   β”‚   β”‚   β”œβ”€β”€ sellerAuth.js
β”‚   β”‚   β”‚   └── userAuth.js
β”‚   β”‚   β”œβ”€β”€ product.js
β”‚   β”‚   β”œβ”€β”€ seller.js
β”‚   β”‚   └── user.js
β”‚   β”œβ”€β”€ utils/
β”‚   β”‚   └── helpers.js
β”‚   β”œβ”€β”€ .env
β”‚   β”œβ”€β”€ index.js
β”‚   └── package.json
β”œβ”€β”€ .all-contributorsrc
β”œβ”€β”€ .gitignore
β”œβ”€β”€ LICENSE
β”œβ”€β”€ package.json
└── README.md

About

Blockchain-based eCommerce warranty system using NFTs The objective is to replace the physical warranty and have block chain based warranty using NFT which will ensure authenticity and security

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages