CropChain: Blockchain Supply Chain Tracker
Inspiration
The inspiration for CropChain is rooted in the history of farmer resistance and the struggle for fair value:
- The 1859 Indigo Revolt: History showed us how farmers were exploited through lack of transparency and forced into unfair contracts without any record of their labor's true value.
- Kisaan Andolan (2020): The recent protests highlighted a modern crisis—farmers struggling for fair market access and the fear of being marginalized by powerful intermediaries.
CropChain was born from the idea that technology should empower the producer. By using Blockchain, we give the power back to the farmers, ensuring their work is recorded, verified, and valued without the need for exploitative middlemen.
What it does
CropChain is a full-stack transparency platform that tracks crops from the moment of harvest to the final consumer.
- For Farmers: It creates an immutable digital "birth certificate" for every crop batch.
- For Consumers: It provides an unhackable "proof of origin" via a simple QR scan.
- For the Supply Chain: It records every hand-off (Farmer → Mandi → Transport → Retailer) on a public ledger, making the journey 100% tamper-proof.
How we built it
We combined high-end design with decentralized security:
- Blockchain: Developed Solidity smart contracts deployed on Polygon/Ethereum to ensure low-cost, secure transactions.
- Frontend: Built with React 18 and TypeScript, using Tailwind CSS for a clean, "Apple-level" UI aesthetics.
- Backend: A Node.js and Express server handles metadata management, utilizing MongoDB for efficient storage.
- Web3 Integration: Used Ethers.js to bridge the gap between the browser and the blockchain, allowing real-time interaction with smart contracts.
Challenges we ran into
The journey involved significant technical hurdles:
- The 3-Day Sync Bug: We spent 72 hours solving a critical issue where the UI wouldn't reflect blockchain events due to WebSocket lag. We overcame this by implementing a custom polling mechanism and a "Pending" state in the UI.
- Gas Optimization: Ensuring that a farmer doesn't pay high fees to log a batch was vital. We optimized storage by only keeping cryptographic "hashes" on-chain and metadata off-chain.
- Mobile UX: Making a web-based QR scanner work consistently across all mobile browsers (iOS vs. Android) required deep-diving into hardware-access libraries.
Accomplishments that we're proud of
- Successful Testnet Deployment: Seeing a batch move from a "Farmer" wallet to a "Retailer" wallet on the blockchain for the first time.
- Design Excellence: Creating a complex supply-chain tool that feels as simple and intuitive as a consumer app.
- Trustless Verification: Building a system where the consumer doesn't have to "take the retailer's word for it"—the math and the blockchain prove the quality.
What we learned
- Web3 State Management: We learned that building for the blockchain requires a different approach to data consistency than traditional Web2 apps.
- The Power of Roles: We discovered how to use OpenZeppelin Access Control to create digital "gates" that keep the system secure from unauthorized updates.
- Social Impact Tech: We learned that for technology to truly help farmers, it must be accessible, fast, and mobile-centric.
What's next for CropChain
- IoT Sensor Integration: Automated tracking of temperature and humidity during transport.
- AI Quality Prediction: Using computer vision to predict crop grades at the time of harvest.
- Carbon Footprint Tracking: Helping farmers earn "Carbon Credits" by proving sustainable transport methods.
- Government Integration: Aligning the platform with digital Mandi systems to streamline payments.
Built With
- css
- ether.js
- ethereum
- express.js
- mongodb
- node.js
- polygon
- react18
- solidity
- tailwind
- typescript
Log in or sign up for Devpost to join the conversation.