Skip to main content

What is Powerhouse?

Powerhouse is a framework for building apps whose state lives in documents that evolve through operations. If you've built with CRDTs, , or Git, a lot of this will feel familiar — with one twist: Powerhouse makes the type of each document explicit, so actions are always validated before they turn into operations.

By the end of this lesson, you should be able to answer: what does Powerhouse store, and how does an app make changes to it?

The core loop

Everything in Powerhouse flows through the same cycle:

  1. You dispatch an action — just data describing what you want to happen.
  2. A reducer runs — a that returns the next state and emits an operation.
  3. The operation is appended — to the document's immutable history, and eventually synced to peers.
// Dispatch
const action = addTodo({ id: "t-1", title: "Learn Powerhouse" });

// The reducer produces the next state
const nextDoc = reducer(currentDoc, action);

This loop never changes, whether the document is a to-do list, a finance ledger, or a 10,000-line design doc.

QuizWhich statement best describes what Powerhouse actually stores on disk?

Why operations, not snapshots?

Storing what changed instead of what is unlocks a few things:

  • Deterministic replay — hand the operation log to any machine and it rebuilds the same state.
  • Conflict-free sync — two offline clients can both edit, then reconcile by merging operations in order.
  • Auditable history — every change is addressable by index and hash.
  • Derived read models — processors fold operations into search indexes, dashboards, or analytics without re-querying the source.

The pieces you'll meet

These are the terms that show up everywhere in the docs and in the rest of these lessons:

TermWhat it is
Document ModelA typed schema + the set of actions allowed on it.
DocumentAn instance of a model, plus its operation history.
ActionPure data — a name and inputs — describing an intended change.
OperationAn action after it ran through a reducer: stamped with index, timestamp, hash.
ReducerA pure function (state, action) → nextState.
EditorA React UI that dispatches actions.
ProcessorAn event-driven handler that derives read models from operations.
ReactorThe engine that runs reducers, persists operations, and syncs them.
QuizYou're building a note-taking app. Which of these belongs in a reducer, and which in an editor?