A decentralized solution for tracking agricultural products through their lifecycle using blockchain technology.
The product tracking and identification in the supply chain that uses blockchain technology, the ethereum network, smart contracts and QR codes to provide transparency and security and promote decentralisation.
Designing blockchain model for agriculture product tracking involves using the inherent characteristics of blockchain - decentralisation, immutability and transparency - to track agricultural products through every stage of their lifecycle. This include everything from production, processing, transportation, and distribution, to retail.
Legacy setup guide in old README.md
- Features
- Project Structure
- Prerequisites
- Setup Guide
- Running the system with Docker
- Hardhat Accounts
- Test Accounts
- License
- QR codes are used by the system to promote product authenticity. Scan a QR code to verify the history, origin and information of a product by fetching supply chain information in the Ethereum's decentralized database.
- Product traceability with blockchain verification using the Ethereum network via Hardhat and smart contracts.
- PostgreSQL used for database backend.
- React frontend dashboard for the web interface.
- Docker for easy build & testing of the application.
- Nginx as a reverse proxy.
agriculture-product-tracking-chain/
├── backend/
├── database/
├── frontend/
├── nginx/
└── smartcontract/
- Docker
- MetaMask
- Git
git clone https://github.com/SOSANE/agriculture-product-tracking-chain
cd agriculture-product-tracking-chain- Create a MetaMask wallet if you do not own one.
- Download the Metamask's browser extension and connect your wallet.
- Navigate to root project
- Run the following command
docker compose up --buildAfter build & start is completed, access the application on http://localhost:5173.
- Hardhat gives 20 accounts with their private keys, each account have a wallet with 10000 ETH (Testnet). PS. All hardhat accounts and their private keys are PUBLIC INFORMATION. For example, account #0's address is always
0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266&0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80is the private key → Read more on Harhat (docs) - For testing purposes (
transactions), import a few Hardhat accounts including account #0 to Metamask wallet using their private keys by adding a personal network with the following parameters:- Local network (default RPC URL):
http://localhost:8545/ - Chain ID:
1337 - Currency symbol:
ETH
- Local network (default RPC URL):
ADMIN_PRIVATE_KEYvariable is associated to account #0 private key.
Log in using the test accounts.
Several accounts pre-made for testing purposes:
| Role | Username | Password |
|---|---|---|
| Admin | admin | admin123 |
| Farmer | farmer1 | password123 |
| Farmer | farmer2 | password123 |
| Farmer | farmer3 | password123 |
| Farmer | farmer4 | password123 |
| Regulator | regulator1 | securepass |
| Regulator | regulator2 | securepass |
| Regulator | regulator3 | securepass |
| Processor | processor1 | process123 |
| Processor | processor2 | process321 |
| Distributor | distributor1 | distribute123 |
| Distributor | distributor2 | distribute321 |
| Retailer | retailer1 | retail123 |
MIT © 2025 AgriChain