Blockchain-driven agricultural supply-chain platform connecting rural farmers, buyers, and delivery drivers.
AgriTrust empowers rural farmers by connecting them directly to buyers and drivers through transparent, blockchain-verified transactions—enabling secure payments, real-time delivery tracking, and complete supply-chain visibility from farm to customer.
AgriTrust is a full-stack platform with a Node.js backend and three Expo mobile apps (Buyer, Driver, Farmer). It enables seamless product ordering, delivery tracking, and blockchain-anchored transaction auditability for rural farming communities.
Key capabilities:
- Buyers browse products, checkout, and track deliveries
- Drivers manage assignments, deliveries, and proof-of-delivery
- Farmers manage inventory, accept orders, and process payouts
- Blockchain anchoring for critical transaction events (Sepolia testnet)
- Payment integration via Stripe and Nodemailer notifications
- Backend: Node.js + Express
- Mobile: Expo / React Native
- Database: MongoDB
- Cache & Messaging: Upstash Redis
- Payments: Stripe
- Blockchain: Ethereum (Sepolia) with smart contract integration
- File Storage: Cloudinary + Multer
- Node.js 16+ and npm
- Expo CLI:
npm install -g expo-cli
# Clone and navigate
git clone <repo-url> AgriTrust
cd AgriTrust
# Backend
cd backend
npm install
npm run dev
# Mobile apps (each in new terminal)
cd ../buyer-mobile && npm install && expo start
cd ../driver-mobile && npm install && expo start
cd ../farmer-mobile && npm install && expo startNotes:
- Backend defaults to
PORT=5001and binds to0.0.0.0 - Apps read API URL from
constants/config.js - Backend scripts:
npm run dev(nodemon),npm start(production)
backend/
├── src/
│ ├── controllers/ # HTTP handlers
│ ├── services/ # Business logic & blockchain helpers
│ ├── models/ # Mongoose schemas
│ ├── routes/ # API endpoints
│ ├── middleware/ # Auth, rate-limit, validation
│ ├── config/ # Configuration
│ └── utils/ # Utilities
└── scripts/
└── viewBlockchainData.js # Blockchain inspection tool
buyer-mobile/
├── app/ # Screens & navigation
├── components/ # UI components & toasts
├── contexts/ # App state (CartContext, RegistrationContext)
└── utils/constants/ # API wrappers, color scheme, config
driver-mobile/
├── app/ # Screens & navigation
├── components/ # UI components
├── contexts/ # Driver registration state
└── utils/constants/ # API, config, navigation guards
farmer-mobile/
├── app/ # Screens & navigation
├── components/ # UI components
├── contexts/ # State management
└── utils/constants/ # Helpers & config
/api/products— Product listings/api/orders— Order lifecycle & checkout/api/transactions— Transaction records & blockchain status/api/delivery-jobs— Delivery assignments/api/driver-delivery-records— Delivery proof & history/api/notifications— Notifications & alerts- (Auth, rate-limiting, file uploads handled by middleware)
Key transactions (order acceptance, processing, ready-for-delivery) are anchored to Sepolia smart contract.
Inspect on-chain data:
# View transaction by MongoDB ID
node scripts/viewBlockchainData.js <transactionId>
# View by transaction hash
node scripts/viewBlockchainData.js --txHash 0x...
# View contract address
node scripts/viewBlockchainData.js --contractPORT=5001
NODE_ENV=development
JWT_SECRET=your_jwt_secret_here
MONGODB_URI=mongodb://localhost:27017/agritrust
LEDGER_CONTRACT_ADDRESS=0xYOUR_CONTRACT_ADDRESSConfigure API endpoints in constants/config.js for each app.
- Backend: Layered (controller → service → model)
- Mobile: Component + Context pattern for state management
- Data flow: Services handle business logic; screens render and navigate
- Branch:
git checkout -b feature/your-change - Test locally and follow existing code style
- Submit PR with clear description
Private repository. Contact the project owner for licensing details.
Author: Diana Angan
GitHub: @dianaangan
Collaborators:
- Built with modern Node.js and React Native best practices.
- Inspired by clean, modular architectures for scalable mobile and backend systems.
- Blockchain integration powered by Ethereum smart contracts for immutable transaction records.
- Thanks to everyone who provided feedback on UX, delivery workflows, and notification behavior.
⭐ If AgriTrust helps you streamline agricultural supply chains, consider starring the repository!