Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Blockchain-Based Supply Chain Tracking System

1) Install Required Tools

Install Node.js

Download from the official site:

Install the LTS version. npm is included with Node.js.

Verify after installation:

node -v
npm -v

Install Git

Download from the official site:

Verify after installation:

git --version

Install MetaMask

Install the official browser extension:

After installing, create a wallet or import an existing one. For this project, use a browser profile where MetaMask is enabled.

2) Connect MetaMask to the Local Hardhat Network

  1. Open MetaMask.
  2. Add a new network with these values:
    • Network name: Hardhat Local
    • RPC URL: http://127.0.0.1:8545
    • Chain ID: 31337
    • Currency symbol: ETH
  3. Save the network.
  4. After the Hardhat node is running, import one of the Hardhat private keys from the terminal output if you want the same account in MetaMask.

The frontend will still connect with any MetaMask account, but using a local Hardhat account keeps the demo consistent.

3) Install Project Dependencies

You need to install dependencies in each folder.

Blockchain

cd supply-chain-blockchain/blockchain
npm install

Backend

cd supply-chain-blockchain/backend
npm install

Frontend

cd supply-chain-blockchain/frontend
npm install

4) Blockchain Setup

Start the local Hardhat node

cd supply-chain-blockchain/blockchain
npm run node

Keep this terminal open.

Compile the contract

Open a second terminal:

cd supply-chain-blockchain/blockchain
npm run compile

Deploy the contract

With the Hardhat node still running:

cd supply-chain-blockchain/blockchain
npm run deploy

This writes the deployed contract address and ABI to:

  • blockchain/deployments/localhost.json

The backend and frontend both read from that file.

5) Backend Setup

Start the backend after deployment:

cd supply-chain-blockchain/backend
npm start
  • http://localhost:5000

6) Frontend Setup

Start the React app:

cd supply-chain-blockchain/frontend
npm run dev

Open the URL shown by Vite, usually:

  • http://localhost:3000

Frontend flow

  1. Click Connect MetaMask.
  2. Add a product on the Add Product page.
  3. Transfer it on the Transfer Product page.
  4. Verify it on the Verify Product page.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages