Skip to content

Rajkishore08/Farm-Chain

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

7 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš€ FarmChain - Revolutionizing Agriculture with Blockchain

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.

🌟 Features

πŸ‘¨β€πŸŒΎ User Roles

βœ… Farmers:

  • Register and list their products with pricing, location, and delivery range.
  • Track sales, manage inventory, and receive direct payments.

πŸ›’ Consumers:

  • Browse & purchase farm-fresh products with filters for type, price, and location.
  • Order directly from nearby farmers and track previous purchases.

πŸ”‘ Key Functionalities

  • πŸ”— 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.

πŸ”— Blockchain Integration

  • Built on Ethereum & Binance Smart Chain (BSC) for secure, transparent transactions.
  • Smart contracts power farmer registration, product listings, orders, and payments.

πŸ“ Geographic Prioritization

  • Products are shown based on proximity to consumers.
  • Dynamic delivery fee calculations based on location.

πŸ—οΈ Technology Stack

πŸ–₯️ Frontend

  • React.js – Dynamic, responsive UI.
  • Bootstrap – Sleek, modern design.

πŸ› οΈ Backend

  • Node.js & Express.js – RESTful API for smooth operations.
  • MongoDB – Secure storage of user profiles, products, and orders.

πŸ”₯ Blockchain

  • Ethereum / BSC – For decentralized transactions.
  • Solidity Smart Contracts – Powering trustless interactions.

πŸ”‘ Wallet Integration

  • MetaMask & WalletConnect – Ensuring secure user interactions.

πŸš€ Installation Guide

πŸ“Œ Prerequisites

Ensure you have the following installed:

  • Node.js (v16+)
  • MongoDB (Local/Cloud)
  • MetaMask browser extension

πŸ”§ Backend Setup

Clone the repository:

git clone https://github.com/yourusername/farmchain.git
cd farmchain/backend

Install dependencies:

npm install

Create 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.js

Backend runs at http://localhost:5000.

🎨 Frontend Setup

cd ../frontend
npm install
npm start

Frontend runs at http://localhost:3000.

⛓️ Smart Contract Deployment

cd ../smart-contracts
npm install --save-dev hardhat @nomiclabs/hardhat-ethers ethers dotenv

Configure 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 goerli

Save the deployed contract address in .env.

πŸ“Έ Screenshots

🌍 Marketplace Page

Marketplace Screenshot Marketplace Screenshot image

πŸ›’ Dashboard

image

Farmers

image image

πŸ›’ Track Your Order

image image

πŸ’° Revenue Model

πŸ”Ή Transaction Commission

  • 5% commission on successful transactions.

πŸ”Ή Subscription Plans

  • β‚Ή500/month for farmers to access premium features like analytics and priority listings.

πŸ”Ή Delivery Fees

  • Dynamic fees based on distance, with FarmChain taking a 10% cut.

πŸš€ Future Enhancements

  • NFT-based Tokenized Farms for crowdfunding agricultural projects.
  • AI-powered recommendations based on consumer preferences & location.
  • Polygon integration for lower gas fees.

πŸ› οΈ Contributors

  • Raj Kishore
  • Pavimalini
  • Guhasri
  • Jeevan

πŸ“œ License

This project is licensed under the MIT License. See LICENSE for details.


πŸ’‘ Empowering Farmers. Connecting Communities. Transforming Agriculture with Blockchain.

About

A Blockchain Platform Connecting Farmers and Consumers

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors