https://github.com/rcardin/functional-event-sourcing-in-kotlin
A toy project to explore the capabilities of functional event-sourcing using Kotlin
https://github.com/rcardin/functional-event-sourcing-in-kotlin
arrow-kt coroutines-flow event-sourcing eventstoredb functional-event-sourcing functional-programming hexagonal-architecture kotest kotlin sqldelight testcontainers
Last synced: 8 months ago
JSON representation
A toy project to explore the capabilities of functional event-sourcing using Kotlin
- Host: GitHub
- URL: https://github.com/rcardin/functional-event-sourcing-in-kotlin
- Owner: rcardin
- License: mit
- Created: 2023-11-13T11:15:33.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-02-25T17:08:47.000Z (over 1 year ago)
- Last Synced: 2025-01-18T07:29:39.180Z (10 months ago)
- Topics: arrow-kt, coroutines-flow, event-sourcing, eventstoredb, functional-event-sourcing, functional-programming, hexagonal-architecture, kotest, kotlin, sqldelight, testcontainers
- Language: Kotlin
- Homepage:
- Size: 1.63 MB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README



# Functional Event-Sourcing in Kotlin
A toy project to explore the capabilities of functional event-sourcing using Kotlin
## User Stories
The project try to implement the following user stories. The domain is a simplified stock trading system.
- [x] A user should create a new portfolio.
- [x] A user should buy stocks for an existing portfolio.
- [x] A user should sell stocks that it owns.
- [x] A user should close a portfolio.
## Event Storming / Domain Modeling
The following diagram shows the domain model of the system. The model is based on the user stories above.

## Technology Stack
The project uses the following technologies:
- Kotlin
- [Arrow Kt](https://arrow-kt.io/)
- [Ktor](https://ktor.io/)
- [Kotlinx Coroutines Flow](https://kotlinlang.org/docs/flow.html)
- [EventStoreDB](https://eventstore.com/)
- [SQLDelight](https://cashapp.github.io/sqldelight/)
- [Kotest](https://kotest.io/)
- [Testcontainers](https://www.testcontainers.org/)
- [Mockk](https://mockk.io/)
- [Ktlint](https://ktlint.github.io/)
## References
The project is heavily inspired by the following resources:
- [Functional Event Sourcing Decider](https://thinkbeforecoding.com/post/2021/12/17/functional-event-sourcing-decider) by Jeremie Chassaing
- [Event sourcing Series' Articles](https://dev.to/jakub_zalas/series/25345) by Jakub Zalas
- [Ktor Arrow Real World Example](https://github.com/nomisRev/ktor-arrow-example) by Simon Vergauwen