Skip to content
Ahoo-WangPublic

About

Modern Reactive CQRS Architecture Microservice development framework based on DDD and EventSourcing | 基于 DDD & EventSourcing 的现代响应式 CQRS 架构微服务开发框架

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

306 stars

Watchers

7 watching

Forks

Latest commit

 

History

8,703 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Wow

Wow

Wow 10.0 is in pre-release on this branch. The stable 9.x line lives on the v9 branch.

Domain Model as a Service

Write only the domain model, and get a system you can run: its API, its contract, its clients and its read models.

KaiCode'26 Excellent Award
KaiCode’26 Excellent Award

License GitHub release Maven Central Codecov CI Awesome Kotlin

Documentation · 中文文档


What you write, and what you get

You write an aggregate: it takes a command, looks at its state, and decides the events.

fun onCommand(command: Withdraw): Withdrawn {
    if (command.amount > state.balance) {
        reject(Rejections.INSUFFICIENT_BALANCE, "The balance is ${state.balance}.")
    }
    return Withdrawn(command.amount)
}

and you test it in the same terms:

@Test
fun `a withdrawal the balance does not cover is rejected`() = aggregateSpec(model, id = "alice") {
    given(AccountOpened("Alice"), Deposited(100))
    whenCommand(Withdraw(150)) { expectRejected(Account.Rejections.INSUFFICIENT_BALANCE) }
    whenCommand(Withdraw(30)) {
        expectEvents(Withdrawn(30))
        expectState { balance.assert().isEqualTo(70) }
    }
}

From that, Wow gives you an HTTP route for every command, a state read and queries for every aggregate, an OpenAPI document, a typed TypeScript client, retries and parking for every handler, and a contract that the build checks for compatibility.

Why Wow

  • The log is the bus. Every commit is appended to the log, and everything else (snapshots, read models, other contexts, the warehouse) follows it from there. Nothing is lost between a write and its consequences.
  • You write decisions, not plumbing. Aggregates decide; sagas derive commands; projections and reactors follow events. Routes, persistence, delivery and retries are the framework's.
  • Failures are data. A handler that keeps failing parks one aggregate, recorded in a ledger; it never skips an event or stops a subscription.
  • One contract. Routes, OpenAPI, typed clients, views and compatibility checks all come from one Manifest the compiler writes.
  • Read models are disposable. Every read model is rebuilt from the log, so changing one needs no migration.

Quickstart

  1. Apply the Gradle plugin me.ahoo.wow.service, which brings the BOM me.ahoo.wow:wow-bom of its version.
  2. Write a command, an event, a state and an aggregate.
  3. ./gradlew run, then send a command with curl.

The Quickstart walks through it in about thirty minutes.

Architecture

flowchart LR
    C[Clients] -->|commands| N[Service nodes]
    N -->|decide| L[(Log)]
    L --> S[Snapshots]
    L --> P[Projections and reactors]
    L --> G[Sagas]
    G -->|commands| N
    L -->|published streams| K[(Kafka)]
    K --> O[Other contexts]
    L --> W[(Warehouse)]
Loading

A service runs as one or more nodes over PostgreSQL or MongoDB; they split the log's partitions through leases in the same store. Contexts talk over Kafka. Concepts explains the model.

Modules

Artifact Holds
me.ahoo.wow:wow-bom The versions of every module
me.ahoo.wow:wow-api The annotations and types domain code uses
me.ahoo.wow:wow-kernel The kernel the generated models build on
me.ahoo.wow:wow-spring-boot The Spring Boot host
me.ahoo.wow:wow-test The test DSL
me.ahoo.wow:wow-postgres, wow-mongo The backends
me.ahoo.wow:wow-kafka, wow-clickhouse, wow-elasticsearch The transport, the warehouse, search

TypeScript

Package Does
@ahoo-wang/wow-client Commands with their waits, state reads and queries
@ahoo-wang/wow-generator Typed clients generated from a service's Manifest
@ahoo-wang/wow-react React hooks for queries
@ahoo-wang/wow-view-engine Configurable data views: records, analyses and dashboards
@ahoo-wang/wow-view-store Saved views on a Wow server

Platform services and examples

Requirements

Component Version
Java 21
Kotlin 2.4.21
KSP 2.3.13
Spring Boot 4.1.2

From 9.x

Migrating from 9.x covers the source, the data and the cut-over. The 9.x line is maintained on the v9 branch.

Agent Skills

Six Skills help an agent write, migrate and query Wow applications: install the plugin ahoo-wow-skills from the Ahoo Skills Hub, or copy the skills of an exact Wow tag into the agent's Skills directory.

Community

License

Wow is released under the Apache 2.0 License.

About

Modern Reactive CQRS Architecture Microservice development framework based on DDD and EventSourcing | 基于 DDD & EventSourcing 的现代响应式 CQRS 架构微服务开发框架

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

306 stars

Watchers

7 watching

Forks

Releases

Packages

Used by

Contributors

Languages