1.7 KiB
1.7 KiB
High-Level Architecture Design (HLD) — Universal Enterprise Platform
| Field | Value |
|---|---|
| Document | hld.md |
| System | Universal Enterprise Platform (UEP) |
| Pattern | Modular Monolith with Multi-Tenant Row-Level Security |
| Version | 1.0.0 |
| Status | Baselined (Elaboration Phase) |
1. System Architecture Topology
graph TD
ClientWeb["Web Portals (React + Vite + Tailwind)"] --> NGINX["API Gateway / Reverse Proxy (NGINX)"]
ClientMobile["Mobile Apps / External Consumers"] --> NGINX
NGINX --> AuthFilter["Auth & Tenant Context Middleware"]
AuthFilter --> Keycloak["Identity Provider (Keycloak OIDC)"]
subgraph Modular Monolith Core
AuthFilter --> ModAuth["IAM / Auth Module (LLD-001)"]
AuthFilter --> ModDomain["Core Business Modules"]
AuthFilter --> ModIntegration["Integration & Sandboxes"]
end
ModAuth --> PG[("PostgreSQL DB (with RLS)")]
ModDomain --> PG
ModAuth --> Valkey[("Valkey / Redis (Token Blacklist & Cache)")]
2. Core Architectural Pillars
- Multi-Tenancy via Row-Level Security: Every domain table carries a
tenant_idUUID column. When requests arrive, the Auth Middleware extractstenant_idfrom the verified JWT and setsSET LOCAL app.current_tenant = '<tenant_id>'on the database session connection pool. - Deterministic Wave 0 Sandboxing: All external third-party integrations (payment gateways, identity verification, SMS/email) implement an abstract adapter with a local deterministic mock under
app/integrations/sandbox/. - Pluggable Event Stream: Inter-module communication executes via in-process domain event dispatchers that can scale out to message queues (RabbitMQ / Kafka) as needed.