Back to Portfolio
AQAR CRM: Enterprise Real Estate SaaS, Hybrid VoIP Call Center & AI Intelligence
Real Estate & CRM

AQAR CRM: Enterprise Real Estate SaaS, Hybrid VoIP Call Center & AI Intelligence

Open Source Package / Self-Hosted GitHub Repository
Python 3.12 Django 5.1 (ASGI) Multi-Tenant PostgreSQL 16 Celery & Redis 7 Google Gemini 2.5 Flash Asterisk AMI / VoIP WebRTC SMS Gateways (VictoryLink / SMS Misr / CEQUENS) Meta Lead Ads Webhooks Daphne / WebSockets ReportLab / Cairo Font pytest (385 Tests) Docker & Nginx
Executive Summary

Enterprise multi-tenant SaaS platform for property developers and real estate brokerages, featuring database-per-tenant isolation, integrated VoIP/Asterisk call center, multi-channel SMS gateways, Google Gemini 2.5 Flash Text-to-SQL analytics, and cheque portfolio lifecycle automation.

Meta Lead Ingestion
< 3 sec
Instant webhook capture & round-robin routing from Facebook/Instagram ads
Site-Visit Conversion
+42%
Inbound conversion boosted via integrated VoIP softphone & auto-followups
Active Managed Portfolios
> $20M
Amortized installment tracking & post-dated cheques with Arabic currency tafqeet
Automated Tests Passed (100%)
385/385
Exhaustive pytest suite covering multi-tenant isolation, APIs, and AI flows

The Operational Chaos Costing Real Estate Developers Millions

In high-stakes property development and real estate brokerage, deals are won or lost in the first few minutes after a buyer interacts with a digital campaign. Enterprise brokerages routinely grapple with four paralyzing operational bottlenecks:

1. **Lead Bleed and Fragmentation**: Hundreds of high-intent leads generated daily from Meta Ads (Facebook & Instagram) were historically exported to spreadsheets manually. By the time a sales agent dialed the prospect 4 to 6 hours later, the buyer had already engaged with competitors or forgotten the development name.

2. **Missing Telephony & Call Accountability**: Sales agents dialed high-net-worth buyers from unmonitored personal mobile phones. Management lacked call recording, call duration logging, interaction history, and caller ID reputation protection.

3. **Multi-Million Dollar Cheque Portfolios Managed on Spreadsheets**: Tracking thousands of post-dated bank cheques, amortized installment plans, and manual contract writing was fraught with legal risks and costly calculation errors.

4. **The Launch-Day Double-Booking Nightmare**: During massive project launch events, simultaneous sales agents frequently sold the exact same luxury unit to two different buyers in the same minute due to lack of real-time distributed inventory locking.

To solve these systemic problems at their root, I engineered **AQAR CRM** as a comprehensive enterprise SaaS ecosystem spanning **22 decoupled internal applications**, covering the complete real estate lifecycle from the instant a prospect clicks an ad to the final cheque collection and commission payout.

---

Cloud Architecture: Airtight Database-per-Tenant Isolation

To provide uncompromising data security and privacy for competing real estate enterprises operating on the platform:

---

**Physical Database Isolation (Database-per-Tenant)**: Rather than relying on fragile row-level or schema-level filtering, every subscribing enterprise client is provisioned with a dedicated, encrypted PostgreSQL 16 database (`aqar_<slug>`). Cross-tenant data visibility is physically and architecturally impossible.
**Automated Tenant Provisioning CLI**: Engineered administrative automation scripts (`scripts/provision_tenant.py`) and a SaaS Master Dashboard (`saas_master`) that creates tenant databases, runs database migrations, seeds foundational reference data, provisions the tenant admin account, and configures custom wildcard subdomains in seconds.
**Dual Off-Site Disaster Recovery**: Celery Beat schedules automated daily encrypted database snapshots, dispatched via `rclone` to Cloudflare R2 (benefiting from $0 egress fees) and synchronized to Google Drive.

Integrated VoIP Softphone & Call Center Infrastructure (`apps/voip`)

A crown jewel of the system is its native, multi-protocol telephony and call center engine that eliminates the need for expensive third-party call center platforms:

---

**Hybrid On-Premises & Cloud Telephony Support**:
Direct integration with local PBX systems via **Asterisk AMI** and **FreePBX**.
Hardware integration with **Grandstream GSM Gateways** to route calls through company SIM cards.
Native support for national enterprise **SIP Trunks** (Telecom Egypt / WE and Vodafone Egypt SIP Trunk).
Cloud PBX integration via **Twilio Voice** and **Zadarma Cloud PBX**.
**In-Browser WebRTC Softphone**: Agents execute one-click dialing directly inside the CRM browser window via a secure WebRTC WebSocket (`webrtc_wss_url`), with zero desktop software installation required.
**Intelligent Inbound Call Routing Strategies**:
**Dedicated / Sticky Agent**: Automatically routes incoming calls to the assigned sales agent based on caller ID matching.
**Round-Robin** and **Workload Balancing**: Evenly distributes call queues across available active agents.
**Ring-All**: Broadcasts ring tone across all floor agents for high-priority inbound hotlines.
**Call Recording & Detailed Records (CDR)**: Automatically records voice calls, attaches audio player widgets directly to the lead activity timeline, and logs precise duration and disconnect causes.

Enterprise SMS Gateway & Campaign Automation (`apps/sms`)

Built an enterprise multi-provider SMS messaging engine integrated with major regional and international telecom aggregators:

---

**Certified Carrier Gateways**: Pre-configured connectors for **VictoryLink Egypt**, **SMS Misr**, **Vodafone Egypt Business SMS**, **Orange Egypt Business SMS**, **CEQUENS Egypt**, and **Twilio**.
**Dynamic Contextual Templates**: Automated welcome dispatches upon lead creation, milestone installment payment reminders, and proactive cheque maturity alerts.
**Real-Time Carrier Balance & Broadcast Delivery Telemetry**: Live balance queries in EGP/USD with batch scheduling, failure retries, and detailed delivery status reporting.

AI Executive Analyst: Google Gemini 2.5 Flash Copilot (`apps/ai_assistant`)

Integrated an executive intelligence copilot directly within the CRM chat interface:

---

**Conversational Text-to-SQL Analytics**: Sales directors and CEOs query operational data in natural Arabic or English (e.g., *"List all available 3-bedroom units in New Cairo under 4M EGP with 8-year installments"*); the copilot generates verified SQL queries, executes them securely against the tenant database, and renders interactive Chart.js visualizations.
**Interactive Proposed Actions (Pending Actions)**: The AI copilot suggests and executes workflow actions upon human confirmation (e.g., logging call outcomes, updating buyer pipeline stages, and dispatching unit brochures).
**Executive PDF Reporting with Arabic Cairo Typography**: Dynamically compiles high-resolution executive reports and financial statements formatted in the official Cairo Arabic font via ReportLab.
**Quota Management & BYOK (Bring Your Own Key)**: Enforces monthly token quotas per subscription tier with full support for enterprise clients supplying their own Gemini API keys alongside on-demand Token Booster packs.

Meta Ads Webhooks, Lead Scoring, and Collision-Proof Inventory

---

**Real-Time Meta Lead Ads Webhook Ingestion (`meta_leads`)**: Ingests Facebook and Instagram lead form submissions in under 2 seconds, extracting campaign metadata, preferred project, budget range, and phone numbers.
**Deduplication Engine & Intelligent Scoring (`leads`)**: Automatically validates phone number formats, flags duplicates against existing records, and computes dynamic lead scores based on interaction velocity.
**Stale Lead Supervisor Alerts**: Alerts sales managers automatically if an inbound high-priority lead remains untouched by the assigned agent past the SLA threshold (15 minutes).
**Interactive Unit Matrix & Distributed Locks (`projects`)**: Visual floorplan grid distinguishing developer stock from secondary resale inventory. Incorporates Redis-backed distributed atomic locks that immediately freeze a unit upon reservation drafting, preventing conflicting duplicate sales during launch events.

Legal Contracts with Currency Tafqeet, Cheques & Commission Accrual

---

**Legal Sales Contract Generator with Arabic Tafqeet (`payments`)**: Automates contractual document compilation with flawless Arabic currency number-to-words conversion (*تفقيط المبالغ المالية*), eliminating typographical and legal discrepancies.
**Cheque Portfolio Lifecycle Management (`cheques`)**: Tracks post-dated cheque portfolios from deposit and clearing to settlement or bouncing, with automated proactive WhatsApp and SMS notifications sent days before bank presentation dates.
**Broker & Sales Commission Engine (`commissions`)**: Dynamically computes commission splits and collection milestones for external marketing agencies and internal sales teams based on confirmed receipts.
**Predictive Cash Flow Modeling (`reports`)**: Visualizes expected inflows and developer construction disbursements across multi-year amortization schedules.

Production Engineering, Quality Gate & Docker Stack

**385 Automated Tests (100% Pass Rate)**: The platform is hardened with **385 automated pytest unit and integration tests**, covering tenant isolation, REST APIs, VoIP session states, SMS gateways, and AI action parsing.
**Production-Hardened ASGI Docker Stack**:
Web & ASGI Layer: Gunicorn and Uvicorn workers running Django 5.1 ASGI.
Real-Time WebSockets: Daphne ASGI server powering Django Channels live push notifications.
Database: Multi-tenant PostgreSQL 16 instances.
Caching & Asynchronous Queues: Redis 7 message broker driving Celery Task Workers and Celery Beat scheduler.
Security & Edge: Nginx Reverse Proxy with automated Let's Encrypt SSL certificates and Cloudflare WAF protection.
Progressive Web App (PWA): Enables mobile agents to install AQAR CRM directly on iOS and Android devices with offline caching.
Interactive System Studio & Architecture Screens

Click any screen below to inspect in high-resolution with zoom in, zoom out, pan, and full screen controls.

6 Displays

Interested in a similar project?

We can build a tailored solution customized to your business goals.

Contact Me Now