feat(eventcore-demo): demo application with PostgreSQL backend (#260) #412
No reviewers
Labels
No labels
adr
automated
bug
chore
dependencies
documentation
enhancement
epic
github-actions
P1-high
P2-medium
P3-low
release
research
rust
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Slipstream/eventcore!412
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/260-demo-app"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Adds
eventcore-demo, a runnable demonstration application showing EventCore with the PostgreSQL backend. A small bank domain centered on the multi-stream atomicTransfer— EventCore's signature capability: a singleexecute()atomically withdraws from the source account stream and deposits to the destination stream under optimistic concurrency.What's included
domain.rs): semanticnutypetypes (MoneyAmount,AccountHolder),BankEvent, account-id helper.commands.rs):OpenAccount,Deposit,Withdraw(single-stream) andTransfer(multi-stream atomic) — all#[derive(Command)]+CommandLogicwith pureapply/handle, private write-model state with intent-revealing methods, and typedthiserrorbusiness-rule errors.projections.rs): aTransactionHistoryprojector — a separate code path from command state (CQRS).main.rs): configuresPostgresEventStorefromDATABASE_URL(defaultlocalhost:5433), migrates, runs open→deposit→transfer, projects, and prints balances + a conserved-total check. No panics; errors map toExitCode::FAILURE.docker-compose up -d(reuses the root compose), andcargo run -p eventcore-demo.publish = false(demo, excluded from crates.io / release lockstep). Lint block matches the established bin-crate convention (eventcore-stress/eventcore-bench).Verification
cargo clippy --workspace --all-targets --all-features -- -D warningscleancargo nextest run --workspace— 276 tests pass (7 demo tests)cargo run -p eventcore-demoagainst Postgres: Alice 1000−300=700, Bob 250+300=550, total conserved at 1250, with both transfer legs visible in the log.Acceptance criteria
Closes #260
This pull request introduces a new demo application,
eventcore-demo, showcasing EventCore with a PostgreSQL backend. The demo includes a small bank domain with commands for account operations and a multi-stream atomic transfer feature. The implementation appears robust with comprehensive tests and documentation, making it safe to merge.Walkthrough
eventcore-demoas a new package in the workspace.publish = falseto exclude from crates.io.LLM usage and cost
Estimated total USD: $0.072581 via https://api.openai.com and https://api.openai.com