An immutable, role-based supply chain tracker built for maximum transparency and zero fraud. Track agricultural products, dairy, or high-value goods (like jewelry) from origin to consumer.
- Smart Contracts: Solidity, Hardhat
- Frontend: React (TypeScript), Vite, Ethers.js
- Design: Premium Vanilla CSS (Glassmorphism, Dark Mode)
- Role Based Access: Farmer (Minter), Transporter, Retailer, Consumer
Open a terminal and run:
cd contracts
npx hardhat nodeOpen a new terminal window and run:
cd contracts
npm run deploy:localNote the deployed contract address. It should be
0x5FbDB2315678afecb367f032d93F642f64180aa3. If it's different, updateCONTRACT_ADDRESSinfrontend/src/types.ts.
Open another terminal and run:
cd frontend
npm run dev- Open your browser to
http://localhost:5173 - Add the Hardhat local network to MetaMask (
http://127.0.0.1:8545, Chain ID31337). - Import one of the private keys provided by the Hardhat node terminal to have an account with ETH.
- Farmer Role: Register as a Farmer, create a new product (e.g. "Arabica Beans Batch #1"), and get the generated QR code ID.
- Transfer: The farmer transfers ownership to a Transporter address.
- Transporter Role: Switch MetaMask account to the transporter, register the role, scan the ID, and update status to "In Transit".
- Consumer Role: Use the Verification tab, type in the ID, and see the full tamper-proof origin timeline!