Skip to content

folloGF/farm-pulse

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

FarmPulse – Decentralized Smart Farming with Web3

FarmPulse is a smart farming system that automates irrigation, manure application, and pump control using IoT sensors, a Web3 backend, and decentralized smart contracts on the Stellar blockchain. FarmPulse solves the key challenges of traditional farming by automating irrigation, manure application, and pump control. It eliminates inconsistent watering, labor-intensive fertilizing, and inefficient manual pump operations. By integrating these systems, FarmPulse ensures precise, timely delivery of water and nutrients based on crop needs. This reduces waste, improves yields, and saves time and labor. The system also enables real-time monitoring and alerts, helping farmers respond quickly to issues like dry soil or system failures. FarmPulse brings smart, efficient, and sustainable farming to life, making modern agriculture more productive and less dependent on manual intervention.

FarmPulse stands out by offering a fully integrated, smart farming solution that automates irrigation, manure application, and pump control—all in one system. Unlike traditional systems that manage each function separately, FarmPulse synchronizes them using real-time data and sensors for precise water and nutrient delivery. Its user-friendly interface and remote monitoring capabilities allow farmers to control and optimize operations from anywhere. FarmPulse reduces manual labor, conserves resources, and maximizes crop yield with minimal effort. Its modular design makes it adaptable for small to large farms, and its data-driven approach ensures consistent, sustainable farming with smarter decision-making.


Features

  • Real-time irrigation and manure distribution using ESP8266 sensors.
  • Secure authentication using Stellar wallets and Web3 integration.
  • Smart contract automation with Stellar smart contracts.
  • Real-time data handling via WebSockets.
  • Modern React frontend with multiple pages and analytics.
  • Middleware backend (Node.js/Express) as a bridge between devices and blockchain.
  • Transparent and verifiable records on-chain.
  • Advanced analytics and monitoring dashboard.
  • Responsive design with Tailwind CSS.
  • Cost tracking and performance metrics.

Tech Stack

Layer Technology
Blockchain Stellar Smart Contracts
Web3 Tools Stellar SDK, React Context
Frontend React.js, React Router, Tailwind CSS
IoT ESP8266 (Wi-Fi-based)
Backend Node.js + Express.js + WebSockets
Charts Recharts, Lucide React
Authentication Stellar Wallet Integration
Storage Optional: MongoDB / IPFS

Local Development Setup

Prerequisites

  • Node.js (v16+)
  • Git
  • Stellar wallet (e.g., Freighter, Albedo)
  • Yarn or npm

1. Clone the Repository

git clone https://github.com/yourusername/farmpulse.git
cd farmpulse

cd backend
npm install

cd ../frontend
npm install

2. Configure Environment Variables

Create a .env file in both /backend and /frontend:

Backend (.env):

STELLAR_SECRET_KEY=your_stellar_secret_key
STELLAR_NETWORK=testnet
PORT=4000

Frontend (.env):

VITE_STELLAR_NETWORK=testnet
VITE_BACKEND_URL=http://localhost:4000
VITE_WS_URL=ws://localhost:4000

3. Start Development Servers

Start Backend (WebSocket + REST API):

cd backend
node index.js

Start Frontend (React):

cd ../frontend
npm start

Real time data flow

ESP8266 -> Wi-Fi -> Express Backend (Node.js) -> WebSocket -> React Frontend | Stellar SDK | Stellar Smart Contracts


New Features in v2.0

🌟 Stellar Integration

  • Migrated from StarkNet to Stellar blockchain
  • Lower transaction fees and faster confirmations
  • Better wallet integration options

🎨 Modern UI/UX

  • Completely redesigned frontend with Tailwind CSS
  • Multiple pages: Dashboard, Farm Control, Analytics, Settings
  • Real-time charts and data visualization
  • Responsive design for all devices

📊 Advanced Analytics

  • Water usage tracking and cost analysis
  • Moisture level trends and predictions
  • Pump activity monitoring
  • Export functionality for data analysis

🔧 Enhanced Controls

  • Individual farm management
  • Batch operations for multiple farms
  • Automated irrigation scheduling
  • Real-time alerts and notifications

Application Structure

farmpulse/
├── backend/          # Express server + WebSocket + Stellar SDK
│   ├── routes/
│   │   └── api.js    # API endpoints with Stellar integration
│   ├── websocket/
│   │   └── socketServer.js
│   ├── stellar/
│   │   └── contractManager.js  # Stellar contract management
│   └── index.js
├── frontend/         # React frontend with Stellar integration
│   ├── src/
│   │   ├── components/
│   │   │   └── Navbar.js
│   │   ├── contexts/
│   │   │   └── StellarContext.js  # Stellar wallet context
│   │   ├── pages/
│   │   │   ├── Dashboard.js
│   │   │   ├── FarmControl.js
│   │   │   ├── Analytics.js
│   │   │   └── Settings.js
│   │   ├── utils/
│   │   │   └── stellarWallet.js
│   │   ├── App.js
│   │   └── index.js
│   ├── tailwind.config.js
│   └── postcss.config.js
├── iot/              # ESP8266 firmware code
│   └── main.ino
└── README.md

API Endpoints

Farm Management

  • POST /api/sensor - Receive sensor data from ESP8266
  • GET /api/farm/:farmId - Get farm record from Stellar
  • POST /api/farm - Create new farm record on Stellar

WebSocket Events

  • Real-time sensor data broadcasts
  • Transaction confirmations
  • System alerts and notifications

Stellar Smart Contracts

The system uses Stellar smart contracts for:

  1. Farm Record Management

    • Create farm records with sensor data
    • Update irrigation status
    • Track ownership and permissions
  2. Transaction Logging

    • Immutable record of all farming operations
    • Cost tracking and audit trails
    • Performance metrics storage

Contribution Guide

We welcome all contributions!

  1. Fork the repo
  2. Create a new branch
    git checkout -b feature/your-feature-name
  3. Make your changes
  4. Commit with clear messages
    git commit -m "Add: Stellar wallet integration"
  5. Push and open a Pull Request

License

This project is licensed under the ISC License - see the package.json file for details.

About

an embedded system and web 3 technology to make irrigation automated

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors