Giter Site home page Giter Site logo

qas / examples-nodejs-cqrs-es-swagger Goto Github PK

View Code? Open in Web Editor NEW
488.0 488.0 140.0 1.18 MB

A Node.js CQRS and Event Sourcing Microservice Example Using Nest.js, Event Store, and Swagger

Dockerfile 2.24% TypeScript 94.63% Shell 3.13%
cqrs-es ddd event-store microservice nodejs swagger

examples-nodejs-cqrs-es-swagger's People

Contributors

aboglioli avatar qas avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

examples-nodejs-cqrs-es-swagger's Issues

Another Aggregate Root

So far this is the most complete example of ddd+ event sourcing + cqrs I have seen for nest. Thank you ๐Ÿ™

One thing I would like to see is how you handle more aggregate roots?

Do they each get their own folder like user?

Also as a side note I think user is a bit too all encompassing of a domain.

writeEvent not finishing

Hi,
I'm trying to play around the boilerplate code and understand how is working the eventbus structure, but I have problems writing to the eventstore.
I've tried to console.log the functions from commands, command handlers, till the event handlers, and I can see that code works well until needs to write to the store.

console.log('444', 'goes here');
const result = await this.eventStore.client.writeEvent(streamName, type, event);
console.log('5555', 'never is shown this message');

I'm starting the project from bash with up.sh script and everything is ok, project running on 7070 port.
One issue I have on windows 10 with docker running in daemon mode the evenstore, so I need to go to docker settings and to expose daemon on port 2375 without TLS, this was like workaround to start the eventstore.
But, everything is hook-up and i can see that the connection to evenstore is established.

{ protocol: 'http',
  hostname: 'eventstore',
  tcpPort: 2113,
  httpPort: 2113,
  credentials: { username: 'admin', password: 'changeit' },
  poolOptions: { min: 1, max: 10 } }
}

BR, Igor

TypeError: Cannot read property 'atom:entry' of null

Hi ,
This this is best and most useful example of CQRS event source project example.Thanks a lot for your effort
Anyway i have an error in onEvent()
const content = result['atom:entry']['atom:content'][0];
^
TypeError: Cannot read property 'atom:entry' of null

Some advices on the guideline

Your article is great to introduce basic concept of CQRS ES
However, i think most of the people are actually confused on following topics:

  1. How to persistence data and query from it
  2. How to replay events to restore the persistence e.g. DB
  3. How to handle command failure
  4. How to handle persisting error
  5. How to work with domain more than 1 entity, e.g. Booking service that need to check existing records

Also, the detail of event Store should be added. Cause it will never work without the store.
E.g. Setup of Event Store by Docker
https://developers.eventstore.com/server/v5/server/installation/docker.html#run-with-docker

Compensation Sagas

Thoughts on adding more examples on compensation sagas? maybe with some things rolling back to previous state on failure?

Update to latest NestJS Version

Dear @qas ,
maybe you can update this example repository to the latest nestjs version? There are a few breaking changes, and it would be helpful to have a look at your example.

All the best and thanks for your time

Event Handler is not working

After i use create user command, it trigger command handler -> repo -> domain to apply userCreatedEvent, but then EventHandler can't catch the it and Saga also not work due to this

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.