Skip to main content

Installation

Installing the Core Package

DugongJS consists of multiple packages that can be installed individually as needed. The core package is always required:

npm install @dugongjs/core

The core package provides everything needed to define aggregates and domain events, as well as factories and managers to load aggregates and persist changes. It also exposes a set of ports and some basic adapters for persistence, transaction management and messaging.

While you can use the core package directly, DugongJS also provides several packages for integration with other frameworks and adapters for infrastructure.

Installing the CLI

DugongJS comes with a command-line interface (CLI) tool that can be used for inspecting and interacting with event-sourced aggregates. To install the CLI, run:

npm install --save-dev @dugongjs/cli

Integrations

NestJS

The best way to get started with DugongJS and NestJS is to follow the NestJS tutorial.

Install the NestJS integration package:

npm install @dugongjs/nestjs

To enable synchronous IPC or the DugongJS CLI, also install the following:

npm install @nestjs/microservices @dugongjs/nestjs-microservice-query

Adapters

TypeORM

DugongJS provides a TypeORM adapter for integrating with TypeORM. To install the TypeORM adapter, run:

npm install typeorm @dugongjs/typeorm

For NestJS integration with TypeORM, also install the following:

npm install @nestjs/typeorm @dugongjs/nestjs-typeorm

Kafka

DugongJS provides a Kafka adapter for messaging using Apache Kafka. To install the Kafka adapter, run:

npm install kafkajs @dugongjs/kafka

For NestJS integration with Kafka, also install the following:

npm install @dugongjs/nestjs-kafka