Cleva Borderless — The City Built On Cleva's Rails
💡 What Inspired Us
The judges at our first hackathon session told us something that stung but changed everything:
"You're just re-pitching Cleva back to Cleva."
They were right. Our first submission was a polished UI on top of what Cleva already does. So we went back to first principles and asked one question:
What can USDT do as programmable money that nobody in Nigeria has actually built yet?
The answer wasn't in the technology. It was in the people.
We thought about students like Dele — 200 level, Computer Science, ABU Zaria. In a single week:
- His ₦20,000 Nelfund allowance loses 40% of its value to inflation before he spends it
- The campus POS declines three times and he goes hungry
- He finishes a logo job for a Canadian client, earns \$100, receives \$82, and waits 7 days
- His Ajo savings partner collects the pot in Round 3 and disappears
- His mum in Birmingham sends £200 through Western Union, loses £25 in fees, and the money takes 3 days
Five broken systems. One student. Two million students across Nigeria facing the same thing every week.
That is what inspired Cleva Borderless.
🏗️ How We Built It
Tech Stack
| Layer | Technology |
|---|---|
| Frontend | Next.js 14 + Tailwind CSS |
| Database | Supabase (PostgreSQL) |
| AI | Gemini API — gemini-3.8-flash |
| PayPal | Orders API v2 + Payouts API v1 |
| Stablecoin | USDT TRC-20 via Cleva Partner API |
| Deployment | Vercel |
Architecture
The app is structured as a mobile-first web application centered in a 390px mobile frame — intentionally designed to feel like a phone app on both desktop and mobile, because our users will primarily access it on their phones.
Supabase handles all shared state — wallet balances, Ajo circle memberships, escrow transactions, vault balances, loan records, and AI conversation history. Real-time subscriptions power live features like the Ajo member join notification and the yield ticker.
PayPal is integrated in two distinct flows:
// Journey 1 — Diaspora: parent pays via PayPal Orders API
POST /api/paypal/create-order → creates order
POST /api/paypal/capture-order → captures + credits student wallet
// Journey 2 — Escrow: freelancer receives via PayPal Payouts
POST /api/paypal/payout → sends to freelancer PayPal email
Gemini AI powers Ada, the savings coach. On every conversation, Ada fetches the user's live financial context from Supabase — vault balance, active loans, Ajo commitments, recent transactions — and passes it as context to the model. Every response is grounded in real data, not generic advice.
The Six Features
We built six features that Cleva cannot ship as a single product update:
1. 🔒 Escrow PayLink USDT held in escrow until freelancer marks delivery and client approves. Payout via USDT wallet or PayPal Payouts API.
2. 🤝 Ajo Circle Rotating savings groups with USDT collateral locked on join. If a member misses a contribution:
$$\text{pot} = \sum_{i=1}^{n} c_i$$
where $c_i$ is each member's contribution — the collateral slash ensures the pot is always fully funded regardless of defaults.
3. 📈 StableSave Yield 8% APY on USDT vault with a live ticker. The per-minute yield rate in demo mode:
$$r_{minute} = \frac{8\%}{525,600} \times 1440$$
The $\times 1440$ multiplier accelerates the demo so judges can watch the number grow in real time.
4. 🏫 Campus Vendor Network A shared USDT settlement pool for campus merchants. 47 vendors, zero inter-bank transfers, one QR code per vendor, one daily claim to wallet.
5. 💳 Micro-Loans Students borrow up to 40% of their vault balance:
$$\text{max loan} = 0.4 \times \text{vault principal}$$
Flat 2% fee. Collateralised by their own USDT. No bank, no guarantor, no credit bureau.
6. 🌍 Diaspora Allowance Parent opens student's personal link. Pays via PayPal. Student receives USDT in under 2 seconds. Saves \$25 per transfer vs traditional wire.
🧗 Challenges We Faced
1. PayPal Regional Restrictions
Creating a sandbox app from a Nigerian PayPal developer account failed with:
"Something went wrong creating the application. US accounts only."
Fix: Created a dedicated US PayPal developer account for sandbox access. Took longer than expected but unlocked the full Orders and Payouts API suite.
2. Supabase Null Safety
Multiple API routes crashed with 500 errors when
users had no existing vault or loan record.
The culprit was .single() which throws an
error on empty results.
Fix: Switched every query to .maybeSingle()
and wrapped all API responses in safe default
objects so the UI always receives a valid shape:
// Before — crashes if no record found
const { data } = await supabase
.from('yield_vaults')
.select('*')
.single()
// After — returns null safely
const { data } = await supabase
.from('yield_vaults')
.select('*')
.maybeSingle()
return NextResponse.json({
vault: data || null,
transactions: []
})
3. Ajo Members Not Syncing
When a second user joined a circle using the invite code, they appeared to join successfully but the circle creator still only saw themselves.
Root cause: Circle data was stored in localStorage — each user had their own local copy of the JSON. Join writes went to the joiner's local state, invisible to the creator.
Fix: Migrated all Ajo data to Supabase with real-time subscriptions. Now when User B joins, User A's screen updates live without refresh:
supabase
.channel(`circle-${circleId}`)
.on('postgres_changes', {
event: 'INSERT',
schema: 'public',
table: 'ajo_members',
filter: `circle_id=eq.${circleId}`
}, (payload) => {
setMembers(prev => [...prev, payload.new])
toast.success(`${payload.new.display_name}
joined the circle!`)
})
.subscribe()
4. Mobile Frame Consistency
As more features were added, newer pages broke out of the centered 390px mobile frame and expanded to full browser width — creating an inconsistent experience where some pages felt like a phone app and others felt like a random website.
Fix: Created a single MobileFrame wrapper
component applied at the root layout level:
export default function MobileFrame({ children }) {
return (
<div className="min-h-screen bg-[#070d1a]
flex items-start justify-center">
<div className="w-full max-w-[390px]
min-h-screen bg-[#0f172a] flex flex-col
overflow-hidden md:shadow-2xl">
{children}
</div>
</div>
)
}
Every page now respects the frame automatically.
5. Ada Needing Real Data
Our first version of Ada was a generic financial chatbot. It gave advice like "consider saving more each month" — useless to someone with \$47.50 in their wallet and an Ajo contribution due Friday.
Fix: Before every Claude API call, we fetch the user's complete financial snapshot from Supabase — vault, loans, Ajo circles, recent transactions — and inject it into the system prompt. Ada now responds with:
"You have \$47.50 in your wallet and your ABU CS Squad needs \$10 USDT by Friday — you're covered. Sharp sharp, you're good!"
That is the difference between a chatbot and an AI coach.
📚 What We Learned
1. Cultural fit beats technical sophistication The Ajo Circle resonates more with Nigerian users than any blockchain feature because it solves a problem they have personally experienced and lost money to. Build for the culture first.
2. AI is only as good as its context Ada is valuable because she reads real live data. A Claude integration without real user context produces generic advice that helps nobody. The lesson: connect AI to actual user state before anything else.
3. PayPal bridges old and new financial rails Using PayPal Orders API to fund USDT wallets creates something genuinely powerful — a parent who has never heard of USDT or Tron can send stablecoins to their child in Nigeria in under 2 seconds, using an app they already trust.
4. .maybeSingle() over .single(). Always.
Every Supabase query that might return zero rows
should use .maybeSingle(). We learned this the
hard way across three different features.
5. Ship the culture, not just the code We didn't build what we thought Africa needed. We built what we — as Nigerian students — actually needed. Then discovered two million others needed it too.
🚀 What's Next
| Timeline | Milestone |
|---|---|
| Month 1 | All 170 Nigerian federal universities |
| Month 3 | West Africa — Ghana, Kenya, Senegal |
| Q1 2027 | CBN Direct Debit Mandate license |
| Year 2 | Pan-African — 2M students, 1 platform |
🔗 Links
- Live App: https://cleava-borderless.vercel.app
- GitHub: [your repo URL]
- Demo Video: [your YouTube URL]
Cleva built the rails. We built the city.
— Team Cleva Borderless
Built With
- gemini
- nextjs
- paypal
- supabase
- typescript
- vercel
Log in or sign up for Devpost to join the conversation.