Skip to content
CAI
Software that uses CAICheck a score

NickTsitlakidis/event-nest

64.2

Adequate · 21 September 2026

5.8k

lines of production code

TypeScript

primary language

4

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

This system is an event-sourcing framework for NestJS that manages aggregate roots through domain events and optional snapshots. It provides a core library for implementing CQRS patterns, including configurable event subscription concurrency and flexible snapshot strategies to optimize performance. The framework supports persistence via MongoDB, PostgreSQL, and Microsoft SQL Server, offering robust storage implementations for both events and snapshots.

How it got here

2022–2023 — Monorepo migration and snapshot support

14 changes.

The project migrated to an Nx monorepo with pnpm workspaces, upgrading to Node 22 and NestJS 11 while restructuring the codebase. Core event sourcing capabilities were significantly enhanced with the introduction of snapshot strategies, aggregate repositories, and configurable concurrent event subscriptions. The MongoDB storage module was updated to support these new features, including async configuration and concurrency safety, alongside comprehensive exception handling and API reorganization.

2024–2026 — Event sourcing storage and snapshotting

7 changes.

This period focused on implementing the core event sourcing infrastructure, introducing snapshot storage interfaces and strategies alongside initial PostgreSQL and Microsoft SQL Server backend implementations. The work expanded the library's capabilities by exposing core modules, adding configurable connection pooling, and enabling automatic table initialization for supported databases.

Features

Add Microsoft SQL Server support for event and snapshot storage

The \libs/mssql\ library now provides a new \EventNestMSSQLModule\ that enables Microsoft SQL Server as a backend for the Event Nest framework. This module exposes \MSSQLEventStore\ and \MSSQLSnapshotStore\ implementations, allowing users to configure connection details, table names, and schema settings via \forRoot\ or \forRootAsync\. It integrates with the Knex query builder to manage aggregate roots, event streams, and optional snapshots, including automatic table initialization and lifecycle management within the NestJS application context.

libs/mssql · high confidence

Add example application demonstrating Event-Nest CQRS patterns

The example application now includes a complete demonstration of the Event-Nest library, featuring User and Order aggregates with event sourcing, snapshot strategies (AnyOf, AllOf, ForAggregateRoots, ForEvents, ForCount), and MongoDB integration. It showcases domain event subscriptions, aggregate reconstitution with snapshots, and REST API endpoints for creating and updating users and orders.

apps/example/src · high confidence

Core snapshot storage infrastructure and no-op implementation

The core library now includes the foundational infrastructure for aggregate snapshots, introducing the \SnapshotStore\ interface and an \AbstractSnapshotStore\ base class that handles snapshot creation, revision management, and strategy evaluation. A \StoredSnapshot\ model is added to represent aggregate state, and a \NoOpSnapshotStore\ is provided to disable snapshot functionality by default. This change establishes the storage contract for snapshotting but does not yet include backend-specific implementations or the event-store wiring to automatically trigger snapshot creation.

libs/core/src/lib/storage/snapshot · high confidence

Initial example application scaffolding

Adds a new Node.js example application to the monorepo, providing a reference implementation for building with the framework. The entry includes the necessary Nx project configuration (project.json), TypeScript build and test configs, a Jest setup for coverage, and a custom Webpack configuration that resolves local workspace packages from source and externalizes standard Node modules.

apps/example · high confidence

MongoDB module now supports async configuration and client options

The MongoDB library now allows asynchronous module registration via \forRootAsync\ and \registerAsync\, enabling dynamic configuration of the event store and snapshot store. It also introduces a \mongoClientConfiguration\ option, allowing users to pass specific MongoDB driver settings (such as pool size or replica set) directly to the \MongoClient\. Additionally, the module now supports a \concurrentSubscriptions\ flag to control whether domain event subscriptions are processed concurrently or sequentially.

libs/mongodb/src/lib · high confidence

New composite and conditional snapshot strategies

The core library now includes a suite of new snapshot strategies to give you finer control over when snapshots are created. You can combine conditions using \AllOfSnapshotStrategy\ (AND logic) and \AnyOfSnapshotStrategy\ (OR logic), or target specific criteria with \ForCountSnapshotStrategy\ (event count), \ForEventsSnapshotStrategy\ (specific event types), and \ForAggregateRootsStrategy\ (specific aggregate types). The \NoSnapshotStrategy\ remains the default. These strategies support both synchronous and asynchronous evaluation, ensuring that async conditions are properly awaited before deciding to create a snapshot.

libs/core/src/lib/snapshot-strategy · high confidence

New domain event and snapshot exception types

The core library now includes a comprehensive set of specific error classes to provide clearer diagnostics during development and runtime. These new exceptions cover snapshot lifecycle issues (AggregateClassNotSnapshotAwareException, AggregateInstanceNotSnapshotAwareException, SnapshotRevisionMismatchException), event registration and processing errors (UnknownEventException, UnregisteredEventException, EventNameConflictException, MissingEventClassException, MissingAggregateRootNameException), and persistence or subscription failures (EventConcurrencyException, IdGenerationException, SubscriptionException, UnknownEventVersionException).

libs/core/src/lib/exceptions · high confidence

New storage layer with snapshot support and aggregate repository

The core storage module now includes an abstract event store implementation that supports snapshotting for aggregate roots, allowing efficient loading by combining a stored snapshot with subsequent events. A new AggregateRepository helper simplifies the common load-mutate-commit workflow by handling reconstitution, snapshot resolution, and automatic fallback to full event replay when snapshot revisions mismatch. The event store interface has been expanded to include methods for finding aggregates by multiple IDs and purging aggregates, while the stored event model now includes version information to ensure consistency during reconstitution.

libs/core/src/lib/storage · high confidence

PostgreSQL event and snapshot storage implementation

This change introduces the initial PostgreSQL storage layer for the event-sourcing framework, adding the \PostgreSQLEventStore\ and \PostgreSQLSnapshotStore\ implementations. Users can now persist domain events and aggregate snapshots to a PostgreSQL database using Knex, with support for features such as retrieving events by multiple aggregate IDs, purging aggregates, and consistent versioning. The implementation includes the necessary database row interfaces (\AggregateRootRow\, \EventRow\, \SnapshotRow\) and comprehensive test coverage using testcontainers to validate the storage behavior.

libs/postgresql/src/lib/storage · high confidence

PostgreSQL library exports core modules and configuration

The PostgreSQL library now exposes its core components through the main entry point, allowing consumers to import the NestJS module, module options, schema configuration, and the event store implementation directly from the library root.

libs/postgresql/src · high confidence

PostgreSQL module adds configurable table initialization and connection pool options

The PostgreSQL event store library now supports automatic table creation on application bootstrap via a new \ensureTablesExist\ configuration flag, allowing users to skip manual schema setup. Additionally, the module exposes Knex.js connection pool configuration options (such as \max\, \min\, and timeout settings) through the \connectionPool\ property, giving users finer control over database connection management.

libs/postgresql/src/lib · high confidence

Architecture

Repository restructured into an Nx monorepo with pnpm workspaces

The project has migrated from a flat structure to an Nx monorepo managed by pnpm workspaces. This introduces a new workspace configuration (nx.json, pnpm-workspace.yaml) and standardizes the development environment, requiring Node.js 22+ and pnpm for installation and execution. The legacy ESLint configuration has been replaced with a modern flat config (eslint.config.js), and the TypeScript configuration has been updated to support the new module resolution and workspace exports. Additionally, the repository now includes an AGENTS.md file to guide AI coding agents on the new architecture, testing expectations, and workflow.

(repo-wide) · high confidence

Behavioural changes

Configurable concurrent domain event subscriptions and event renaming via aliases

The core library now allows users to configure whether domain event subscriptions are processed sequentially or concurrently via the new \concurrentSubscriptions\ option in \CoreModuleOptions\; when enabled, event handlers run in parallel for faster processing, while the default sequential mode ensures ordered execution. Additionally, the \DomainEvent\ decorator now supports an \aliases\ option, enabling event classes to be renamed without breaking existing stored events by mapping legacy names to the new canonical name.

libs/core/src/lib · high confidence

Core library public API reorganization and snapshot support introduction

The core library's public API has been restructured to expose a consolidated set of modules, including new snapshot strategy implementations (such as AllOf, AnyOf, ForAggregateRoots, ForCount, ForEvents, and NoOp strategies) and a dedicated snapshot store interface. This change introduces snapshot-awareness capabilities for aggregates, allowing users to configure how and when snapshots are taken to optimize performance. Additionally, the export structure now clearly separates aggregate root configurations, domain event subscriptions, and storage abstractions, providing a cleaner entry point for integrating event sourcing features into applications.

libs/core/src · high confidence

Lint checks now run on push instead of commit

The pre-commit hook has been replaced with a pre-push hook that runs lint checks using \pnpm nx affected -t lint\. This means linting is no longer performed on every commit, but rather when code is pushed to the remote repository, potentially reducing local latency during development while ensuring lint compliance before integration.

.husky · high confidence

MongoDB event store module exports restructured

The MongoDB library now explicitly exports the core event store components, including the NestJS module, configuration options, and the MongoEventStore implementation, via a centralized index file. This change ensures that consumers can import these specific parts directly from the library's main entry point without needing to know internal file paths.

libs/mongodb/src · high confidence

MongoDB event store now supports snapshots and concurrent save safety

The MongoDB storage layer now includes snapshot support via a new MongoSnapshotStore and updated MongoEventStore, allowing aggregates to be restored from snapshots to reduce event replay overhead. The MongoEventStore also resolves version conflicts during concurrent aggregate saves by throwing an EventConcurrencyException instead of silently overwriting data, and ensures snapshots are correctly awaited before creation decisions.

libs/mongodb/src/lib/storage · high confidence

Removed legacy barrel export file

The src/index.ts file, which previously re-exported public APIs from the dist directory, has been removed. This change eliminates the legacy barrel export mechanism, likely as part of a migration to a new monorepo structure where entry points are managed differently.

src · high confidence

Snapshot support and event renaming for aggregate roots

Aggregate roots now support snapshots to optimize reconstitution performance, introduced via the new \AggregateRootConfig\ decorator (which replaces the deprecated \AggregateRootName\) and the \SnapshotAware\ interface requiring \applySnapshot\ and \toSnapshot\ methods. Additionally, domain events can now be renamed using aliases, allowing legacy event names to be mapped to new event classes during replay. The \ApplyEvent\ decorator has also been renamed from \EventProcessor\ to \ApplyEvent\.

libs/core/src/lib/aggregate-root · high confidence

Dependencies

Migrate to pnpm workspaces and upgrade to Node 22 and NestJS 11

The project has migrated from npm to pnpm (v11.10.0) using pnpm workspaces with a centralized catalog for dependency management, replacing the previous npm lockfile. This update raises the minimum Node.js requirement to 22.13 and upgrades the NestJS peer dependencies to support versions 10.0.0 and 11.0.0. Additionally, the core library now depends on es-toolkit instead of radash, and the MongoDB storage module now requires MongoDB driver version 7.0.0 or higher.

(dependencies) · high confidence

Housekeeping

Initial project scaffolding for @event-nest/core

The libs/core package has been initialized with the foundational configuration files required for development and testing. This includes a README documenting the library's features (aggregate roots, event persistence, snapshots) and installation steps, a Jest configuration enabling code coverage collection, and TypeScript configuration files (tsconfig.json, tsconfig.lib.json, tsconfig.spec.json) to separate library and test compilation targets. A project.json file defines the build target using the NX workspace executor, and a setup-tests.ts file ensures reflect-metadata is loaded for NestJS decorators.

libs/core · high confidence

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

This is the PUBLIC form of this artifact. Findings are listed in full, but the details of SECURITY findings — which rule fired, in which file, on which line, and how to fix it — are deliberately withheld, and any secret-scanner results are excluded entirely. Where detail is absent here it was REMOVED FOR PUBLICATION; it is not missing from the analysis. The complete artifact is available from the repository owner.

Score

  • CAI 64 → 64 (-0.1)
  • Rubric changed (rubric-2026.08.18 → rubric-2026.09.15) — scores are not directly comparable.

Lenses

  • Code Health 97 → 87 (-10.2)
  • Architecture 89 → 90 (+1.0)
  • Maturity 65 → 69 (+3.5)
  • Readiness 50 → 58 (+8.5)
  • Security 81 → 73 (-8.1)
  • Accessibility 64 (new)

Resolved (14)

  • Coverage not included — suite not readable by the collector
  • Dependency hygiene not measured — dependency manifest found but not parsed for hygiene
  • Further sole-owners (lower concentration)
  • High CVE: [GHSA redacted] (pnpm-lock.yaml)
  • High CVE: [GHSA redacted] (pnpm-lock.yaml)
  • High vulnerability: [GHSA redacted] (pnpm-lock.yaml)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • No exposed public API
  • Off-boarding risk: anonymized user #1
  • Test reliability not included

New (33)

  • AggregateRoot.reconstitute (cognitive 17) (libs/core/src/lib/aggregate-root/aggregate-root.ts)
  • Coverage not measured — JavaScript/TypeScript suite
  • Documentation: no architecture or design documentation (apps/docs/README.md)
  • Documentation: no installation or build instructions (apps/docs/README.md)
  • Documentation: written for insiders
  • High CVE: [GHSA redacted] (pnpm-lock.yaml)
  • High CVE: [GHSA redacted] (pnpm-lock.yaml)
  • High vulnerability: [GHSA redacted] (pnpm-lock.yaml)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • Low CVE: [GHSA redacted] (pnpm-lock.yaml)
  • …and 13 more

Changes since last survey

  • 22 commits — 20 feature/other, 2 fixes

By area

  • (root) — 10 commits
  • libs/core — 5 commits
  • apps/docs — 3 commits
  • (repo) — 1 commit
  • .github/workflows — 1 commit
  • libs/mongodb — 1 commit
  • libs/mssql — 1 commit

Notable commits

  • fix: fix(core): Asynchronous snapshot strategies are now awaited before deciding to create a snapshot. (#65)
  • fix: fix(core): Model version is now resolved correctly before a snapshot is created. (#64)
  • change: Merge pull request #62 from NickTsitlakidis/nx-improvements
  • change: chore(deps): Bump Nx packages
  • change: chore(deps): Bump dependencies
  • change: chore(deps): Bump dependencies
  • change: chore(deps): Bump eslint dependencies
  • change: chore(deps): Update dependencies to latest versions
  • change: chore(release): publish 6.1.0
  • change: chore: refactor monorepo to be based on pnpm workspaces (#63)
  • change: chore: remove custom publish commands and add standardized release target with dependencies
  • change: chore: streamline Jest configs, enable coverage collection, and remove redundant test targets
  • change: chore: update dependencies to latest versions
  • change: chore: update pnpm and coveralls action versions in workflow
  • change: docs(core): Revamp README.md with simplified content, updated installation guides, and improved structure.
  • change: docs: Fix grammar in MongoDB and PostgreSQL README.md files
  • change: docs: Update compatibility and API references to use dynamic versioning (CURRENT_VERSION) and reflect 6.1.0 changes
  • change: feat(core): Add AggregateRepository helper for common aggregate root operations (#59)
  • change: feat(core, mongodb, postgresql): Add support for consistent aggregate versioning (#61)
  • change: feat(docs): Add content in docs site (#69)
  • …and 2 more

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

NickTsitlakidis/event-nest was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.

About this page

  • The score is its most recent published measurement, taken on 21 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit bfa9bbcfdd2fa5628119995ff4ca3b0551ac3bbd — the exact code this score is about.
  • Scored under rubric-2026.09.15 — the same rubric and the same method as every other entry in this index.
  • Measured by watchdog.canine.dev using codehealth-analyzer preprod-28e75b8e3254.