external eventbus module for @nestjs/cqrs

Overview

Nest Logo

A Cqrs External EventBus module for Nest framework (node.js)

Now available: Redis-EventBus

NPM Version Package License NPM Downloads

Installation

with npm

npm install --save nest-external-eventbus

with yarn

yarn add nest-external-eventbus

How to use?

RedisBusModule.forRoot(events, redisOption)

import { Module, Type } from '@nestjs/common';
import { HeroKilledDragonEvent, HeroFoundItemEvent } from './events'
import { RedisBusModule, RedisBusOptions } from 'nest-external-eventbus';

const events: Type[] = [HeroKilledDragonEvent, HeroFoundItemEvent];
const redisOption: RedisBusOptions = {
	subUrl: 'redis://localhost:6379',
	subChannel: 'REDIS_CHANNEL_HERE',
};

@Module({
	imports: [
		RedisBusModule.forRoot(events, redisOption),
	],
	controllers: [],
})
export class AppModule {}

Event Should extend StandardEvent

import { StandardEvent } from 'nest-external-eventbus';

export class HeroKilledDragonEvent extends StandardEvent {
	public constructor(public readonly payload: object) {
		super();
	}
}

Example

git clone [email protected]:goznauk/nest-external-eventbus.git
cd nest-external-eventbus
npm install

docker run -d  -p 6379:6379 -p 8001:8001 redis/redis-stack:latest

cd examples/simpleCqrs/
npm run start

pip3 install redis asyncio
python3 test.py

License

MIT

You might also like...

API Back-End de NodeJS com NestJS

A progressive Node.js framework for building efficient and scalable server-side applications. Description Nest framework TypeScript starter repository

May 29, 2022

Nestjs + Typescript + GraphQL

Nestjs Boilerplate: Nestjs + Typescript + GraphQL How to run Install dependencies yarn install Start server for development yarn start:dev Start ser

Jun 27, 2022

ObjectionJS on steroids for your nestjs application!

Introduction Almost every application nowadays, requires a database to persist data. We have integrated ObjectionJS as our supported ORM. ObjectionJS

Dec 15, 2022

This is a boilerplate for Nodejs (Nestjs/typescript) that can be used to make http server application.

Hexagonal architecture Table of Contents Overview Code architecture source code Service build information Regular user Advanced user Deployment Helm K

Sep 13, 2022

🦁 REST API for the NestJS + Next.js Todo application

Create new NestJS project $ npm i -g @nestjs/cli $ npm i -g yarn $ nest new api-lesson # set strict true in tsconfig.json Install packages # install

Jan 4, 2023

Small module that makes sure your catch, caught an actual error and not a programming mistake or assertion

safety-catch Small module that makes sure your catch, caught an actual error and not a programming mistake or assertion. npm install safety-catch Tri

May 4, 2022

membuat sebuah module pengganti database engine untuk mengelola data secara advance

membuat sebuah module pengganti database engine untuk mengelola data secara advance

Donate Sosial Media Introduction Database atau basis data adalah kumpulan data yang dikelola sedemikian rupa berdasarkan ketentuan tertentu yang salin

Dec 17, 2021

Same as sqlite-tag but without the native sqlite3 module dependency

sqlite-tag-spawned Social Media Photo by Tomas Kirvėla on Unsplash The same sqlite-tag ease but without the native sqlite3 dependency, aiming to repla

Nov 20, 2022

Memcached module for Nest framework (node.js) 🐈

Memcached module and service for Nest, a progressive Node.js framework for building efficient and scalable server-side applications. Installation npm

Nov 24, 2022
Owner
H.John Choi
H.John Choi
The nestjs cache module based on cache-manager & decorators 🍃

A progressive Node.js framework for building efficient and scalable server-side applications. zirus-cache zirus-cache for Nest.JS - simple and modern

Yakov Bobroff 4 May 9, 2022
This is a repository that contains an simple NestJS API about Movies developed at Blue EdTech.

NestJS Movies Technologies and requirements NestJS JavaScript TypeScript Prisma MySQL Project This is a repository that contains an simple NestJS API

Isabella Nunes 2 Sep 28, 2021
Starter template for NestJS 😻 includes GraphQL with Prisma Client, Passport-JWT authentication, Swagger Api and Docker

Instructions Starter template for ?? NestJS and Prisma. Checkout NestJS Prisma Schematics to automatically add Prisma support to your Nest application

notiz.dev 1.6k Jan 4, 2023
around nestjs, with prisma and some graphql lib,write less code,create power api

介绍 这是一个 prisma + nestjs + graphql 的集成示例 对于开发者来说,特别是使用 graphql 的时候,只需要写非常少量的代码即可完成数据的各种操作,同时也支持接口透传。 开发&部署 本地开发 npm run start:dev swagger 地址:http://loc

芋头 26 Nov 24, 2022
Nestjs boilerplate for beginners.

Description Nest framework boilerplate. Installation $ npm install Running the docker for postgres or simply update env with running postgres values $

Harris Gurung 18 Nov 30, 2022
API developed using NestJS, TypeORM, PgMem and concepts of Clean Architecture

The Powerful NestJS A progressive Node.js framework for building efficient and scalable server-side applications. Clean Architecture The project has b

Matheus Alexandre 20 Jan 2, 2023
Simple CRUD application with Nestjs, Prisma and Docker with Postgres

A progressive Node.js framework for building efficient and scalable server-side applications. Description Nest framework TypeScript starter repository

Torr7s 5 Nov 6, 2022
First NestJS project powered by TypeScript (Simple CRUD)

First Nest TS (TypeScript) First NestJS project powered by TypeScript (Simple CRUD) Routes Get All GET http://localhost:3000/products/ Get one GET htt

Max Base 3 Feb 22, 2022
NestJS + MikroORM example repository for testing within transactional contexts. Achieve a much faster test suite.

Description Nest NestJS + MikroORM example repository for testing within transactional contexts. Running tests in transactions will speedup your test

Tolga Paksoy 5 Dec 20, 2022
An in-depth implementation of Clean Architecture using NestJS and type-script

Clean Architecture With NestJS Description It's been a while since my last article on how to implement clean architecture on Node.js applications, git

null 297 Dec 28, 2022