Skip to content

saan800/saansoft-cqrs

Repository files navigation

SaanSoft.Cqrs

Lightweight CQRS and Event Sourcing implementation for C#

Status

build-and-test codecov OpenSSF Scorecard OpenSSF Best Practices

Documentation

Todo...

  • event source vs event stream vs event driven
  • cqrs
  • glossary
  • index with links to implemented decorators (instead of in this file)

TODO

IInMemory***Bus for publishers

  • tryExecute / queue / fetch

all messages - attribute to have 3rd party queue group name (for aws/azure/etc)

Features

  • Replay events
  • replay events for new handlers

Decorators

  • Store - Store messages, and optionally their publisher and handlers
  • ILogger Scope
    • Ensure useful structured logging by adding ILogger.BeginScope with message metadata
  • Ensure CorrelationId
  • Encryption / Decryption
  • retry with polly

Message Repository

  • MongoDB implementation
  • AWS DynamoDB (maybe, plus example app if doing)
  • Azure Cosmos DB (maybe, plus example app if doing)

Message Buses

  • In Memory
  • AWS SNS/SQS
  • Azure Topics and Queues (maybe, plus example app if doing)

DI frameworks

  • 👀 c# IServiceCollection
  • SimpleInjection

Examples

Shared api and messaging functionality

👀

Users

  • User - {Key, Name}
  • CRUD

TodoList

  • TodoItem - {Key, Title, Order, AssignedTo?=User, Status=New|InProgress|Done}
    • Add/edit/delete
    • AssignToUser
    • UpdateStatus
    • UpdateOrder
  • TodoList - {Key, Title}
    • Add/edit/delete
    • Get all lists
    • Get all lists with items assigned to user
    • Get by list Key
  • Maybe in future
    • Add an image to the TodoItem, see how its dealt with in upload and message processing

Basic InMemory Api

  • in memory messaging
  • no decorators
  • no message store
  • MongoDB for read model for queries

Api endpoint tests

  • Run Api in Github Actions CI
    • Will eventually want to run a test matrix of Api tests
  • Run same tests against each example Api to ensure functionality is the same from a users perspective
    • Specflow + Playwright
  • Enrich each test matrix to ensure decorators/db/etc are working

MongoDB Store Api

  • in memory messaging
  • all the decorators
  • mongodb repositories
  • use messages to build read model in queries
  • diagnostic/info flowchart of messages
    • filter by
      • to from date
      • message full type name
      • correlation id
      • assembly for publisher/handler??
      • has error
    • return mermaid text from api
    • maybe svelvet for ui
  • Use docker compose local dev and GitHub CI infrastructure

Aws Lambda Api and SNS/SQS handlers

  • Aws SNS/SQS messaging
  • all the decorators except stores
  • queries read model from ??
  • Use LocalStack for local dev and GitHub CI infrastructure

About

CQRS and Event Sourcing implementation for c#

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •