DEV Community

dhmi88
dhmi88

Posted on

How We Built an Arabic-First SaaS for Saudi Real Estate

Building SaaS for the Middle East is different from building for the West. When we started building Amlaki, we quickly realized that simply translating an English app to Arabic was not going to cut it.

Here's what we learned:

1. RTL is Not Just Flipping the UI

Arabic text flows right-to-left, but numbers, English words, and dates flow left-to-right within the same line. This bidirectional text (BiDi) requirement affects every component: tables, charts, PDFs, and even WhatsApp message formatting.

We use Next.js with Tailwind CSS, which has excellent RTL support. But the real challenge was in PDF generation — libraries like PDFKit completely break with Arabic text. We ended up using Puppeteer to render HTML templates into PDFs, loading Noto Sans Arabic via Google Fonts.

2. The Hijri Calendar is Not Optional

In Saudi Arabia, many official documents and rental contracts use the Hijri (Islamic) calendar. We built dual-date support showing both Hijri and Gregorian dates side by side.

// Using Intl API for Hijri dates
const hijriDate = new Intl.DateTimeFormat('ar-SA-u-ca-islamic-umalqura', {
  year: 'numeric',
  month: 'long', 
  day: 'numeric'
}).format(date);
Enter fullscreen mode Exit fullscreen mode

This turned out to be one of our users' favorite features — something no Western property management tool offers.

3. Government Integration is a Competitive Moat

Saudi Arabia requires electronic lease documentation through the Ejar platform. Building direct integration with Ejar was complex but gives us a significant advantage over generic property management tools.

When a property owner creates a contract in Amlaki, they can submit it to Ejar with one click — no need to re-enter data on the government portal.

4. FIFO is a Legal Requirement, Not a Feature

In Saudi real estate, payments must be allocated to the oldest unpaid invoice first (First-In, First-Out). We built this into the core of our payment system:

// Simplified FIFO allocation
async allocatePayment(contractId: string, amount: number) {
  const schedules = await this.getUnpaidSchedules(contractId);
  // Sort by due date (oldest first)
  schedules.sort((a, b) => a.dueDate - b.dueDate);

  let remaining = amount;
  for (const schedule of schedules) {
    if (remaining <= 0) break;
    const due = schedule.amount - schedule.paidAmount;
    const allocated = Math.min(remaining, due);
    await this.updateSchedule(schedule.id, allocated);
    remaining -= allocated;
  }
  // Handle overpayment as credit
  if (remaining > 0) await this.createCredit(remaining);
}
Enter fullscreen mode Exit fullscreen mode

5. WhatsApp > Email in the Gulf

In Saudi Arabia, WhatsApp is the primary communication channel — not email. We integrated Twilio's WhatsApp API for:

  • Payment reminders (7, 3, 1 day before due)
  • Overdue alerts (1, 7, 14 days after due)
  • Contract expiry notifications

Open rates went from ~15% (email) to ~85% (WhatsApp).

Our Tech Stack

Layer Technology
Backend NestJS + TypeScript
Frontend Next.js + Tailwind CSS
Mobile React Native + Expo
Database PostgreSQL + Prisma ORM
Cache Redis
Storage MinIO (S3-compatible)
Hosting Docker on Hetzner Cloud
CDN Cloudflare

We chose TypeScript across all platforms for consistency. One language, three platforms (web, API, mobile).

Results

Amlaki now serves real estate agencies and property owners across Saudi Arabia with:

  • 3 languages: Arabic (RTL), English, Turkish
  • 6 subscription tiers: From free to enterprise
  • Full mobile apps: iOS and Android with offline support
  • Automated everything: Payment allocation, overdue detection, notifications

Try It

We offer a free plan for property owners with up to 5 units. No credit card required.

👉 https://amlakire.com

Top comments (0)