Skip to main content

Templates

Every template is a standalone Bun monorepo you can clone and run. They share one flat layout, so moving between them is mostly a matter of which packages are present.

Each page below is generated from that template's own README, so what you read here is what ships in the repository.

Starting points​

The smallest complete examples. Read these first.

TemplateWhat it shows
minimalThe smallest complete Effectstream app: one EVM contract event becomes one validated command, one state transition, and one database row.
hex-battleA turn-based hex-grid tactics game whose rules live in one standalone package, imported unchanged by both the sync node and the browser client.

Multi-chain​

Templates that sync from, or settle across, more than one chain.

TemplateWhat it shows
evm-midnight-v2Multi-chain template that joins public ERC-721 ownership on EVM with metadata disclosed by a Midnight ZK circuit into a single rollup state.
evm-cardanoSyncs an EVM chain and a Cardano devnet side by side into one deterministic state machine, and shows both event streams in a single dashboard.
zk-cardanoPublic stake on Cardano decides who may vote; private ZK ballots on Midnight decide the outcome, with one state machine reading both chains.
night-bitcoin-v2Trustless BTC ↔ Midnight swaps with no bridge: users publish ERC-7683 intents, competing fillers settle both legs, and the node arbitrates.
multi-chain-token-transfer (legacy — not installable)A unified ERC1155 balance across a local EVM chain and Midnight, moved by a custom sync primitive and a batcher that writes to both chains.

Games​

Turn-based and real-time games built on the state machine.

TemplateWhat it shows
chess-v2A complete turn-based chess game on an EVM chain: lobbies, matchmaking, move validation, chess clocks and ELO, driven by scheduled state transitions.
world-map-2dA 10×10 tile world where the map lives in database rows, so grammar bounds and a foreign key do all the validation and each transition is one SQL write.
rock-paper-scissors (legacy — not installable)A best-of-N Rock Paper Scissors game where both players commit moves for the same round and the node resolves them deterministically, with timeout forfeits.
dice (legacy — not installable)A two-player turn-based dice game whose rolls are never stored: the node and every browser re-derive them from the block seed and the recorded moves.
shinkai-v2An AI-judged RPG where an off-chain LLM writes the story but never touches the token ledger, which stays deterministic on an EVM L2.

Chain-specific​

Focused examples of one chain's primitives and tooling.

TemplateWhat it shows
solana-starterA gasless Solana counter dApp: the user signs, a fee-payer batcher pays, and the sync node indexes the program's own log lines into Postgres.
cardano-delegationIndexes native Cardano stake-delegation certificates into a live dashboard — no smart contract, no batcher, and a node API that only ever answers GET.
projected-nft-preorderRunnable PRC-2 reference for Cardano: locks an NFT at the Hololocker Plutus script and indexes the Lock → Unlocking → Claim lifecycle into Postgres.
zswap-daA React frontend for atomic token swaps on Midnight, where open offers live as Celestia data-availability blobs rather than in an on-chain order book.

Applications​

Commerce, batching and other non-game applications.

TemplateWhat it shows
preorderA multi-chain presale where one product catalog is sold for EVM ETH, an ERC-20, or Cardano ADA, and every payment lands in one order book.
batcher-validationsShows how to reject inputs at the batcher before they are queued, by wrapping a blockchain adapter with a custom validateInput hook.

Also in this section​

PageWhat it covers
Wallet integrationsEvery supported wallet mode, demonstrated by the e2e/wallets-ui app.
Tarochi (case study)A production game built on Effectstream. Not a template in this repository.