A practical/experimental Event Sourcing application on Product Bounded Context in an e-commerce
I wanted to implement what i learnt about DDD CQRS and EventSourcing, that's why i created this repository. I will add new things to here by time as i learn.
- Docker
- EventStore
- Couchbase for query side
EventStore and Docker will be organized by docker-compose.yml
- AggregateSource for base structure of AggregateRoots and Entities
- Value for value objects
- MediatR for seperating command and queries
- Projac for projections
- LibLog for logging
Repository contains a docker-compose.yml file which provides all dependencies for bootstrapping and developing.
docker-compose up
You can run tests afterwards.
StoryStream is used for Event Storming while modeling domain model.
Domain model basically provides a Product which has a Color (Content) and it's Variants.
Solution has 3 main projects. These projects are:
- ProductContext.WebApi
- ProductContext.Domain
- ProductContext.Framework
- Uses Swagger for documentation
- Has a
ProductCommandsApias controller - Uses
Mediatorfor sending commands to handler
EventsandCommandssit here.
| AggregateRoot | Entities | ValueObjects | Documents |
|---|---|---|---|
| Product | ProductContent | ProductContentId | ProductContentDocument |
| ProductVariant | ProductVariantId | ProductVariantDocument | |
| ProductId | ProductDocument | ||
| ProductContentVariantValue | |||
| ProductVariantTypeValue | |||
| VariantTypeValue | VariantTypeValueId | Not yet implemented |
Product is a Snapshotable aggregate root.
- Snapshotting with
AsyncSnapshotableRepository<TAggregateRoot> - Tracking last projection status with
CouchbaseCheckpointStore Now,GetStreamName,GetSnapshotStreamNamedelegates for creating proper stream IdsProjectionManagerruns the Projections and every event fall into Projac projection handler.
-
Kubernetes
minikube starteval $(minikube docker-env)switch to kubernetes local registry your current terminal contextdocker ps #see what's going on kubernetes local registrydocker build -t productcontextes .
-
Helm
- Switch to
/deployments helm package productcontext --debughelm install productcontext
- Switch to
- Correlation/Causation Id
What brings you here of course not unique. I inspired a lot from WorkshopEventSourcing

