Coordinating Aid. Autonomously.
The world's first AI-powered humanitarian logistics platform that combines blockchain transparency with autonomous decision-making to revolutionize global aid delivery.
- Overview
- Key Features
- Technology Stack
- Architecture
- Getting Started
- Smart Contract
- AI Agents
- Blockchain Integration
- Project Structure
- Development
- Deployment
- Contributing
- License
AidRoute is an autonomous humanitarian coordination platform that leverages cutting-edge AI and blockchain technology to optimize global aid delivery. Built for the Artificial Superintelligence Alliance (ASI) hackathon, AidRoute addresses critical challenges in humanitarian logistics: slow response times, lack of transparency, and inefficient resource allocation.
Traditional humanitarian aid faces significant challenges:
- β±οΈ Slow Response Times: Average response time of 72+ hours
- πΈ Fund Mismanagement: ~30% of aid funds lost to inefficiencies
- π Lack of Transparency: Limited visibility into fund deployment
- π Poor Coordination: Siloed operations and duplicate efforts
AidRoute combines AI-powered decision-making with blockchain transparency to:
- π Reduce Response Time: From days to minutes (18min average)
- π Ensure Transparency: Every dollar tracked on-chain
- π€ Automate Coordination: AI agents handle complex logistics
- π° Optimize Resources: Smart matching of needs to available supplies
- MeTTa Reasoning Engine: Advanced symbolic AI from the Artificial Superintelligence Alliance for logical reasoning and decision-making
- Real-Time Disaster Monitoring: Continuous analysis of global humanitarian needs via GDACS feeds
- Autonomous Mission Planning: AI agents automatically create and optimize aid delivery missions
- Predictive Analytics: Anticipate needs and optimize resource allocation
- Smart Contract System: Ethereum-based mission and fund management using Hardhat
- PayPal USD (PYUSD) Integration: Stablecoin payments for predictable budgeting
- Cryptographic Verification: Immutable proof of delivery and fund deployment
- Full Audit Trail: Complete transparency from donation to delivery
- Live Mission Tracking: Real-time visualization of all active missions
- Interactive Global Map: Leaflet-powered mapping of disaster zones and aid routes
- Resource Coordination: Dynamic allocation and tracking of supplies
- MetaMask Integration: Seamless crypto wallet connection for donations
- System Metrics: Active missions, critical alerts, verified deliveries
- Blockchain Statistics: On-chain mission data and funding tracking
- Delivery Verification: Photo and GPS proof of successful aid delivery
- Performance Dashboards: Real-time monitoring of system efficiency
- Next.js 15.5.5: React framework with App Router for server-side rendering and optimal performance
- React 19.1: Latest React with concurrent features
- TypeScript 5.8: Type-safe development
- Tailwind CSS 4: Utility-first styling with custom animations
- Hardhat 3.0.7: Ethereum development environment for compiling, testing, and deploying smart contracts
- Used for local blockchain testing with Hardhat Network
- Contract compilation and verification
- Automated deployment scripts with Hardhat Ignition
- Integration testing with Chai and Viem
- Ethers.js 6.15: Ethereum wallet implementation and contract interaction
- Viem 2.38: Modern Ethereum library for type-safe blockchain interactions
- OpenZeppelin Contracts 5.4: Battle-tested smart contract libraries
- Solidity 0.8.28: Smart contract programming language
- Artificial Superintelligence Alliance (ASI): Core AI reasoning engine
- MeTTa (Meta Type Talk): Symbolic AI language for advanced reasoning
- Hyperon: ASI's cognitive architecture for autonomous decision-making
- Enables logical inference and complex decision trees
- Powers autonomous mission planning and resource optimization
- OpenAI GPT: Natural language processing for disaster analysis
- Python 3.9: Backend AI service implementation
- Flask: API bridge for AI agent communication
- PayPal USD (PYUSD): ERC-20 stablecoin for humanitarian funding
- Eliminates crypto volatility with 1:1 USD backing
- Enables instant, low-cost international transfers
- Regulatory compliant and audited stablecoin
- Deployed on Ethereum mainnet and testnets
- Contract Address:
0x6c3ea9036406852006290770BEdFcAbA0e23A0e8(Sepolia)
- MetaMask: Browser wallet for secure transaction signing
- GDACS (Global Disaster Alert and Coordination System): Real-time disaster feed
- Leaflet: Interactive mapping library for geospatial visualization
- React Leaflet: React components for Leaflet maps
- ESLint: Code linting and quality assurance
- PostCSS: CSS processing and optimization
- Lucide React: Modern icon library
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Frontend (Next.js) β
β βββββββββββββββ ββββββββββββββββ ββββββββββββββββββββ β
β β Dashboard β β Operations β β AI Assistant β β
β β Landing β β Planning β β MetaMask β β
β βββββββββββββββ ββββββββββββββββ ββββββββββββββββββββ β
ββββββββββββββ¬βββββββββββββββββββββββββββββββββββββ¬βββββββββββ
β β
βββββββββββββββββββ¬ββββββββββββββββββββ€
β β β
ββββββββββΌβββββββββ βββββββΌβββββββ βββββββββΌβββββββββ
β AI Agents β β Blockchain β β Real-Time β
β (Python) β β Smart β β Disaster β
β β β Contracts β β Service β
β β’ MeTTa Engine β β β β β
β β’ GPT Analysis β β β’ Hardhat β β β’ GDACS API β
β β’ GDACS Parser β β β’ PYUSD β β β’ Event Stream β
βββββββββββββββββββ ββββββββββββββ ββββββββββββββββββ
β β β
βββββββββββββββββββ΄ββββββββββββββββββββ
β
ββββββββββΌββββββββββ
β Data Services β
β β
β β’ Production β
β β’ Blockchain β
β β’ Transaction β
ββββββββββββββββββββ
-
Frontend Layer
- Next.js App Router for server and client components
- Real-time updates via React hooks
- MetaMask integration for Web3 wallet connectivity
- Responsive design with Tailwind CSS
-
AI Agent Layer
- Python-based microservices
- MeTTa reasoning engine for autonomous decisions
- GDACS disaster feed analysis
- RESTful API bridge to frontend
-
Blockchain Layer
- Smart contracts deployed via Hardhat
- PYUSD token integration for payments
- Mission lifecycle management on-chain
- Event emission for frontend synchronization
-
Data Layer
- Real-time disaster monitoring
- Blockchain transaction tracking
- Production data services
- Event-driven architecture
- Node.js: v18.x or higher
- npm: v9.x or higher
- Python: v3.9 or higher (for AI agents)
- MetaMask: Browser extension installed
- Git: For version control
-
Clone the repository
git clone https://github.com/yourusername/aidroute.git cd aidroute -
Install Node.js dependencies
npm install
-
Set up Python AI agents
cd ai-agents python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate pip install -r requirements.txt cd ..
-
Configure environment variables
Create a
.env.localfile in the root directory:# OpenAI API (for AI agents) OPENAI_API_KEY=your_openai_api_key # Ethereum Network Configuration SEPOLIA_RPC_URL=https://sepolia.infura.io/v3/YOUR_INFURA_KEY SEPOLIA_PRIVATE_KEY=your_wallet_private_key # Contract Addresses NEXT_PUBLIC_CONTRACT_ADDRESS=your_deployed_contract_address NEXT_PUBLIC_PYUSD_ADDRESS=0x6c3ea9036406852006290770BEdFcAbA0e23A0e8 # API Configuration NEXT_PUBLIC_AI_AGENT_URL=http://localhost:5000
-
Start the AI agent service
cd ai-agents ./start_ai_service.sh cd ..
-
Run the development server
npm run dev
-
Open your browser
Navigate to http://localhost:3000
The core smart contract manages humanitarian missions and PYUSD payments.
- Mission Management: Create, fund, and track humanitarian missions
- PYUSD Integration: Accept donations and deploy funds using PayPal USD stablecoin
- Multi-Signature Operations: Enhanced security for fund deployment
- Delivery Verification: Cryptographic proof of successful aid delivery
- Event Emission: Real-time blockchain events for frontend synchronization
contract AidRouteMissions {
// Mission lifecycle: Pending β Funded β InProgress β Delivered β Verified
struct Mission {
uint256 id;
string location;
string description;
uint256 fundingGoal;
uint256 fundsDeployed;
MissionStatus status;
string deliveryProof; // IPFS or data URI
}
// PYUSD token integration
IERC20 public pyusdToken;
// Core functions
function createMission(...) external;
function donateToMission(uint256 missionId, uint256 amount) external;
function deployFunds(uint256 missionId, uint256 amount) external;
function verifyDelivery(uint256 missionId, string calldata proof) external;
}npx hardhat compilenpx hardhat testnpx hardhat ignition deploy ./ignition/modules/AidRoute.ts --network sepolia# Terminal 1: Start local node
npx hardhat node
# Terminal 2: Deploy contracts
npx hardhat ignition deploy ./ignition/modules/AidRoute.ts --network localhostFor testing on Sepolia:
- Get Sepolia ETH from Sepolia Faucet
- Get test PYUSD from PayPal Developer Portal
AidRoute leverages the ASI Alliance technology stack for autonomous decision-making:
MeTTa (Meta Type Talk) is a symbolic AI language developed by the ASI Alliance that enables:
- Logical Inference: Complex reasoning about disaster scenarios
- Knowledge Representation: Structured understanding of humanitarian needs
- Decision Trees: Autonomous mission planning and resource allocation
- Explainable AI: Transparent reasoning process for trust and verification
# Example MeTTa reasoning for mission prioritization
class MettaReasoner:
def analyze_disaster(self, disaster_data):
"""
Use MeTTa to reason about disaster severity and response needs
"""
metta_code = f"""
(= (severity ?disaster ?score)
(and (magnitude ?disaster ?mag)
(population-affected ?disaster ?pop)
(* ?mag ?pop ?score)))
(analyze {disaster_data})
"""
return self.metta_engine.eval(metta_code)- GDACS Analyzer: Parses and analyzes global disaster feeds
- Mission Planner: Creates optimized aid delivery missions
- Resource Optimizer: Matches available supplies with urgent needs
- Risk Assessor: Evaluates mission feasibility and safety
cd ai-agents
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
python src/aidroute_agent.pyThe AI service will run on http://localhost:5000 and provide:
/analyze-disasters: Disaster severity analysis/plan-mission: Autonomous mission creation/optimize-route: Logistics optimization
AidRoute uses PYUSD as the primary payment currency for several strategic reasons:
- Price Stability: 1 PYUSD = 1 USD, eliminating crypto volatility
- Regulatory Compliance: Issued by Paxos, fully regulated and audited
- Global Accessibility: PayPal's infrastructure enables worldwide reach
- Low Fees: Minimal transaction costs compared to traditional banking
- Instant Settlement: Near-instant cross-border transfers
- Transparency: All transactions verifiable on Ethereum blockchain
- Ethereum Mainnet:
0x6c3ea9036406852006290770BEdFcAbA0e23A0e8 - Sepolia Testnet:
0x6c3ea9036406852006290770BEdFcAbA0e23A0e8
// Donate PYUSD to a mission
async function donateToMission(missionId: number, amount: number) {
const pyusdContract = new ethers.Contract(PYUSD_ADDRESS, PYUSD_ABI, signer);
const missionContract = new ethers.Contract(
MISSION_ADDRESS,
MISSION_ABI,
signer
);
// 1. Approve PYUSD spending
await pyusdContract.approve(MISSION_ADDRESS, amount);
// 2. Donate to mission
await missionContract.donateToMission(missionId, amount);
}AidRoute seamlessly integrates with MetaMask for:
- Secure wallet connection
- Transaction signing
- Network switching (Mainnet/Sepolia)
- Balance checking
aidroute/
βββ ai-agents/ # Python AI service
β βββ src/
β β βββ aidroute_agent.py # Main AI orchestrator
β β βββ metta_reasoner.py # MeTTa reasoning engine
β β βββ gdacs_analyzer.py # Disaster feed parser
β β βββ api_bridge.py # Flask API server
β βββ requirements.txt
β βββ start_ai_service.sh
β
βββ app/ # Next.js app directory
β βββ api/ # API routes
β β βββ ai/ # AI agent endpoints
β β βββ gdacs/ # Disaster feed proxy
β β βββ payments/ # Blockchain transactions
β βββ layout.tsx # Root layout
β βββ page.tsx # Landing page
β
βββ components/ # React components
β βββ dashboard-layout.tsx
β βββ home-view.tsx
β βββ operations-view.tsx
β βββ planning-view.tsx
β βββ audit-view.tsx
β βββ disaster-map.tsx
β βββ live-system-monitor.tsx
β βββ real-metaMask-integration.tsx
β
βββ contracts/ # Solidity smart contracts
β βββ AidRouteMissions.sol
β
βββ lib/ # Utility libraries
β βββ production-data.ts # Data service
β βββ blockchain-disaster-integration.ts
β βββ real-time-disasters.ts
β βββ contract-integration.ts
β βββ utils.ts
β
βββ scripts/ # Hardhat deployment scripts
β βββ deploy.ts
β βββ create-first-mission.ts
β βββ interact.ts
β
βββ test/ # Smart contract tests
β βββ AidRouteMissions.test.ts
β
βββ public/ # Static assets
β βββ logo.png
β
βββ hardhat.config.ts # Hardhat configuration
βββ package.json # Node.js dependencies
βββ tsconfig.json # TypeScript config
βββ README.md # This file
npx hardhat test
npx hardhat test --network sepolianpm run test-
Start Hardhat Network
npx hardhat node
-
Deploy Contracts Locally
npx hardhat ignition deploy ./ignition/modules/AidRoute.ts --network localhost
-
Connect MetaMask to Local Network
- Network Name: Hardhat Local
- RPC URL: http://127.0.0.1:8545
- Chain ID: 31337
- Currency: ETH
# Lint code
npm run lint
# Format code
npm run format
# Type check
npm run type-check- Development:
npm run dev- Runs with Turbopack for fast refresh - Production Build:
npm run build- Optimized production build - Start Production:
npm start- Serves production build
-
Connect to Vercel
npm install -g vercel vercel
-
Configure Environment Variables
- Add all
.env.localvariables to Vercel dashboard - Ensure
NEXT_PUBLIC_*variables are set
- Add all
-
Deploy
vercel --prod
npx hardhat ignition deploy ./ignition/modules/AidRoute.ts --network sepolia --verifynpx hardhat ignition deploy ./ignition/modules/AidRoute.ts --network mainnet --verifyFor production, deploy the AI service to a cloud provider:
# Example: Deploy to Railway
railway login
railway init
railway upOr use Docker:
cd ai-agents
docker build -t aidroute-ai .
docker run -p 5000:5000 aidroute-ai- Core dashboard and UI
- Smart contract development
- PYUSD integration
- AI agent implementation
- Real-time disaster monitoring
- Mobile application
- Multi-chain support (Polygon, BSC)
- Advanced AI predictions
- Integration with more humanitarian APIs
- Community governance (DAO)
- Partnership with major NGOs
- Regulatory compliance (all regions)
- Fiat on-ramp integration
- Advanced analytics dashboard
- Automated impact reporting
We welcome contributions from the community! Here's how you can help:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Follow TypeScript best practices
- Write tests for new features
- Update documentation
- Follow the existing code style
- Keep PRs focused and atomic
This project is licensed under the MIT License - see the LICENSE file for details.
- Artificial Superintelligence Alliance (ASI): For the MeTTa reasoning engine and ASI technology stack
- PayPal / Paxos: For PYUSD stablecoin infrastructure
- Hardhat: For the excellent Ethereum development environment
- GDACS: For real-time disaster alert feeds
- OpenZeppelin: For secure smart contract libraries
- Next.js Team: For the amazing React framework