# Nimbus CQRS Framework > TypeScript framework for event-driven apps: CQRS, Event Sourcing, CloudEvents messaging, OpenTelemetry. Start with /guide/glossary.md and /guide/in-depth-example.md for terminology and a full walkthrough. Packages: https://www.npmjs.com/org/nimbus-cqrs ## Guide ### Core - [Commands](https://nimbus.overlap.at/guide/core/commands.md): Commands are CloudEvents-shaped write messages expressing intent to change state; validated and routed to handlers. - [Queries](https://nimbus.overlap.at/guide/core/queries.md): Queries are CloudEvents-shaped read messages that fetch data without mutating application state. - [Events](https://nimbus.overlap.at/guide/core/events.md): Events are immutable CloudEvents facts about what already happened; they power event-driven and event-sourced designs. - [Router](https://nimbus.overlap.at/guide/core/router.md): MessageRouter routes commands, queries, and events to handlers with Zod validation and OpenTelemetry tracing. - [Event Bus](https://nimbus.overlap.at/guide/core/event-bus.md): NimbusEventBus provides in-process publish/subscribe for events with async delivery and retry on handler failure. - [Checkpoint Store](https://nimbus.overlap.at/guide/core/checkpoint-store.md): CheckpointStore is the contract for persisting where event consumers resume; the core ships the types and an in-memory implementation. - [Exceptions](https://nimbus.overlap.at/guide/core/exceptions.md): Structured Nimbus exceptions carry optional HTTP status codes and details for consistent API error responses. - [Observability](https://nimbus.overlap.at/guide/core/observability.md): Built-in logging, tracing, and metrics via OpenTelemetry with zero boilerplate on routers, handlers, and messages. - [Logging](https://nimbus.overlap.at/guide/core/logging.md): Structured console logging with JSON or pretty formatters, truncation, and OpenTelemetry integration. - [withRetry](https://nimbus.overlap.at/guide/core/with-retry.md): withRetry retries async work with exponential backoff, jitter, AbortSignal support, and hooks for custom retry decisions. - [getEnv](https://nimbus.overlap.at/guide/core/get-env.md): getEnv loads environment variables, failing fast when a required one is missing and returning undefined for optional ones. ### Hono - [CorrelationID Middleware](https://nimbus.overlap.at/guide/hono/correlationid.md): Hono middleware that reads or generates a ULID correlation ID per request for distributed tracing. - [Logger Middleware](https://nimbus.overlap.at/guide/hono/logger.md): Hono middleware that logs HTTP requests and responses with timing and optional OpenTelemetry spans. - [onError Handler](https://nimbus.overlap.at/guide/hono/on-error.md): Hono onError handler that maps Nimbus exceptions to structured JSON HTTP responses with correct status codes. - [Route Adapter](https://nimbus.overlap.at/guide/hono/routing.md): Hono route adapters that turn an HTTP request into a Nimbus command or query and return the handler result as JSON. ### EventSourcingDB - [Client Setup](https://nimbus.overlap.at/guide/eventsourcingdb/client-setup.md): setupEventSourcingDBClient initializes a singleton EventSourcingDB client with connectivity checks and auth. - [Write Events](https://nimbus.overlap.at/guide/eventsourcingdb/write-events.md): writeEvents appends Nimbus events to EventSourcingDB with mapping, trace context, and optional preconditions. - [Read Events](https://nimbus.overlap.at/guide/eventsourcingdb/read-events.md): readEvents streams events for a subject from EventSourcingDB; use event mapping to restore Nimbus event shapes. - [Event Observer](https://nimbus.overlap.at/guide/eventsourcingdb/event-observer.md): An event observer watches one subject and feeds every event to its consumers (projections, policies, process managers, etc.) each resuming from its own checkpoint. - [Event Mapping](https://nimbus.overlap.at/guide/eventsourcingdb/event-mapping.md): Utilities convert between Nimbus CloudEvents and EventSourcingDB records, preserving correlation ID and schemas. ### MongoDB - [Connection Manager](https://nimbus.overlap.at/guide/mongodb/connection-manager.md): MongoConnectionManager holds one long-lived MongoClient singleton with typed getDatabase and getCollection helpers. - [Repository](https://nimbus.overlap.at/guide/mongodb/repository.md): MongoDBRepository is a type-safe base for collection CRUD with Zod validation, error mapping, and tracing. - [CRUD+](https://nimbus.overlap.at/guide/mongodb/crud.md): Low-level traced MongoDB CRUD helpers with Nimbus exceptions — use directly or via MongoDBRepository. - [MongoJSON](https://nimbus.overlap.at/guide/mongodb/mongo-json.md): MongoJSON parse/stringify preserves MongoDB extended types (ObjectId, Date, etc.) in JSON round-trips. - [handleMongoError](https://nimbus.overlap.at/guide/mongodb/handle-mongo-error.md): handleMongoError maps MongoDB driver error codes to Nimbus exceptions for consistent application error handling. - [Deploy Collection](https://nimbus.overlap.at/guide/mongodb/deploy-collection.md): deployMongoCollection declaratively creates or updates collections with JSON schema validation and indexes. - [Checkpoint Store](https://nimbus.overlap.at/guide/mongodb/checkpoint-store.md): MongoCheckpointStore persists event consumer checkpoints in a MongoDB collection. ### Other - [An in Depth Example](https://nimbus.overlap.at/guide/in-depth-example.md): Walkthrough of eventsourcing-demo — CQRS, Event Sourcing, pure core vs shell, projections, and queries with links to source files. - [Architecture](https://nimbus.overlap.at/guide/architecture.md): Recommended foundation — Pure Core (side-effect-free domain logic) inside an Imperative Shell (HTTP, DB, I/O), aligned with CQRS and Event Sourcing. - [ESDM Demo](https://nimbus.overlap.at/guide/esdm-demo.md): The esdm-demo example application is a ticketing backend that follows the workflow and the project structure of the Nimbus skills, from the ESDM domain model to the code. - [Glossary](https://nimbus.overlap.at/guide/glossary.md): Pinned vocabulary for Nimbus, CQRS, and Event Sourcing — use these definitions literally when reasoning about the framework. - [Nimbus for AI](https://nimbus.overlap.at/guide/nimbus-for-ai.md): Event Sourcing gives AI systems rich, time-ordered domain history. Nimbus ships llms.txt and agent skills that help coding agents learn and apply the framework accurately. - [Quickstart](https://nimbus.overlap.at/guide/quickstart.md): Install @nimbus-cqrs packages from npm for Node.js, Bun, or Deno; core is required, other packages are optional by need. - [The Philosophy behind Nimbus](https://nimbus.overlap.at/guide/philosophy.md): Nimbus favors simplicity, explicit code, no framework magic, and a flat learning curve over heavy OOP or DI-heavy frameworks. - [What is Nimbus?](https://nimbus.overlap.at/guide/what-is-nimbus.md): Nimbus is a lightweight TypeScript framework for event-driven apps with CloudEvents messaging, CQRS patterns, and built-in OpenTelemetry observability. ## Optional - [eventsourcing-demo](https://github.com/overlap-dev/Nimbus/tree/main/examples/eventsourcing-demo): Full CQRS + Event Sourcing example application - [esdm-demo](https://github.com/overlap-dev/Nimbus/tree/main/examples/esdm-demo): Ticketing example application with an ESDM domain model, built in the project structure of the Nimbus skills - [npm @nimbus-cqrs](https://www.npmjs.com/org/nimbus-cqrs): Published packages - [EventSourcingDB docs](https://docs.eventsourcingdb.io/): Event store used by the EventSourcingDB package - [CloudEvents](https://cloudevents.io/): Message format used by Commands, Events, and Queries