Download from the official site:
Install the LTS version. npm is included with Node.js.
Verify after installation:
node -v
npm -vDownload from the official site:
Verify after installation:
git --versionInstall 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.
- Open MetaMask.
- 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
- Network name:
- Save the network.
- 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.
You need to install dependencies in each folder.
cd supply-chain-blockchain/blockchain
npm installcd supply-chain-blockchain/backend
npm installcd supply-chain-blockchain/frontend
npm installcd supply-chain-blockchain/blockchain
npm run nodeKeep this terminal open.
Open a second terminal:
cd supply-chain-blockchain/blockchain
npm run compileWith the Hardhat node still running:
cd supply-chain-blockchain/blockchain
npm run deployThis writes the deployed contract address and ABI to:
blockchain/deployments/localhost.json
The backend and frontend both read from that file.
Start the backend after deployment:
cd supply-chain-blockchain/backend
npm starthttp://localhost:5000
Start the React app:
cd supply-chain-blockchain/frontend
npm run devOpen the URL shown by Vite, usually:
http://localhost:3000
- Click Connect MetaMask.
- Add a product on the Add Product page.
- Transfer it on the Transfer Product page.
- Verify it on the Verify Product page.