-
Notifications
You must be signed in to change notification settings - Fork 2
feat(eventsourcingdb): adds package for EventSourcingDB #17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
…type safety and validation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Adds a new @nimbus/eventsourcingdb package to integrate Nimbus with EventSourcingDB (including tracing/metrics and observer retry support) and introduces a full CQRS + event-sourcing demo app, along with documentation and CI/publishing wiring.
Changes:
- Introduce
@nimbus/eventsourcingdbpackage (client setup, event mapping, read/write helpers, observer utilities, OpenTelemetry tracing/metrics). - Add
examples/eventsourcing-demoshowcasing CQRS + event sourcing with HTTP endpoints, projections, and observers. - Update docs navigation/content and CI workflows (checks + publish) to include the new package and example.
Reviewed changes
Copilot reviewed 47 out of 49 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/eventsourcingdb/src/lib/writeEvents.ts | Adds helper to map Nimbus events to ESDB candidates and write with trace propagation. |
| packages/eventsourcingdb/src/lib/tracing.ts | Adds OpenTelemetry span + metrics wrappers for ESDB operations. |
| packages/eventsourcingdb/src/lib/readEvents.ts | Adds helper to read ESDB events with tracing wrapper. |
| packages/eventsourcingdb/src/lib/eventObserver.ts | Adds observer abstraction with retry/backoff and per-event spans. |
| packages/eventsourcingdb/src/lib/eventMapping.ts | Implements Nimbus ↔ ESDB event mapping utilities and type guard. |
| packages/eventsourcingdb/src/lib/client.ts | Adds singleton ESDB client setup + verification + observer bootstrapping. |
| packages/eventsourcingdb/src/index.ts | Defines the package public exports. |
| packages/eventsourcingdb/deno.json | Adds package manifest/imports for publishing/consumption. |
| packages/eventsourcingdb/README.md | Adds package README. |
| packages/core/src/lib/message/router.ts | Allows message handlers to return sync values (in addition to promises). |
| examples/hono-demo/src/iam/users/core/commands/addUser.command.ts | Adds a TODO note in the Hono demo command file. |
| examples/eventsourcing-demo/start-with-otel.sh | Adds helper script to run demo with OTEL env configured. |
| examples/eventsourcing-demo/src/write/iam/users/shell/registerUserMessages.ts | Registers write-side command handlers in the router. |
| examples/eventsourcing-demo/src/write/iam/users/shell/http/router.ts | Adds HTTP endpoints that create/route write-side commands. |
| examples/eventsourcing-demo/src/write/iam/users/shell/commands/inviteUser.command.ts | Implements invite-user command handler writing events with preconditions. |
| examples/eventsourcing-demo/src/write/iam/users/shell/commands/acceptUserInvitation.command.ts | Implements accept-invitation handler reading/rebuilding state then writing with optimistic concurrency. |
| examples/eventsourcing-demo/src/write/iam/users/core/events/userInvited.event.ts | Defines user-invited event schema/type. |
| examples/eventsourcing-demo/src/write/iam/users/core/events/userInvitationAccepted.event.ts | Defines invitation-accepted event schema/type. |
| examples/eventsourcing-demo/src/write/iam/users/core/domain/user.state.ts | Adds minimal aggregate state + event application. |
| examples/eventsourcing-demo/src/write/iam/users/core/commands/inviteUser.command.ts | Defines invite-user command schema + decision producing events. |
| examples/eventsourcing-demo/src/write/iam/users/core/commands/acceptUserInvitation.command.ts | Defines accept-invitation command schema + decision logic. |
| examples/eventsourcing-demo/src/shared/shell/messages.ts | Initializes routers by registering views + user messages. |
| examples/eventsourcing-demo/src/shared/shell/http.ts | Adds shared Hono app wiring (middleware + routes). |
| examples/eventsourcing-demo/src/read/shell/registerViews.ts | Registers read-side query handlers. |
| examples/eventsourcing-demo/src/read/shell/queries/listUsers.query.ts | Implements list-users query handler (in-memory store). |
| examples/eventsourcing-demo/src/read/shell/queries/getUser.query.ts | Implements get-user query handler (in-memory store). |
| examples/eventsourcing-demo/src/read/shell/memoryStore/usersMemoryStore.ts | Adds in-memory projection storage utilities. |
| examples/eventsourcing-demo/src/read/shell/http/router.ts | Adds HTTP endpoints that create/route read-side queries. |
| examples/eventsourcing-demo/src/read/core/queries/listUsers.query.ts | Defines list-users query schema/type. |
| examples/eventsourcing-demo/src/read/core/queries/getUser.query.ts | Defines get-user query schema/type. |
| examples/eventsourcing-demo/src/read/core/projectViews.ts | Adds projection function to update read model from observed events. |
| examples/eventsourcing-demo/src/main.ts | Boots logger, routers, ESDB client + observer, and HTTP server. |
| examples/eventsourcing-demo/deno.json | Adds demo tasks/imports (including OTEL task). |
| docs/guide/mongodb/index.md | Updates docs navigation to come after the new EventSourcingDB section. |
| docs/guide/hono/on-error.md | Updates docs navigation to point to EventSourcingDB next. |
| docs/guide/eventsourcingdb/write-events.md | Adds documentation for writeEvents. |
| docs/guide/eventsourcingdb/read-events.md | Adds documentation for readEvents. |
| docs/guide/eventsourcingdb/index.md | Adds EventSourcingDB guide landing page. |
| docs/guide/eventsourcingdb/event-observer.md | Adds documentation for observer usage/config. |
| docs/guide/eventsourcingdb/event-mapping.md | Adds documentation for event mapping utilities. |
| docs/guide/eventsourcingdb/client-setup.md | Adds documentation for client setup. |
| docs/.vitepress/config.mjs | Adds EventSourcingDB section to sidebar navigation. |
| deno.lock | Adds/updates dependencies for EventSourcingDB and demo. |
| deno.json | Adds new workspace members for the package + demo. |
| DEVELOPMENT.md | Adds local dev instructions for running EventSourcingDB via Docker. |
| .gitignore | Ignores ESDB data dir and Claude local settings. |
| .github/workflows/publish.yaml | Publishes the new eventsourcingdb package. |
| .github/workflows/checks.yaml | Adds dependency installation step in CI checks workflow. |
| .claude/settings.local.json | Removes local Claude settings from the repository. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
examples/eventsourcing-demo/src/write/iam/users/core/domain/user.state.ts
Outdated
Show resolved
Hide resolved
|



Adds a new package to use the EventSourcingDB with Nimbus, alongside a new example application to show how to build an app using CQRS and Eventsourcing.