THE CHALLENGE
What had to remain reliable.
Live calls, contact state, billing, AI jobs, and a real-time interface can all complete at different times. Duplicate terminal events, repeated payment webhooks, delayed recordings, and unavailable integrations must not corrupt a tenant's data or financial state.
THE SOLUTION
How the system was designed.
The system uses account-scoped RBAC, idempotent call finalization and payment webhooks, a ledger-backed billing domain, queued AI processing with locks and retries, and explicit recording retention. Telephony is connected to the contact timeline instead of living as a disconnected tool.
ARCHITECTURE
The main system boundaries and data flow.
[ Vue 3 CRM / Admin / Onboarding ]
| REST + live events
v
[ NestJS API ]
+---------+---------+--------------+
v v v v
[ CRM domain ] [ Billing ] [ Integrations ] [ AI jobs ]
| | | |
+---------+---------+--------------+
v
[ PostgreSQL ]
[ Browser WebRTC ] <-> [ Asterisk 20 / SIP ]
| | AMI / recordings
+----------+---------+
v
[ call record + contact timeline ]
v
[ STT -> transcript -> RAG context -> AI insight ]
OUTCOMES
What the architecture enables.
01One working context for sales and calls
02Failure-safe call and billing lifecycle
03AI insight connected to source recordings and company knowledge
04Operational controls for both companies and platform administrators
STACKNestJSTypeScriptVue 3PostgreSQLAsterisk 20SIPWebRTCRAGDocker