A toy project to explore the capabilities of functional event-sourcing using Kotlin
The project try to implement the following user stories. The domain is a simplified stock trading system.
- A user should create a new portfolio.
- A user should buy stocks for an existing portfolio.
- A user should sell stocks that it owns.
- A user should close a portfolio.
The following diagram shows the domain model of the system. The model is based on the user stories above.
The project uses the following technologies:
- Kotlin
- Arrow Kt
- Ktor
- Kotlinx Coroutines Flow
- EventStoreDB
- SQLDelight
- Kotest
- Testcontainers
- Mockk
- Ktlint
The project is heavily inspired by the following resources:
- Functional Event Sourcing Decider by Jeremie Chassaing
- Event sourcing Series' Articles by Jakub Zalas
- Ktor Arrow Real World Example by Simon Vergauwen