Welcome to the OKEngine handbook. Keep the model small; let the backend grow without growing the mental model.

<Callout title="The Law">
  Every backend behavior is a Flow: `on(Trigger) → Effects`. One species; triggers are typed values.
</Callout>

```ts
on(http.post(), createBooking); // path + name from the file tree
on(expireStaleClock, expireStale);
on(orderPlaced, sendReceipt);
```

## 01 Understand

Master the mental model before exploring features:

<Cards>
  <Card
    title="The Architecture"
    description="Why backends drift apart, the one rule that stops it, and the five pieces behind every Flow."
    href="/docs/understand/the-architecture"
  />
  <Card
    title="Try It"
    description="From an empty folder to a Flow running in the Console — one sitting, minimal detour."
    href="/docs/understand/try-it"
  />
</Cards>

## 02 Elements

Deep primitives and execution law:

<Cards>
  <Card
    title="Elements"
    description="Flow, Signal, Store, Clock, Gate, Vault, Channel, AI."
    href="/docs/elements"
  />
  <Card
    title="Reference"
    description="CLI, configuration, fx, errors, security, and plugins."
    href="/docs/reference"
  />
  <Card
    title="AI Resources"
    description="Runtime MCP (:6535), docs MCP (:6536), agent skills, and machine-readable docs."
    href="/docs/ai"
  />
</Cards>

## 03 Extend

Connect to infrastructure and extend the model:

<Cards>
  <Card
    title="Plugins"
    description="Official extensions that add capabilities without creating a ninth element."
    href="/docs/plugins"
  />
  <Card
    title="Providers"
    description="Managed cloud infrastructure behind protocol-named drivers."
    href="/docs/providers"
  />
  <Card
    title="Recipes"
    description="Self-hosted Docker compose recipes for SQL, KV, search, and local AI."
    href="/docs/recipes"
  />
</Cards>

## 04 Client

Call your Flows from a browser, CLI, or another service — typed, zero separate codegen:

<Cards>
  <Card
    title="Overview"
    description="createClient, envelopes as values, and how Client relates to the eight elements."
    href="/docs/client"
  />
  <Card
    title="Calling"
    description="REST vs RPC, options, result helpers, resources, and remote types."
    href="/docs/client/calling"
  />
  <Card
    title="Auth"
    description="Bearer sessions, refresh once on 401, and gate denials as values."
    href="/docs/client/auth"
  />
  <Card
    title="Live"
    description="api.live SSE, resume, and live resource queries."
    href="/docs/client/live"
  />
  <Card
    title="React"
    description="useSession, useLive, and useLiveQuery from okengine/client-react."
    href="/docs/client/react"
  />
</Cards>
