Audit Phone Calls with Event Sourcing in .NET
Event sourcing has been growing in popularity as a way to build systems that protect against data loss, model complex business scenarios more clearly, and provide flexibility in how they can be extended. The Vonage API makes it super easy to track phone calls, which is used to build an event-sourced system for auditing these conversations. The system stores the entire history of everything that happens in the application as a log of events, called a stream. Events are associated with a primary stream that represents the entity or process they belong to, such as a customer or order. The system uses Marten, a .NET library, to easily use Postgres as a document DB and event store. It also handles updating the read-side view-models whenever any new events are appended to the event streams. The system creates C# objects to represent the domain events in the application, which are then used to create an individual stream per phone conversation. The system uses a command handler to trigger when receiving a message from the Vonage call-tracking API, and displays the current state of the system by "re-playing" and transforming all those events into view-models. The system also includes a UI to display phone conversations, which is used to view the data from the system. Finally, the system configures its Vonage time tracking application using ngrok and Nexmo, allowing it to receive real-time call tracking events from the Vonage API.
Company
Vonage
Date published
Nov. 10, 2020
Author(s)
James Hickey
Word count
1949
Language
English
Hacker News points
None found.