FarmChain is a cutting-edge blockchain-based platform that bridges the gap between farmers and consumers, eliminating middlemen to ensure fair pricing, product authenticity, and complete transparency in the agricultural supply chain.
- Register and list their products with pricing, location, and delivery range.
- Track sales, manage inventory, and receive direct payments.
- Browse & purchase farm-fresh products with filters for type, price, and location.
- Order directly from nearby farmers and track previous purchases.
- π Connect Wallet: Securely link your MetaMask wallet for seamless transactions.
- ποΈ Smart Filters: Search by product type (e.g., fruits, vegetables), price range, and location.
- π¦ Cart & Orders: Add products to the cart, adjust quantities, and view past orders.
- π Traceability: Track the journey of a product from farm to table using blockchain.
- Built on Ethereum & Binance Smart Chain (BSC) for secure, transparent transactions.
- Smart contracts power farmer registration, product listings, orders, and payments.
- Products are shown based on proximity to consumers.
- Dynamic delivery fee calculations based on location.
- React.js β Dynamic, responsive UI.
- Bootstrap β Sleek, modern design.
- Node.js & Express.js β RESTful API for smooth operations.
- MongoDB β Secure storage of user profiles, products, and orders.
- Ethereum / BSC β For decentralized transactions.
- Solidity Smart Contracts β Powering trustless interactions.
- MetaMask & WalletConnect β Ensuring secure user interactions.
Ensure you have the following installed:
- Node.js (v16+)
- MongoDB (Local/Cloud)
- MetaMask browser extension
Clone the repository:
git clone https://github.com/yourusername/farmchain.git
cd farmchain/backendInstall dependencies:
npm installCreate a .env file in the backend directory:
MONGO_URI=your_mongodb_connection_string
INFURA_PROJECT_ID=your_infura_project_id
PRIVATE_KEY=your_private_key
CONTRACT_ADDRESS=your_deployed_contract_address
Start the backend server:
node index.jsBackend runs at http://localhost:5000.
cd ../frontend
npm install
npm startFrontend runs at http://localhost:3000.
cd ../smart-contracts
npm install --save-dev hardhat @nomiclabs/hardhat-ethers ethers dotenvConfigure hardhat.config.js:
require("@nomiclabs/hardhat-ethers");
require("dotenv").config();
module.exports = {
solidity: "0.8.0",
networks: {
goerli: {
url: `https://goerli.infura.io/v3/${process.env.INFURA_PROJECT_ID}`,
accounts: [`0x${process.env.PRIVATE_KEY}`],
},
bscTestnet: {
url: "https://data-seed-prebsc-1-s1.binance.org:8545/",
accounts: [`0x${process.env.PRIVATE_KEY}`],
},
},
};Deploy the smart contract:
npx hardhat run scripts/deploy.js --network goerliSave the deployed contract address in .env.
- 5% commission on successful transactions.
- βΉ500/month for farmers to access premium features like analytics and priority listings.
- Dynamic fees based on distance, with FarmChain taking a 10% cut.
- NFT-based Tokenized Farms for crowdfunding agricultural projects.
- AI-powered recommendations based on consumer preferences & location.
- Polygon integration for lower gas fees.
- Raj Kishore
- Pavimalini
- Guhasri
- Jeevan
This project is licensed under the MIT License. See LICENSE for details.
π‘ Empowering Farmers. Connecting Communities. Transforming Agriculture with Blockchain.







