A cutting-edge decentralized finance (DeFi) platform for tokenized invoice financing built on the Algorand blockchain. Suppliers tokenize invoices as ASAs, investors fund them with AI-driven risk assessment, and settlements are automated via secure atomic transactions.
- Invoice Tokenization β Convert invoices into Algorand Standard Assets (ASA) for on-chain trading
- Smart Contracts β PyTeal contracts for secure financing, settlement, and ownership transfer
- Atomic Transactions β All-or-nothing execution prevents partial failures
- AI Risk Scoring β Intelligent evaluation of invoice risk and recommended interest rates
- Liquidity Pool β Decentralized funding pool for investors with deposit/withdrawal
- Automated Settlement β On-due-date settlement with interest calculation
- Pera Wallet Integration β Native
@perawallet/connectSDK with session persistence and reconnection
- Premium Fintech UI β Glassmorphism, gradient borders, animated counters, micro-interactions
- Wallet Modal β Centered modal for wallet connection with step-by-step guide
- Animated Analytics β Count-up metrics, gradient progress bars, transaction timeline
- Responsive Design β Fully responsive from mobile (375px) to desktop (1440px+)
- Dark Mode β Sleek dark theme with custom scrollbars and selection colors
- 10+ CSS Animations β Fade-in, slide-up, scale-in, float, shimmer, pulse-glow, stagger, gradient-shift
- Deposit Modal β Proper in-app deposit flow (no
window.prompt) - Dismissible Alerts β Error and success messages with close buttons
- RESTful API β Comprehensive Express.js API for all CRUD operations
- Transaction Logging β Complete audit trail of all operations
- Risk Scoring Engine β Multi-factor AI evaluation model
- Production-Ready β Error handling, validation, CORS, and auth-ready
InvoiceFlow/
βββ frontend/ # React 18 + Tailwind CSS 3 dashboard
β βββ src/
β βββ App.js # Main shell, routing, wallet modal
β βββ firebase.js # Firebase Auth (Google SSO)
β βββ index.css # Design system (glassmorphism, animations)
β βββ components/
β βββ WalletConnect.js # Pera Wallet SDK integration
β βββ SupplierPanel.js # Invoice creation & management
β βββ InvestorPanel.js # Funding, risk assessment, deposits
β βββ Analytics.js # Platform metrics & transaction log
βββ backend/ # Node.js + Express API server
β βββ server.js # REST API, in-memory store, risk scoring
βββ smart-contracts/ # PyTeal smart contracts for Algorand
β βββ invoice_contract.py # Invoice tokenization & settlement logic
β βββ compile.py # Contract compilation utility
βββ ai-service/ # Python FastAPI risk scoring service
βββ scripts/ # Setup & deployment scripts
βββ docs/ # Screenshots & documentation
| Layer | Technology |
|---|---|
| Blockchain | Algorand TestNet, PyTeal, AlgoSDK |
| Frontend | React 18, Tailwind CSS 3, @perawallet/connect |
| Auth | Firebase Authentication (Google SSO) |
| Backend | Node.js, Express.js |
| AI/ML | Python, FastAPI, NumPy |
| Design | Glassmorphism, CSS animations, Inter font |
- Node.js >= 16.0.0
- Python >= 3.8
- npm or yarn
- Algorand TestNet access
- Pera Wallet app on your phone (for QR code scanning)
git clone <repo-url>
cd infinova-hackathoncd backend
npm install
npm start
# Runs on http://localhost:3001cd ai-service
pip install -r requirements.txt
python main.py
# Runs on http://localhost:8000cd frontend
npm install
npm start
# Opens http://localhost:3000- Sign in with Google (Firebase Auth)
- Click "Connect Wallet" β scan QR with Pera Wallet app
- Create invoices (Supplier tab) or fund them (Investor tab)
- Monitor platform metrics on the Analytics tab
The wallet integration uses the official @perawallet/connect npm SDK:
import { PeraWalletConnect } from '@perawallet/connect';
const peraWallet = new PeraWalletConnect({ chainId: 416002 }); // TestNet
// Connect
const accounts = await peraWallet.connect();
// Reconnect on page refresh
const accounts = await peraWallet.reconnectSession();
// Disconnect
await peraWallet.disconnect();Features:
- Session persistence across page refreshes via
reconnectSession() - Proper disconnect lifecycle with SDK cleanup
- Graceful handling of user-cancelled modals
- Singleton instance pattern to avoid duplicate connections
- Network indicator badge (TestNet / MainNet)
- Sign in β Connect Pera Wallet
- Create invoice with buyer address, amount, and due date
- Invoice tokenized as ASA on Algorand
- Request financing β investors notified
- Receive funds upon investor approval
- Invoice ownership transferred to financier
- Sign in β Connect Pera Wallet β Deposit ALGO to pool
- Browse available invoices with AI risk scores
- Select financing amount and interest rate
- Fund invoice via atomic transaction
- Receive repayment at maturity + earned interest
POST /api/invoices Create invoice
GET /api/invoices List all invoices
GET /api/invoices/:id Get invoice details
POST /api/invoices/:id/finance Finance an invoice
POST /api/invoices/:id/settle Settle an invoice
POST /api/risk-score Calculate AI risk score
POST /api/pool/deposit Deposit ALGO to pool
GET /api/pool/:address Get pool balance
GET /api/analytics Platform metrics
GET /api/transactions Transaction logs
GET /api/health Health check
The AI service evaluates invoices using a weighted multi-factor model:
| Factor | Weight | Description |
|---|---|---|
| Supplier History | 25% | Past performance and reliability |
| Credit Score | 20% | Financial creditworthiness |
| Amount Risk | 15% | Invoice size vs. market exposure |
| Payment Timeliness | 15% | On-time payment ratio |
| Due Date | 10% | Payment term length |
| Transaction Count | 10% | Experience and volume |
| Default History | 5% | Past defaults |
Output: Risk Level (Low / Medium / High) + Suggested Interest Rate
| Risk Level | Interest Rate | Recommended Funding | Risk Score |
|---|---|---|---|
| Low | 5% | 100% | β₯ 0.70 |
| Medium | 10% | 80% | 0.40 β 0.70 |
| High | 20% | 60% | < 0.40 |
The frontend uses a custom CSS design system built on Tailwind CSS 3:
.glass/.glass-strongβ Glassmorphism cards with backdrop blur.gradient-textβ Gradient text clipping (blue β cyan β teal).card-hoverβ Cards with hover lift, border glow, and scale.btn-primary/.btn-secondary/.btn-ghostβ Button variants with scale transforms.badge-success/.badge-warning/.badge-danger/.badge-infoβ Status badges.inputβ Styled inputs with focus ring animations.gradient-borderβ CSS mask-based gradient borders
| Class | Effect |
|---|---|
.animate-fade-in |
Fade + translateY |
.animate-slide-up |
Slide up with fade |
.animate-scale-in |
Scale from 0.92 β 1 |
.animate-float |
Gentle vertical float |
.animate-shimmer |
Shimmer sweep overlay |
.animate-pulse-dot |
Pulsing connection dot |
.animate-gradient |
Background gradient shift |
.stagger-children |
Staggered child delays (80ms intervals) |
- β Firebase Authentication (Google SSO)
- β Input validation on all API endpoints
- β Algorand address format verification (58-char, starts with A)
- β Amount range checks
- β Atomic transaction guarantees
- β CORS protection
- β State immutability on blockchain
- β Error logging and monitoring
- Transaction Finality: < 5 seconds (Algorand)
- API Response Time: < 200ms average
- Frontend Build: Optimized React 18 with code splitting
- Throughput: 1000+ TPS (Algorand network)
- Wallet Reconnect: Instant session restoration
# Frontend tests
cd frontend && npm test
# Backend tests
cd backend && npm test
# Smart contract tests
cd smart-contracts && pytest tests/# Start all services
cd backend && npm start # Terminal 1
cd ai-service && python main.py # Terminal 2
cd frontend && npm start # Terminal 3- Configure
.envwith TestNet RPC endpoints - Deploy contracts to TestNet
- Update frontend configuration
- Run:
npm run deploy:testnet
- Audit smart contracts
- Configure MainNet endpoints
- Enable production security settings
- Deploy with:
npm run deploy:mainnet
git checkout -b feature/your-feature
git commit -m 'Add your feature'
git push origin feature/your-feature
# Open Pull RequestMIT License β see LICENSE for details.
- Algorand Foundation β blockchain infrastructure
- Pera Wallet β wallet SDK
- PyTeal β smart contract framework
- React & Tailwind CSS β frontend
Built with β€οΈ for the Algorand and DeFi communities
Made for Infinova Hackathon 2026 π


