The demo scenario is available in two forms:
Livebook —
docs/livebooks/logistiki_demo.livemd. Open it in Livebook for an interactive, step-by-step walkthrough with rendered output.Script —
Logistiki.Demo.run_demo/0from aniexormix runsession. Seeds the demo entity and account trees, links entities to accounts, processes the demo business events end-to-end, and prints the results.
Running the livebook
# From the project root — no PostgreSQL required, the livebook uses SQLite in-memory:
livebook open docs/livebooks/logistiki_demo.livemd
The livebook uses Mix.install with LOGISTIKI_DB_ADAPTER=sqlite and
ecto_sqlite3 to create an in-memory SQLite database. It runs migrations
programmatically via Ecto.Migrator. No external services are needed.
Running the script
On a fresh, migrated database:
mix ecto.drop && mix ecto.create && mix ecto.migrate
mix run -e 'Logistiki.Demo.run_demo()'
Or use the simulation backend explicitly and switch to the Beancount oracle:
Logistiki.put_ledger_backend(Logistiki.Ledger.Simulation)
Logistiki.Demo.run_demo()
Logistiki.put_ledger_backend(Logistiki.Ledger.Beancount)
Logistiki.Demo.run_demo()Demo business entities
Acme Holdings
Acme Trading Ltd
Acme Treasury Ltd
Bluewater Trust
Bluewater Operating CompanyDemo virtual accounts
Assets
Cash
USD
Nostro USD
Liabilities
Client Deposits
USD
Acme Holdings
Operating
Payroll
Escrow
Bluewater Trust
Operating
Income
Fees
Wire Fees
Expenses
Interest Expense
Suspense
USD SuspenseDemo events
- Deposit received for Acme Operating.
- Internal transfer from Acme Operating to Acme Payroll (template available).
- Wire fee assessed to Acme Operating.
- Mistaken fee reversed.
- Suspense posting corrected (template available).
- Customer account opened with no accounting impact.
What the demo shows
- Load knowledge program.
- Create entity tree.
- Create account tree.
- Link entities to accounts.
- Process deposit event.
- Show policy selected by Datalog (
:cash_deposit). - Show generated journal.
- Show generated postings.
- Show ledger backend execution.
- Show balance.
- Show statement (with running balance).
- Process fee event (
:corporate_wire_fee). - Reverse the fee.
- Show balance restored.
- Show audit evidence explaining everything.
Seed script
priv/repo/seeds.exs seeds the demo entity and account trees (idempotent — it
skips if entities already exist). Run with mix ecto.setup or
mix ecto.reset.