Kadviro — UAE Real Estate SaaS
Multi-tenant SaaS CRM for UAE agencies: portal sync, lead pipeline, and compliance documents.
Overview
Full-stack production SaaS for UAE real estate agencies. Async portal publishing to Property Finder, Bayut, and Dubizzle via a Postgres-native job queue. IMAP IDLE email with web-push notifications. Kanban lead pipeline with webhook ingestion. Bilingual DLD/Trakheesi compliance document generator.
Role
Founder · Lead Engineer
Period
Nov 2024 – Present
Category
SaaS Product
Status
Own Product
The Problem
UAE real estate agencies manage listings across Property Finder, Bayut, and Dubizzle — each with different formats, APIs, and submission flows — while generating DLD/Trakheesi compliance documents and handling client email. No single tool covers this stack, so agencies juggle manual portal re-entry, separate email clients, and ad-hoc document workflows.
Approach
Built a multi-tenant SaaS monorepo (Next.js 14 frontend + Node.js/Express backend sharing Prisma types). Portal publishing uses a Postgres-native job queue so there is no Redis dependency. Email runs per-user IMAP IDLE connections for near-instant delivery with VAPID service worker push when the browser is closed.
Architecture
Monorepo: Next.js + Express
Frontend (Next.js 14 App Router) and backend (Node.js/Express) share Prisma-generated types. Company-scoped multi-tenancy with role-based access: ADMIN / MANAGER / AGENT. AES-256-GCM credential encryption for stored IMAP/SMTP passwords.
Postgres-native Job Queue
PortalPublishJob table with FOR UPDATE SKIP LOCKED — no Redis. Workers poll every 5s, claim jobs, run idempotent reconcile (create draft → update → publish) with exponential backoff up to 5 retries. 4-second frontend poll shows per-portal status in real time.
IMAP IDLE Email Module
Per-user persistent IMAP connection via imapflow for ~15s delivery latency. Credentials AES-256-GCM encrypted; never returned to the client. Mail synced into Postgres (envelope + body only, not full source). Multiple mailboxes per user with tabbed UI.
Document Generation
pdf-lib for EJARI Unified Tenancy Contract pixel-accurate overlay on official DLD PDFs, with a visual calibration panel. Puppeteer HTML→PNG renderer for bilingual DLD/Trakheesi advertisements — chosen over SVG because librsvg mangles Arabic RTL text.
Key Features
Portal Publishing
Full two-way sync with Property Finder and Bayut (create, update, publish, unpublish, delete). Multi-account PF support with branch-aware profile resolver. Field-sensitivity gate: price/area changes require admin approval before portal push.
Kanban Lead Pipeline
Native HTML5 drag-and-drop Kanban board + list view. Configurable pipeline stages per company (isDefault / isWon / isLost). Idempotent portal webhook ingestion — never duplicates. Source tracking: PF / Bayut / Dubizzle / Manual / Website.
Email with Web Push
VAPID service worker fires push when the browser is closed; in-app toast + chime when open. Dedup prevents double-firing. Selectable notification sounds. 50-message paged list, folder counts, unread badge in sidebar.
Compliance Documents
Bilingual EN/AR Trakheesi advertisement generator and EJARI Unified Tenancy Contract overlay. Generic document builder: upload any PDF, drop labelled input boxes, collect signatures in-app, export filled PDF.
9-Step Listing Form
Basic Info → Property Details → Location → Pricing → Description → Amenities → Media → Portal Settings → Review. Watermark applied per-image at upload. Field-sensitivity gate: price/area changes require admin approval before portal push.
Technology Stack
Engineering Challenges
Portal API Breaking Changes
Portal submission interfaces change without notice. Built a layer of element selectors with fallback strategies and error reporting to detect and flag breaking changes before they silently fail live listings.
IMAP IDLE at Scale
Persistent IMAP connections per user must survive server restarts and network interruptions. Email worker restarts per-account on credential save. Large mailboxes handled by syncing envelope + body only to avoid unbounded memory growth.
Outcome
Live at kadviro.com. Agencies on the platform manage portal publishing, lead intake, email, and compliance documents from a single workspace — replacing manual re-entry across portals and document tools.