Skip to content

jamesmh/event-sourcing-typescript-lessons

Repository files navigation

DDD & Event Sourcing Basics In TypeScript

To run the lessons first open the main.ts file for instructions on selecting a specific lesson to "run".

To run the code in your terminal once a lesson(s) is selected:

  1. npm install
  2. npm run run

About Lesson 5+

Lesson 5 is a stand-alone nestjs project. Take a look at the ./lesson5-nestjs-mvc/src/purchase directory for the goodies.

To run the sample web app, navigate to ./lesson5-nestjs-mvc and run npm install && npm run start.

There are two pages that use event sourcing:

  1. localhost:3000/purchase: Shows how to use event sourcing to create a new purchase, display a list of existing purchases and refund specific purchases.
  2. localhost:3000/purchase/report: Demonstrates how to use projections to generate reports based off of events in the store.

TODOs

  • Projections using DI
  • Projections for single purchases cached vs. replayed when requested
  • Add event store persistance (to a file I suppose) + persist projections too
  • Add ability for application to replay projections on startup
  • Add support for optimistic concurrency?
  • Example using EventStoreDB?

About

Exploring the basics of event sourcing in TypeScript

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages