A blockchain-powered carbon footprint tracking system for supply chain transparency. Built with React, TypeScript, Tailwind CSS, and ethers.js.
-
Web3 Wallet Integration
- Connect MetaMask wallet
- Interact with smart contracts on testnet
- Real-time connection status
-
Create Coffee Batches
- Register new product batches on blockchain
- Assign unique batch IDs
- Track origin locations
-
Add Carbon Entries
- Record emissions for each supply chain stage
- Stages: Farm → Roast → Transport → Cup
- Immutable blockchain storage
-
Interactive Timeline Visualization
- Visual journey from farm to cup
- Hover effects and animations
- Carbon footprint per stage
-
Carbon Dashboard (WOW Screen)
- Animated counter showing total footprint
- Detailed history of all stages
- Key insights and benchmarking
- Verification certificates
-
QR Code System
- Generate QR codes for any batch
- Product lookup by batch ID
- Download QR codes for packaging
- Direct link to carbon dashboard
-
Interactive UI/UX
- Cursor-following glow effects
- Smooth scroll animations
- Responsive design
- Toast notifications
- Frontend: React 18 with TypeScript
- Styling: Tailwind CSS v4
- Animations: Motion (Framer Motion)
- Web3: ethers.js v6
- QR Codes: qrcode library
- Icons: Lucide React
- UI Components: Radix UI primitives
- Node.js 18+
- MetaMask browser extension
- Smart contract deployed on testnet (e.g., Sepolia, Mumbai)
# Install dependencies
npm install
# Start development server
npm run dev-
Update contract address in
/src/app/components/Web3Provider.tsx:const CONTRACT_ADDRESS = "YOUR_CONTRACT_ADDRESS_HERE";
-
Update contract ABI with your deployed contract's ABI
-
Ensure MetaMask is connected to the correct testnet
The frontend expects a smart contract with these functions:
function createBatch(string memory batchId, string memory origin) public returns (uint256)
function addCarbonEntry(uint256 batchId, string memory stage, uint256 carbonAmount, string memory timestamp) public
function getBatchFootprint(uint256 batchId) public view returns (uint256)
function getBatchHistory(uint256 batchId) public view returns (tuple(string stage, uint256 carbon, string timestamp)[])- Connect Wallet - Click "Connect Wallet" in hero section
- Create Batch - Register a new coffee batch with ID and origin
- Add Carbon Data - Record emissions for each supply chain stage
- View Dashboard - See the "WOW" screen with total verified footprint
- Generate QR - Create a QR code linking to the batch's carbon data
- Lookup Product - Search any batch ID to view its footprint
- Coffee Producers: Track and showcase sustainable practices
- Retailers: Provide transparency to eco-conscious consumers
- Consumers: Scan QR codes to verify product carbon footprint
- Regulators: Access immutable emission records
- Clarity: Information understandable in under 60 seconds
- Interactivity: Engaging cursor effects and animations
- Responsiveness: Works on desktop and mobile
- Visual Hierarchy: Clear flow from hero to action to results
- Total carbon footprint per product
- Breakdown by supply chain stage
- Comparison to industry benchmarks
- Reduction opportunities
- Blockchain verification status
- All data stored immutably on blockchain
- No centralized database
- Publicly verifiable transactions
- Wallet signatures for all modifications
This is a demo project for a blockchain hackathon. Feel free to fork and extend!
MIT License - Build freely!
Built for: Web3/Blockchain Supply Chain Hackathon
Track: Real-world problems in sustainability
Problem Statement: Verifiable Carbon Footprint per Product
Date: February 2026