AgriGuard is a decentralized weather-based parametric insurance platform built on blockchain technology. It provides automated crop insurance for farmers, protecting them against extreme weather conditions such as droughts and heat stress. The platform uses Chainlink Oracles to fetch real-time weather data and automatically processes claims when predefined weather thresholds are exceeded.
Unlike traditional insurance, AgriGuard operates on a parametric model where payouts are triggered automatically based on objective weather data from Open-Meteo API, eliminating lengthy claim processes and reducing fraud.
AgriGuard provides three scientifically-backed insurance categories based on agricultural research:
Protects farmers during the critical planting season when insufficient moisture can prevent seed germination and establishment.
Covers the vegetative and reproductive growth stages when water stress significantly impacts crop yield and quality.
Safeguards against extreme temperatures that cause crop damage, reduced photosynthesis, and yield loss.
Scientific References:
- FAO (Food and Agriculture Organization). (2017). "Water for Sustainable Food and Agriculture". Retrieved from https://www.fao.org/3/i7959e/i7959e.pdf
- IPCC (Intergovernmental Panel on Climate Change). (2014). "Climate Change 2014: Impacts, Adaptation, and Vulnerability". Chapter 7: Food Security and Food Production Systems.
- Lobell, D.B., & Field, C.B. (2007). "Global scale climate-crop yield relationships and the impacts of recent warming". Environmental Research Letters, 2(1), 014002.
- Porter, J.R., et al. (2014). "Food security and food production systems". In Climate Change 2014: Impacts, Adaptation, and Vulnerability (pp. 485-533). Cambridge University Press.
The AutomatedWeatherPolicy smart contract manages all insurance policies, integrates with Chainlink Functions for weather data, and processes automated claims. All transactions are publicly verifiable on the Ethereum Sepolia testnet.
Chainlink Functions: Fetches weather data from Open-Meteo API using decentralized oracle network.
Chainlink Automation: Monitors policies daily and triggers automated claim processing when weather thresholds are exceeded.
Landing page introducing the platform, explaining parametric insurance, and showcasing the three insurance categories with their scientific thresholds.
Interactive form for purchasing insurance policies. Users select policy type, coverage duration (30-365 days), farm location coordinates, and see real-time premium calculations before confirming the transaction.
Personal dashboard displaying user's policies, coverage statistics, and claim history. Shows active, expired, and claimed policies with detailed information cards.
Detailed view of a specific policy including insurance type, coverage amount, location coordinates, validity period, weather thresholds, and links to blockchain transactions.
Real-time claim monitoring interface displaying all automated claims, payout amounts, timestamps, and direct links to blockchain transactions for verification.
{
"hardhat": "^2.22.0",
"@chainlink/contracts": "^1.2.0",
"@nomicfoundation/hardhat-toolbox": "^5.0.0",
"dotenv": "^16.4.5",
"ethers": "^6.x"
}Key Technologies:
- Solidity ^0.8.19: Smart contract programming language
- Hardhat: Ethereum development environment
- Chainlink Functions: Decentralized oracle for weather data
- Chainlink Automation: Daily automated upkeep for continuous monitoring
- OpenZeppelin: Security and utility libraries
{
"react": "^18.3.1",
"typescript": "5.6.3",
"vite": "^5.4.20",
"ethers": "^5.8.0",
"tailwindcss": "^3.4.17",
"wouter": "^3.3.5",
"@radix-ui/react-*": "various",
"lucide-react": "^0.453.0"
}Key Technologies:
- React 18: Modern UI framework
- TypeScript: Type-safe development
- Vite: Fast build tool
- Ethers.js: Ethereum library for blockchain interaction
- TailwindCSS: Utility-first CSS framework
- Radix UI: Accessible component primitives
- Wouter: Lightweight routing
- Open-Meteo API: Weather data provider (historical & forecast)
- Chainlink Network: Decentralized oracle infrastructure
- Ethereum Sepolia Testnet: Blockchain network
- MetaMask: Web3 wallet integration
- Docker & Docker Compose installed
- MetaMask browser extension
- Git for cloning the repository
- Sepolia ETH for gas fees (get from Sepolia Faucet)
git clone https://github.com/yourusername/AgriGuard.git
cd AgriGuardCreate .env files in both blockchain and client directories:
blockchain/.env
PRIVATE_KEY=your_wallet_private_key
SEPOLIA_RPC_URL=https://sepolia.infura.io/v3/YOUR_INFURA_KEY
ETHERSCAN_API_KEY=your_etherscan_api_key
CONTRACT_ADDRESS=deployed_contract_addressclient/.env
VITE_CONTRACT_ADDRESS=deployed_contract_address
VITE_NETWORK_NAME=sepolia
VITE_ETHERSCAN_URL=https://sepolia.etherscan.io# Build and start all services
docker-compose up --build -d
# Check service status
docker-compose ps
# View logs
docker-compose logs -fServices:
- Frontend: http://localhost:3000
- Open your browser and navigate to: http://localhost:3000
- Connect your MetaMask wallet (switch to Sepolia network)
- Start purchasing insurance policies!
| NIM | Name |
|---|---|
| 13522138 | Andi Marihot Sitorus |
| 13522150 | Albert Ghazaly |
| 13522158 | Muhammad Rasheed Qais Tandjung |
AgriGuard/
βββ blockchain/ # Smart contracts & deployment
β βββ contracts/
β β βββ WeatherInsurance.sol
β βββ scripts/
β β βββ deploy.js
β β βββ setSourceCode.js
β β βββ debug.js
β β βββ code.js # Chainlink Functions source code
β βββ hardhat.config.js
β βββ package.json
β
βββ client/ # Frontend application
β βββ src/
β β βββ components/ # Reusable UI components
β β βββ pages/
β β β βββ Home.tsx
β β β βββ BuyPolicy.tsx
β β β βββ Dashboard.tsx
β β β βββ PolicyDetail.tsx
β β β βββ Claim.tsx
β β βββ lib/
β β β βββ constant.ts # Contract ABI & addresses
β β β βββ wallet-context.tsx
β β βββ App.tsx
β βββ package.json
β βββ vite.config.ts
β
βββ img/ # Documentation screenshots
βββ docker-compose.yml
βββ Dockerfile
βββ README.md
Take the following screenshots and save them in the img/ folder:
| # | Filename | Description |
|---|---|---|
| 1 | logo.png |
AgriGuard logo (from homepage or design) |
| 2 | etherscan-contract.png |
Deployed contract on Sepolia Etherscan |
| 3 | chainlink-integration.png |
Chainlink Functions subscription & Automation upkeep |
| 4 | page-home.png |
Complete homepage with hero and features |
| 5 | page-buy-policy.png |
Full policy purchase form |
| 6 | page-dashboard.png |
Dashboard with stats and policy list |
| 7 | page-policy-detail.png |
Individual policy detail view |
| 8 | page-claim.png |
Claim monitoring page with history |
Total: 8 screenshots needed






