Back to Blog
⭐ Featured · Engineering

Building SAGECO Evergreen: How We Architected a Real Estate Platform for Uganda

SAGECO Evergreen is a real estate platform we built for the Ugandan market. It handles property listings, verified broker dashboards, drone survey verification, programmable escrow payments, fractional land investment, and an AI broker for WhatsApp. This article walks through the actual architecture decisions we made, the trade-offs we accepted, and what we learned deploying it.

The Problem We Were Solving

Land transactions in Uganda are opaque. Buyers can't easily verify property boundaries, brokers operate without standardized tools, and payments happen through informal channels that offer no protection. SAGECO Evergreen was designed to bring transparency, verification, and programmable trust to the entire process.

Technology Stack

Architecture Decision: Next.js + Supabase vs. Traditional Backend

We chose Next.js with Supabase instead of building a traditional Node.js + Express + PostgreSQL backend. The reasoning was practical: Supabase gives us PostgreSQL with auto-generated REST APIs, real-time subscriptions, and authentication out of the box. Next.js gives us server-side rendering for SEO-critical property listing pages and API routes for server-side business logic that shouldn't live in the client bundle.

The trade-off: we gave up some control over the backend infrastructure. The benefit: we shipped in weeks instead of months, and the client could see working features early in the process. For an early-stage platform, that speed-to-market advantage mattered more than infrastructure flexibility.

Programmable Escrow: The Core Feature

The escrow system is what makes SAGECO different from a standard property listing site. When a buyer initiates a transaction, the payment is held in escrow via PesaPal. The funds are only released when both parties confirm — or automatically after a timeout period if no dispute is raised. We implemented this using serverless functions that handle the PesaPal IPN (Instant Payment Notification) callbacks and update transaction status in Supabase.

The key technical challenge was handling IPN callbacks reliably. PesaPal sends payment notifications asynchronously, and our function needs to update the transaction state atomically. We use Supabase's built-in row-level locking to prevent race conditions when multiple IPN notifications arrive for the same transaction.

Drone Survey Verification

Every property on SAGECO can have a drone survey attached. A certified surveyor uploads GPS coordinates and boundary data, which is stored as a JSON document in Supabase. The frontend renders property boundaries on an interactive map. This creates a verifiable, timestamped record of the property's physical boundaries — reducing boundary disputes, which are one of the most common issues in Ugandan land transactions.

AI Broker for WhatsApp

We built a natural-language property search interface that works through WhatsApp. Users describe what they're looking for in plain English ("I need a 3-bedroom house in Kyenjojo under 150 million"), and the AI broker parses intent, queries the Supabase database, and returns matching listings with images and broker contact details. The AI also creates follow-up tasks for human brokers when a lead shows serious intent.

What We Learned

Building for the Ugandan market taught us several things. First, offline resilience matters even for a web platform — brokers frequently work in areas with spotty connectivity, so we implemented optimistic UI updates that don't block on network round-trips. Second, the PesaPal integration was more complex than expected due to the variety of payment methods (MoMo, Airtel Money, cards) each with different callback behaviors. Third, Supabase's Row Level Security is powerful but requires careful planning — we ended up with 15+ RLS policies that needed to be tested as a unit.

Result

SAGECO Evergreen is live and serving real property listings. The platform handles the full transaction lifecycle from discovery to verified purchase. The custom domain (sagecoevergreen.publicvm.com) is deployed, the Android app is in testing, and the AI broker is processing WhatsApp queries from real users.

Need help with your project?

DeryCode builds enterprise software, AI systems, blockchain infrastructure, and digital platforms.

Start a Conversation →

Related reading

← Back to all articles