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:
- You dispatch an action — just data describing what you want to happen.
- A reducer runs — a that returns the next state and emits an operation.
- 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.
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:
| Term | What it is |
|---|---|
| Document Model | A typed schema + the set of actions allowed on it. |
| Document | An instance of a model, plus its operation history. |
| Action | Pure data — a name and inputs — describing an intended change. |
| Operation | An action after it ran through a reducer: stamped with index, timestamp, hash. |
| Reducer | A pure function (state, action) → nextState. |
| Editor | A React UI that dispatches actions. |
| Processor | An event-driven handler that derives read models from operations. |
| Reactor | The engine that runs reducers, persists operations, and syncs them. |