Novent Backend
A robust backend system featuring NestJS microservices with Hexagonal Architecture and CQRS, leveraging Postgres, Redis, Kafka, Debezium, and Meilisearch.

Problem & solution scope
Novent Backend is an enterprise-grade distributed microservices platform engineered for high-concurrency event handling and financial transactions. Utilizing Hexagonal Architecture (Ports and Adapters) with Command Query Responsibility Segregation (CQRS), it decouples domain logic from external transport layers while ensuring sub-millisecond data synchronization via Apache Kafka and Debezium Change Data Capture (CDC).
System architecture
Hexagonal (Ports & Adapters) Microservices with CQRS & Event-Driven CDCComposed of an API Gateway, Core Business Service, and Financial Service communicating via gRPC and Kafka. Database changes to PostgreSQL are streamed in real-time by Debezium into Kafka topics, where search workers ingest them into Meilisearch, maintaining eventual consistency without application-level double writes.
System Components
API Gateway
NestJS / tRPC / ExpressCentral entrypoint managing JWT authentication, permission guards, request routing, rate limiting, and tRPC contracts.
Core Service
NestJS / Hexagonal / CQRSHouses core business domains, command handlers, domain event publishing, and entity state management.
Financial Service
NestJS / gRPC / Double-Entry LedgerManages transactional accounting, wallet balances, and invoice settlement with ACID consistency.
Event Streaming & CDC
Apache Kafka / Debezium / MeilisearchStreams Postgres Write-Ahead Logs (WAL) through Kafka for decoupled cache invalidation and full-text search indexing.
Data & Execution Flow
Request Ingress & Auth
Client requests hit Gateway via tRPC or REST; validated by central PermissionsModule.
CQRS Command Dispatch
Commands route to Core Service via gRPC; domain aggregate executes invariants and persists to PostgreSQL.
Change Data Capture (CDC)
Debezium detects PostgreSQL WAL updates and streams structured change events onto Kafka topics.
Asynchronous Search Indexing
Search consumers read Kafka events and update Meilisearch indexes, ensuring zero lag on query workloads.
Engineered capabilities
Strict Hexagonal Architecture: Complete decoupling of Domain, Application, Infrastructure, and Presentation layers.
CQRS Command/Query Separation: Separates read-heavy query pipelines from write-heavy command handlers.
Change Data Capture (CDC): Debezium connector monitoring Postgres WAL for reliable, atomic event propagation without dual-write bugs.
High-Speed Inter-Service RPC: Microservices communicate internally over binary gRPC protocols.
Distributed Caching & Search: Redis for session and hot-key cache; Meilisearch for typo-tolerant full-text search.
Engineering trade-offs
Debezium CDC over Manual Event Publishing
Extracting domain events directly from Postgres WAL guarantees that every committed transaction produces a message, eliminating dual-write failure vulnerabilities.
Monorepo Package Modularization
Shared DTOs, gRPC clients, logger, and permission guards live in isolated packages (@packages/*), ensuring consistency across all microservices.
