A small but complete example of CQRS and Event-Sourcing in a largely simplified clinic domain.
The system is composed of a few http endpoints which expose the following use cases and queries:
- Command - Admit a patient to the clinic
- Command - Transfer a patient to a different ward
- Command - Discharge a patient
- Query - Fetch the complete patient roster
The system showcases eventstore library which uses postgres as an event store (in this case) along with its convenient abstractions (aggregate, eventstore, projection mechanism, etc...) and Ambar data streaming emulator as the event bus / projection engine which is used to project the events into a read model persisted in mongodb.
- Clone the repository
- Run
docker-compose up
ormake up
(make stop
) to start the services - Visit swagger ui and explore the endpoints