🏗️ Ulmexa SaaS Architecture
Ulmexa is designed as a 3-tier SaaS platform that integrates Digital Marketing Services (Email, SMS, Hosting) with a scalable cloud backend.
This architecture ensures security, scalability, and maintainability while supporting future growth.
🔹 Overview
Ulmexa follows the classic 3-tier architecture:
- Presentation Layer (Frontend) – user-facing interface (web app & dashboard).
- Application Layer (Backend/API) – business logic, campaign engine, queue workers.
- Infrastructure Layer (Data & Services) – databases, message queues, external providers (Mail, SMS, OpenStack).
🖥️ 1. Presentation Layer (Frontend)
- Framework: Angular + Docusaurus (for docs site).
- Purpose:
- Provides the user dashboard for managing campaigns, domains, VPS instances, and subscriptions.
- Handles authentication (via Keycloak).
- Connects to the backend via REST APIs.
✅ Key Components
- Campaign creation & scheduling UI
- Project & client management
- VPS management interface
- Subscription & billing UI
- Documentation portal (Docusaurus)
⚙️ 2. Application Layer (Backend/API)
- Framework: Spring Boot (Java).
- Pattern: Modular microservice-like structure within a monolithic backend.
- Responsibilities:
- Expose REST APIs for frontend
- Implement business logic (campaign scheduling, billing, subscription management)
- Manage integrations with providers (Mailcow, OpenStack, SMS gateways)
- Handle queue-based email sending with retries
✅ Key Services
-
Campaign Service
- Queues emails via RabbitMQ
- Injects tracking pixels
- Handles retries & DLQs
-
Mail Provider Service
- Integrates with Mailcow API for domain/mailbox management
- Stores SMTP credentials per user
-
VPS/Hosting Service
- Uses OpenStack4j to manage instances, floating IPs, volumes, images
- Maps subscription to allocated resources
-
Subscription & Billing Service
- Validates active plans
- Suspends overdue VPSs after grace period
- Issues invoices
-
Authentication & Authorization
- Delegated to Keycloak IAM
- Supports per-user projects and team members
🗄️ 3. Infrastructure Layer (Data & Services)
This tier provides persistence, message queues, and external services.
✅ Components
-
Database: PostgreSQL
- Stores users, projects, campaigns, subscriptions, VPS metadata
-
Message Broker: RabbitMQ
- Queues email send jobs
- Implements retry + dead-letter queues
- Supports scheduled sends with TTL
-
Mail Server: Mailcow
- Provides domain & mailbox management
- Sends campaigns via per-mailbox SMTP
-
Cloud Infrastructure: OpenStack
- Manages VPS lifecycle (create, suspend, resume, delete)
- Isolates resources per customer project
- Integrated with Keycloak for identity mapping
-
Authentication: Keycloak
- Central IAM for users and admins
- Maps OpenStack projects to SaaS users
-
Storage: Object storage (OpenStack Swift / S3-compatible)
- Stores campaign assets, images, attachments
🔄 Data Flow Example
- A user logs in via Keycloak.
- User creates a campaign → backend validates subscription.
- Backend pushes emails into RabbitMQ queues.
- Workers consume queue messages → send via Mailcow SMTP.
- Tracking pixel logs events back to backend.
- If emails fail → retries via RabbitMQ DLQ.
- Reports/analytics are stored in PostgreSQL.
📐 Architecture Diagram
