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
ProductCommandsApi
as controller - Uses
Mediator
for sending commands to handler
Events
andCommands
sit 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
,GetSnapshotStreamName
delegates for creating proper stream IdsProjectionManager
runs the Projections and every event fall into Projac projection handler.
-
Kubernetes
minikube start
eval $(minikube docker-env)
switch to kubernetes local registry your current terminal contextdocker ps #see what's going on kubernetes local registry
docker build -t productcontextes .
-
Helm
- Switch to
/deployments
helm package productcontext --debug
helm install productcontext
- Switch to
- Correlation/Causation Id
What brings you here of course not unique. I inspired a lot from WorkshopEventSourcing