EasyA x Algorand Harvard Hackathon Project
PayGuard AI revolutionizes autonomous shopping with AI agents that can make purchases within authorized spending limits. Built on Algorand blockchain for instant finality and powered by GPT-4 for intelligent shopping decisions.
๐ฏ Smart Contract: View on Pera Explorer
๐ค Creator Address: View Deployer Wallet
Application ID: 745512518 โข Deployed on Algorand TestNet โข Fully Functional
Parents want to give their kids shopping autonomy without losing control. Teams need shared budgets with smart approval flows. Current solutions lack the intelligence to shop effectively while maintaining security.
PayGuard AI combines:
- AI Shopping Agents - GPT-4 powered agents that find the best products
- Smart Authorization - Auto-approve under limits, manual for larger amounts
- Blockchain Security - Algorand's instant finality ensures secure payments
- Real-time Notifications - Server-sent events for instant updates
- ๐ค GPT-4 powered product search and recommendations
- ๐ฌ Natural language shopping conversations
- ๐๏ธ Smart budget-aware shopping decisions
- โก One-click purchase requests
- โ Auto-approval for purchases under spending limit
- ๐ Real-time notifications for pending approvals
- ๐ Complete transaction history and analytics
- ๐ณ Multi-agent management with individual limits
- โ๏ธ TEALScript smart contracts on Algorand
- ๐ Pera Wallet integration
- โก 2.8 second transaction finality
- ๐ฐ Low transaction fees (~0.001 ALGO)
- Frontend: Next.js 14, TypeScript, Tailwind CSS, shadcn/ui
- AI: OpenAI GPT-4, Function calling
- Blockchain: Algorand, TEALScript, AlgoKit 3.0
- Database: Turso (SQLite at the edge)
- Real-time: Server-Sent Events
- Wallet: Pera Wallet Connect
# Clone the repository
git clone https://github.com/yourusername/payguard-ai.git
cd payguard-ai
# Install Node 24
nvm install 24
nvm use 24
# Install dependencies
npm install
# Set up environment variables
cp .env.local.example .env.local
# Add your OpenAI API key to .env.local
# Initialize database
npm run dev
# Then visit http://localhost:3000/api/init
# Compile smart contracts
npm run contract:compile- Connect Wallet: Connect your Pera Wallet on the landing page
- Create Agent: Click "Create AI Agent" and set a spending limit
- Start Shopping: Click "Chat with Agent" to start shopping
- Find Products: Ask the AI to find products (e.g., "Find me a gaming laptop")
- Make Purchases: Click "Buy" on recommended products
- Approve Payments: Check the Approvals tab for pending payments
- Track History: View all transactions in the History tab
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Frontend (Next.js) โ
โ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โ
โ โ Wallet โ โ AI Chat UI โ โ
โ โ Provider โ โ Components โ โ
โ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ API Routes (Next.js) โ
โ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โ
โ โ Agent โ โ Payment โ โ
โ โ Management โ โ Processing โ โ
โ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ โ
โโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโ
โ Turso DB โ โ Algorand โ
โ (SQLite) โ โ Blockchain โ
โโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโ
Sarah's Shopping Assistant
- Sarah (parent) creates an AI agent with $100 limit for her daughter
- Daughter asks AI: "Find me a good backpack for school"
- AI recommends 3 options within budget
- Daughter selects a $45 backpack (auto-approved)
- Later, daughter tries to buy $80 headphones
- Requires Sarah's manual approval
- Sarah gets real-time notification and approves
- AI-First Shopping - First platform to combine GPT-4 with blockchain payments
- Smart Authorization - Automatic approval logic based on spending limits
- Instant Finality - Leveraging Algorand's 2.8 second blocks
- Real-time Updates - SSE for instant notifications
createAgentWallet(agentId, spendingLimit) // Create AI agent
requestPayment(amount, recipient, reason) // Request payment
approvePayment(requestId) // Approve payment
setSpendingLimit(agentId, newLimit) // Update limits
getAgentBalance(agentId) // Check balance# Build for production
npm run build
# Deploy to Vercel
vercel --prod
# Deploy smart contract
npm run contract:deploy# OpenAI
OPENAI_API_KEY=your_openai_api_key
# Database
DATABASE_URL=libsql://your-db.turso.io
DATABASE_AUTH_TOKEN=your_auth_token
# Algorand
NEXT_PUBLIC_ALGORAND_NETWORK=testnet
NEXT_PUBLIC_APP_ID=your_app_id# Run development server
npm run dev
# Test smart contract
npm run contract:test
# Build production
npm run build- 100% TypeScript - No Python, pure TypeScript stack
- 36 Hour Build - Complete platform in hackathon timeframe
- Working Demo - Fully functional with real AI and blockchain
- Instant Payments - 2.8 second finality on Algorand
Built with โค๏ธ for the EasyA x Algorand Harvard Hackathon
MIT License - See LICENSE file for details
- EasyA for organizing the hackathon
- Algorand Foundation for blockchain infrastructure
- OpenAI for GPT-4 API
- Pera Wallet for wallet integration
Demo Video: [Link to video]
Live Demo: [Link to deployed app]
Pitch Deck: [Link to slides]