system-prompts-and-models-o.../salesflow-saas/memory/architecture/system-overview.md
Claude a329957a3b
feat: Add AI engine, PDPL compliance, sequences, CPQ, and governance layers
Phase 1-6 implementation for Dealix AI Revenue OS:

- AI Arabic Engine: NLP (arabic_nlp.py), lead scoring (lead_scoring.py)
- PDPL Compliance: consent manager, data rights handler, consent model
- Sequence Engine: multi-channel sequences with WhatsApp/Email/SMS
- CPQ System: quote engine, AI proposal generator
- Security Gate: pre-release checks, PDPL message validation
- Tool Verification: agent action audit trail
- Project Operating Files: AGENTS.md, CLAUDE.md
- Project Memory: architecture, ADRs, provider routing, PDPL checklist
- Design System: IBM Plex Sans Arabic tokens, RTL-safe components
- Sequence/Consent models for database

https://claude.ai/code/session_01LsnvBa7HwF5hs99VZbgLGj
2026-04-11 07:40:39 +00:00

53 lines
3.4 KiB
Markdown

# Dealix System Architecture Overview
**Type**: architecture
**Date**: 2026-04-11
**Status**: active
**Confidence**: high
## Summary
Dealix is a multi-tenant AI-powered CRM SaaS targeting Saudi SMBs. Architecture follows a microservices-ready monolith pattern.
## Components
```
┌─────────────────────────────────────────────────────────┐
│ Nginx (Reverse Proxy) │
├──────────────────────┬──────────────────────────────────┤
│ Next.js Frontend │ FastAPI Backend │
│ (Port 3000) │ (Port 8000) │
│ - Dashboard │ ┌─────────────────────────┐ │
│ - Landing │ │ API Layer (v1) │ │
│ - Auth │ │ - Auth, Leads, Deals │ │
│ - Pipeline │ │ - Inbox, Sequences │ │
│ │ │ - Compliance, Proposals │ │
│ │ ├─────────────────────────┤ │
│ │ │ Services Layer │ │
│ │ │ - AI Engine (Arabic) │ │
│ │ │ - PDPL Compliance │ │
│ │ │ - Sequence Engine │ │
│ │ │ - CPQ System │ │
│ │ │ - Agent Orchestrator │ │
│ │ ├─────────────────────────┤ │
│ │ │ Integration Layer │ │
│ │ │ - WhatsApp, Email, SMS │ │
│ │ │ - Stripe, ZATCA │ │
├──────────────────────┴───┴─────────────────────────┤ │
│ Celery Workers (4) │ Celery Beat │ │
├──────────────────────────────┴──────────────────────┤ │
│ PostgreSQL 16 │ Redis 7 │ │
└─────────────────────┴───────────────────────────────┘
```
## Key Design Decisions
- **Multi-tenant isolation**: tenant_id on every table, enforced at query level
- **Arabic-first**: RTL layout, Arabic NLP, Saudi dialect support
- **WhatsApp-first**: Primary communication channel (85% Saudi penetration)
- **PDPL-native**: Consent checked before every outbound message
- **LLM fallback chain**: Groq → OpenAI for cost optimization
- **Async everything**: asyncpg, async SQLAlchemy, async HTTP clients
## Related Topics
- [ADR-001: Multi-tenant architecture](../adr/001-multi-tenant.md)
- [ADR-002: WhatsApp as primary channel](../adr/002-whatsapp-first.md)
- [Provider routing strategy](../providers/routing-strategy.md)