A modern, blockchain-powered supply chain tracking platform for transparent product management, built with Solidity smart contracts, a React frontend, and QR code integration.
This project enables secure, transparent tracking of products across a supply chain using Ethereum smart contracts. It features:
- Smart Contract Backend: Solidity contract for product registration and tracking, deployed to Ethereum (Sepolia or local Hardhat).
- React Frontend: User-friendly dashboard for product management, QR code scanning, analytics, and real-time updates.
- QR Code Integration: Generate, scan, and manage QR codes for product tracking.
- Python QR Code Generator: Script to create sample QR codes for testing/demo.
- Product Registration: Add new products with name and origin, stored on-chain.
- Product Tracking: View, search, and filter all tracked products. See their status and history.
- QR Code Integration:
- Scan QR codes to auto-fill product forms.
- Generate and download QR codes for each product, containing full tracking details.
- QR codes can be scanned to retrieve product and tracking info.
- Analytics & Dashboard: Visualize supply chain metrics and analytics.
- History: View all QR scans and their details.
- Modern UI: Responsive, clean, and user-friendly interface.
[User] ⇄ [React Frontend (frontend/)] ⇄ [Ethereum Smart Contract (contracts/SupplyChain.sol)]
⇄ [Python QR Generator (generate_qr_codes.py)]
- Location:
contracts/SupplyChain.sol - Tech: Solidity 0.8.x, Hardhat
- Networks: Local Hardhat, Sepolia (Ethereum testnet)
- Install dependencies:
npm install # or yarn install - Configure environment variables:
Create a
.envfile in the root with:RPC_URL_SEPOLIA=YOUR_SEPOLIA_RPC_URL SEPOLIA_CHAIN_ID=11155111 PRIVATE_KEY=YOUR_WALLET_PRIVATE_KEY
- Compile contracts:
npx hardhat compile
- Deploy to Sepolia:
The deployed contract address will be output in the terminal. Update the frontend config with this address.
npx hardhat run scripts/deploy.js --network sepolia
- Location:
frontend/ - Tech: React, Tailwind CSS, ethers.js
- Install dependencies:
cd frontend npm install # or yarn install
- Start development server:
Visit http://localhost:5173 in your browser.
npm run dev # or yarn dev
- Scan QR: Use the "Scan QR Code" button to auto-fill the product form with product name and location from a QR code.
- Product QR: Each product card has a QR icon. Click it to view and download a QR code containing all tracking details for that product.
- QR History: All scans are saved and viewable in the QR History tab.
- Favicon: Located at
frontend/public/favicon.svg. Replace with your own SVG or PNG if desired. - Theme: Tailwind CSS is used for styling. Edit
frontend/tailwind.config.jsand CSS files for custom branding. - QR Code API: QR codes are generated using api.qrserver.com. You can swap this for a local library if needed.
This project is fully PWA-enabled! You can install it on your device for an app-like experience, including offline support and home screen icons.
- Installable on desktop and mobile (Android/iOS).
- Offline support via service worker.
- Custom app icons for all platforms.
- Manifest and meta tags for best PWA compliance.
- Start the frontend:
cd frontend npm run dev - Open the app in Chrome or Edge.
- Click the install icon in the address bar, or use the browser menu to "Add to Home Screen".
- The PWA will work automatically on your deployed site.
- Make sure the following files exist in
frontend/public/:pwa-192x192.pngpwa-512x512.pngmanifest.webmanifest
- The manifest and icons are referenced in
index.htmlandvite.config.js.
- If the app icon does not update, clear your browser cache, uninstall the PWA, and reinstall.
- For iOS, the icon may appear rounded or with a gloss effect (this is normal).
A script is provided at the project root to generate sample QR codes for testing:
pip install -r requirements.txt
python generate_qr_codes.pyOutput will be in the qr_codes/ directory.
contracts/— Solidity smart contracts (main: SupplyChain.sol)frontend/— React frontend appscripts/— Deployment and utility scriptsqr_codes/— Sample/generated QR codesgenerate_qr_codes.py— Python QR code generator script
MIT