Skip to content
11 min readUpdated 24 Nov 2026

Reaktor framework overview

Reaktor is a Kotlin Multiplatform framework for building a whole product, with its apps, servers and edge Workers, as one typed graph. Screens, routes, services, actors and stores are nodes. Each node declares what it provides and what it consumes through typed ports, and the graph connects them. The same graph code runs on Android, iOS, the JVM, the browser and Cloudflare Workers. Because the structure is data, tools can draw it, check it and change it, and an AI agent reads the same structure that the program runs.

BestBuds, a friendship app, is built on Reaktor and runs in production. The examples on this page come from its source.

The graph runtime, Surface UI, auth, typed services, actors, notifications, the Cloudflare bindings, telemetry, Hangar and the CLI are built and in use. Other parts are designs, and each design page says so in its first paragraph. Reaktor V2 (Deprecated), in the Theory section, is a deprecated historical design study — never build new work on V2; Reaktor moves directly from today's V1 graph runtime to Reaktor V3.

Reaktor at a glance. Each app is one typed graph of nodes, compiled for phones, the web, Cloudflare Workers and the JVM. Service contracts connect the apps to their backends. Hangar, the CLI and the MCP server read the same graphs through one workspace kernel.WHERE YOUR PRODUCT RUNSAndroid and iOS appsKotlin for Android, native for iOSscreens and routesactors and local storesservice clientsWeb appKotlin compiled to JavaScriptthe same screens, in the browserbrowser storage (SQLite on OPFS)service clientsCloudflare WorkersKotlin/JS on the Workers runtimeservice implementationsDurable Objects for actorsD1, R2 and KV bindingsJVM serverKotlin on the JVMthe auth serverservice implementationsSpring and Ktor adaptersService contracts: declared once in Kotlin, called by the apps, implemented by Workers and the server (reaktor-service)WHAT EACH APP IS MADE OFA graph of nodes with typed portsEach node declares what it provides and what it consumes; autoWire() connects them by type and key.Graphs nest: the app graph holds feature graphs, which hold screens, services and actors.Every graph owns a lifecycle, a coroutine scope, a dependency scope and a back stack.BasicNodeRouteNodeContractNodeActorNodeContainerNodeComposeNodeMODULES THAT ADD NODES AND PLATFORM CODEreaktor-surface: UIreaktor-auth: sign-in, rolesreaktor-db: datareaktor-work: background workreaktor-notification: pushreaktor-telemetry: signalsTOOLS THAT READ THE SAME GRAPHSHangardesktop app,13 linked panesreaktor CLIbuilds, runs,operationsMCP servertools forcoding agentsWorkspace kernelOne catalogue of operations with approvals and a runledger. It reads Graph.shape() from running apps,the build model, telemetry and the cloud.read
Reaktor at a glance: where a product runs, what each app is made of, and the tools that read the same graphs.

Read the picture from the top. A product runs in up to four places, and all of them compile from the same Kotlin. The apps call services, Workers and the server implement them, and both sides compile from one contract. Inside each place, the program is a graph of nodes joined by typed ports, and the framework modules add ready-made nodes for UI, sign-in, data, background work, push and telemetry. Because the graph is data, the tools on the right can read it: Hangar draws it, the CLI builds and runs it, and the MCP server answers coding agents' questions about it. All three go through one workspace kernel.

1. The idea#

Two choices define Reaktor.

Modules are full-stack. A module covers one capability from the screen to the server. reaktor-auth draws the "Sign in with Apple" button on iOS, and the same module verifies the resulting token inside a Cloudflare Worker and inside a JVM server. A service contract is declared once, and both the client that calls it and the server that implements it compile from that declaration.

The graph wires the modules. A node never reaches for a collaborator through a global or a singleton. It declares typed ports, and the graph connects each consumer to a provider. The structure of the application is therefore data that can be walked, serialized, drawn as a live diagram, validated and handed to a tool.

Every API is held to one design bar:

expressivity & composability ≫ simplicity ⋙ one-shot, bloated APIs

A small set of primitives that compose well is preferred over a large API that covers each case directly. Common cases should be short to write, and rare cases stay reachable through the lower-level primitives.

Unreal Engine is the closest model. Its engine programmers build durable systems such as rendering and physics, and designers compose many different games on top of them through Blueprints, a visual node graph. In Reaktor, the modules are the durable systems and products are composed on the graph. Hangar draws every graph in the Blueprint style.

2. The graph#

The graph runtime has three layers.

ModuleWhat it holds
reaktor-graph-portThe port graph: nodes, typed ports, edges, graph documents and visitors.
reaktor-graph-runtimeGraph, the node kinds, actors, navigation, dependency injection, lifecycle, and service contracts as nodes.
reaktor-graphCompose screens and containers that render a graph on Android, iOS, desktop and the web.

2.1 Graphs and nodes#

A Graph is a scoped container. It owns its nodes, a dependency-injection scope, a lifecycle, a coroutine scope and a navigation stack. Graphs nest, so an app graph holds feature graphs, and those hold screens, services and actors.

NodeRole
BasicNodeA plain unit of behaviour with ports.
ContractNodeA service contract, either served in-process or called over the network (§2.3).
RouteNodeA route such as /chats/{id}, with its navigation edges.
ControllerNodeA node that owns observable state.
ActorNodeA node with one ordered mailbox and private state (§2.5).
ContainerNodeA node that holds child graphs and activates the right one for the current route.
ComposeNode, ComposeContainerNodeScreens and screen containers drawn with Compose.

2.2 Ports and wiring#

A node declares what it offers with provides and what it needs with consumes. This is the chat media cache in BestBuds:

internal class ChatMediaCache(graph: Graph) : BasicNode(graph) {
    override val label = "Chat media"
    val cache by provides<ChatMediaCache>(this)
    private val media by consumes<ChatMedia>()
}

The node never looks up a ChatMedia itself. The graph connects the consumer port to a provider of that type. autoWire() matches every unconnected consumer to a provider by type and key and falls back to the dependency-injection scope. requireFullyWired() fails when a consumer has no provider, so a wiring mistake shows up when the graph is built.

Graph explains the order in which autoWire() looks for a provider, wire() for a whole tree of graphs, and the rules that keep wiring safe, with playgrounds to try each one.

2.3 Services#

A service contract is a class that lists its operations. This is part of the BestBuds messaging contract:

open class MessagingApi : Service("bestbuds.messaging") {
    override val access = ServiceAccess(Callers.SignedIn, ::sendBotMessage to WorkerServices)
    open val getMessages by get<ChatPage, MessagingResponse.Messages>("/messages/{chatId}")
    open val markRead by post<String, MessagingResponse.MarkedRead>("/messages/{chatId}/read")
}

The messaging Worker implements the contract by subclassing it. In the app, a graph places the contract as a node: serve(implementation) runs an implementation in the same process, and remote(MessagingApi() over link) calls a deployed one. A node can consume a whole service or one call of it, as the chat outbox does with consumes(MessagingApi().markReady). Services covers contracts, links, interceptors and access rules.

2.4 Capabilities and navigation#

Every graph has four capabilities.

CapabilityWhat it provides
LifecycleA guarded state machine: Created, Restoring, Attaching, Saving, Destroying.
ConcurrencyA coroutine scope owned by the graph and cancelled when it closes.
DependencyA dependency-injection scope chained to the parent graph, with Koin and Spring adapters.
NavigationA back stack driven by Push, Replace, Pop and Return commands, including navigation into another graph.

Navigation needs no separate library. A RouteNode holds a pattern such as /chats/{id}, navigation edges carry typed payloads, and Return hands a result back to the screen that opened the current one. On the web the back stack follows the browser URL.

2.5 Actors#

State that many events change at once belongs to an actor. An ActorNode is an ordinary node with one mailbox that it drains in order, so its state never needs a lock. BestBuds chat has two:

  • ChatOutbox owns every outgoing message. Queueing, uploads with progress, retries, discards and forwards all arrive as messages in its mailbox.
  • ChatReadReceipts collects read receipts per chat and sends them after a short delay.

Actors covers mailboxes, ask, supervision and the plan for actors that span machines.

2.6 Inspecting a graph#

Because the graph is data, other code can walk it. Graph.toJsonElement() serializes the nodes, ports and edges, including child graphs, and visitors in reaktor-graph-port run passes such as wiring checks over the same structure. Hangar's Graph pane draws a running app's graph this way, with live calls and wiring findings. The Reaktor MCP server gives agents the same view.

3. One codebase on every platform#

Reaktor code compiles for Android, iOS, the JVM (servers and desktop) and JavaScript (the browser and Node). Cloudflare Workers run the JavaScript build. Native C++ code is reached through FFI.

Feature slots keep platform code out of shared code. Shared code reads a slot such as Feature.Camera or Feature.Database, and each platform fills the slot when it starts, so a node never checks which platform it runs on. Core explains slots and adapters.

4. A worked example: BestBuds backends#

The BestBuds app declares every backend service as a typed port on one Backend graph:

abstract class Backend(parent: Graph, label: String, val user: User) : Graph(parent, label = label) {
    abstract val messaging: Provides<MessagingApi>
    abstract val circles: Provides<CirclesApi>
    abstract val matching: Provides<MatchingApi>
}

Two graphs implement it. Remote calls the deployed Workers:

override val messaging by lazy { remote(MessagingApi() over userLink(Servers.MessagingServer, user)) }

Mocked serves in-process mocks over a simulated world of users:

override val messaging by lazy { serve(MessagingMock(world, user.id)) }

A third graph, Build, puts a Relay node in front of each service and points it at one of the two. A developer build can therefore run chat against the mock world while circles and matching use the real server. Screens only consume MessagingApi, so they behave the same either way. The messaging Worker implements the same contract again, so the client, the server and the mock all follow one declaration, and Hangar shows which backend each service is using.

5. Modules and planes#

reaktor is one Gradle build. The products include it as a composite build, so a framework change reaches them without publishing anything. Its modules sit in twelve planes, one folder each under reaktor/, and a plane may use only the planes before it in this table.

PlaneWhat it holdsStart with
OriginRuntime types, the graph, actors, services, I/O, binary data and calls between languagesCore, Graph, Services, Actors
DataStorage and queries for graph nodesData layer
SurfaceUI components, their Compose implementation, the UI kit and hapticsSurface textbook
MachinesThe computers and devices that run Reaktor workCapabilities, Cluster
IdentitySign-in, access rules, secrets, cryptography, conversation encryption and app unlockAuth, Secrets
BuildSource tools, compile-time code generation and Apple framework exportIts modules
WorkDurable workflows, plans and task graphs, and approval to run operationsWork
CloudAn inventory of cloud resources, cloud clients and Cloudflare Workers bindingsIts modules
ViewsViews for graphs, boards and code, and the canvas they shareIts modules
ObservabilityTracing, analytics, performance measurement and live inspectionObserve and diagnose
PlatformWeb views, media, location, health, notifications and Google servicesWebView, Notifications
AgenticRunning coding agents, and tools over the graphThe agentic plane

Reaktor planes shows which planes each one may use, each plane's Modules page lists its modules, and Contributing says where a change belongs.

6. Tools#

The tools read the same graph the program runs.

  • Hangar is the desktop app. Its panes show a running app's graph, real phones side by side, the cloud resources a product runs on, its databases and its tests.
  • The reaktor CLI inspects builds, runs tasks under supervision and keeps a record of each run.
  • The Reaktor MCP server gives coding agents code queries, planned edits, checks and workspace operations. Hangar, the CLI and the MCP server share one workspace kernel.
  • Conductor runs Claude Code and Codex from inside Reaktor with one shared conversation history.
  • Shadow is the design for developing against a sanitized, moving copy of production.

7. What Reaktor improves#

Usual approachWhat goes wrongReaktor's approach
A separate codebase for each platform and tier, such as a Swift app, a Kotlin app and a TypeScript backendThe same models and API calls are written three times and drift apart.One Kotlin codebase compiles for the apps, the browser, the JVM and Workers. A service contract is declared once, and the client, the server and the mock all compile from it.
An API shared through documentation or a generated OpenAPI clientGenerated clients fall behind the server, and each side handles access rules and errors in its own way.The Worker implements the contract by subclassing it, and the contract carries its access rules, so both sides follow one declaration.
One library per layer: a UI toolkit, a DI container, a navigation library, an auth SDK, an analytics SDKGlue code joins libraries that each have their own lifecycle and their own idea of scope.A module covers one capability from the screen to the server, and one graph wires every module with one lifecycle.
Developer tools that each see one processThe phone, the backend and the database are inspected in separate tools that know nothing of each other.Hangar reads the graph of the apps, the Workers and the server, and its panes link a screen to its service, the Worker that serves it and the database it touches.
Coding agents that work from text searchAn agent guesses the structure of the app from file names and misses the wiring that only exists at run time.The MCP server answers from the same graph and build model the tools use, so an agent sees what Hangar shows.

8. Limitations#

  • Reaktor is Kotlin first. Swift, TypeScript and C++ code joins through FFI, web views or exported frameworks, and each crossing is extra work to build and test.
  • Wiring is checked when a graph starts. The compiler cannot see an input without a provider. requireFullyWired(), tests that build each graph and Hangar's checks find it instead. Graph lists the other wiring limits.
  • Products build the framework from source. BestBuds and Manna include reaktor as a composite build, so a framework change reaches every product at once, and a breaking change has to be fixed in every product in the same change.
  • Workers keep the limits of the Workers runtime. A Worker runs the JavaScript build, so its code has the CPU time, memory and threading limits of any Cloudflare Worker.
  • Parts are still designs. Each design page says so in its first paragraph, and Reaktor V2 (Deprecated) is deprecated and will not be built — Reaktor moves directly from today's V1 graph to Reaktor V3.

9. Where to read next#