Skip to content
Mobile view of the Dhura executive overview with demo data
All work

Case study · Multi-tenant real-estate SaaS

ذُرىDhura

Engineering project

An Arabic-first real-estate platform where every module is scoped by tenant, and AI can recommend anything but changes nothing without a person.

Role
Sole author: architecture, backend and frontend
Domain
Real-estate CRM, sales, finance and customer portal
Shape
Around thirty FastAPI modules, one PostgreSQL schema
Status
V1 release candidate, not deployed

The business journey

The modules follow one customer from first contact to paid installments.

  1. Step 01

    Lead

    Captured and assigned in the CRM.

  2. Step 02

    Unit

    Matched against live inventory.

  3. Step 03

    Reservation

    Held while the deal is agreed.

  4. Step 04

    Contract

    Terms, parties and schedule.

  5. Step 05

    Payments

    Installments posted to finance.

  6. Step 06

    Portal

    The customer follows it all.

How the AI layer is held back

  1. 01

    Deterministic agents

    Agents follow fixed logic. They are not autonomous loops, and the page does not call them that.

  2. 02

    Read-only, allowlisted tools

    Each agent may call only the tools on its allowlist, scoped to the tenant, and none of them write.

  3. 03

    Approval, then a use case

    An agent emits an action. A person approves it, and apply_action runs it through the same domain use case the UI calls.

Engineering decisions

  1. 01

    Tenant scoping everywhere

    tenant_id is carried through models, repositories and queries across the codebase, not added in one middleware.

    tenant_id

  2. 02

    A provider-neutral AI gateway

    Model calls go through one gateway, and output is validated against a schema before anything reads it.

  3. 03

    Migrations as history

    Schema changes live in Alembic revisions, so the database can be rebuilt from scratch.

    alembic upgrade head

  4. 04

    Domain modules, not layers

    Each business area owns its domain, application and infrastructure code.

Real screens

Captured from a project of the V1 release candidate on demo data. Dhura is not deployed to production.

Dhura sign-in screen, Arabic, right-to-left
Sign-in screen
Dhura workspace creation form
Workspace creation

Inside the product

Logged-in screens from a project running on the project's own demo seed. The names, units and amounts are fictional test data, not production figures.

Executive overview
Executive overview
Unit inventory
Unit inventory
CRM lead workspace
CRM lead workspace
Finance reports
Finance reports
AI control room with human approval
AI control room with human approval
Customer portal
Customer portal

What was verified

  • Around thirty backend modules, from tenants and CRM to finance, accounting, portal and AI.
  • tenant_id referenced across hundreds of backend files.
  • Agent tools restricted to a read-only, tenant-scoped allowlist; actions applied only after approval.
  • A provider-neutral AI gateway with schema-validated output.
  • Alembic migration history and a Playwright end-to-end suite in the repository.

Executed on 18 Oct 2026 with SQLite and model keys blanked: 644 backend tests passed, none failed. One module (background jobs) could not be collected because the local environment lacks the Redis Python package. The Playwright suite was not rerun.

What I do not claim

  • It is not live: it is a V1 release candidate.
  • The agents are deterministic, not autonomous.
  • No customers, users or business results.
  • The README’s test totals are older than the current code and are not repeated here.

Architecture

FastAPI with Pydantic v2, SQLAlchemy 2 and Alembic on PostgreSQL, with Redis for background jobs. A React and TypeScript frontend, Arabic-first and right-to-left, with Playwright end-to-end tests.

Stack

FastAPI · Pydantic v2 · SQLAlchemy 2 · Alembic · PostgreSQL · Redis · React · TypeScript · Playwright

Source

Private repository