> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kvant.sbs/jeston/llms.txt
> Use this file to discover all available pages before exploring further.

# Architecture

<img src="https://mintcdn.com/nexun/a8YT9t0VBftzJ3Nb/jeston/images/6206.png?fit=max&auto=format&n=a8YT9t0VBftzJ3Nb&q=85&s=28b3cd5c331de4d405f1ae326659a09d" alt="6196" title="6196" lightAlt="6196" darkAlt="6196" className="mx-auto dark:hidden" width="1600" height="525" data-path="jeston/images/6206.png" />

<img src="https://mintcdn.com/nexun/a8YT9t0VBftzJ3Nb/jeston/images/6196.png?fit=max&auto=format&n=a8YT9t0VBftzJ3Nb&q=85&s=042892624045fe0b0402c689af908d1d" alt="6196" title="6196" lightAlt="6196" darkAlt="6196" className="mx-auto hidden dark:block" width="1600" height="525" data-path="jeston/images/6196.png" />

***

# Core · Architecture

> **Core principle** — See Jeston as a set of lifecycle contracts with replaceable platform edges.

A clear ownership map for compiler, router, request context, renderer, and adapters.

### Key concepts

<Columns cols={3}>
  <Card title="Lifecycle" icon="sparkles">
    Framework
  </Card>

  <Card title="Policy" icon="shield-check">
    Application
  </Card>

  <Card title="Protocol" icon="gauge-high">
    Adapter
  </Card>
</Columns>

### Boundary model

```mermaid placement="top-right" theme={null}
flowchart LR
    compiler[Route compiler] --> manifest[Route manifest]
    manifest --> runtime[HTTP runtime]
    runtime --> context[Request context]
    context --> renderer[React renderer]
    context --> adapters[Platform adapters]
```

### Ownership matrix

| Concern   | Jeston/application boundary | Review signal                   |
| --------- | --------------------------- | ------------------------------- |
| Lifecycle | Framework                   | Stable and portable.            |
| Policy    | Application                 | Business-specific and testable. |
| Protocol  | Adapter                     | Replaceable and provider-aware. |

### Engineering considerations

Architectural boundaries determine whether a heavy workload can be cancelled, measured, moved, or scaled.

> **Design constraint**
>
> Portability is achieved by making ownership explicit, not by removing all abstractions.

### Implementation notes

| Engineering move      | Guidance                                                                     |
| --------------------- | ---------------------------------------------------------------------------- |
| **Map the lifecycle** | Trace a request from route discovery to response completion.                 |
| **Mark ownership**    | Separate framework lifecycle from application policy and provider mechanics. |
| **Propagate context** | Carry request ID, deadline, and AbortSignal into expensive work.             |
| **Test seams**        | Replace adapters in tests and exercise lifecycle failures directly.          |

### Decision lens

| Mode                                                                                          | Practical emphasis                                        |
| --------------------------------------------------------------------------------------------- | --------------------------------------------------------- |
| <Badge color="blue" size="sm" stroke icon="rectangle-code" iconType="regular" />**Framework** | Own contracts, lifecycle, and transport semantics.        |
| <Badge color="blue" size="sm" stroke icon="react" />**Application**                           | Own domain rules, authorization, and composition.         |
| <Badge color="yellow" size="sm" stroke icon="angle-90" />**Adapter**                          | Own provider protocol, credentials, and resource cleanup. |

## Related topics

<Columns cols={3}>
  * [route · **Trace route selection**](/jeston/jeston/core/routing) — Read the focused guide for this boundary.
  * [stream · **Trace execution**](/jeston/jeston/core/execution-and-streaming) — Read the focused guide for this boundary.
  * [puzzle-piece · **Design adapters**](/jeston/jeston/reference/adapters) — Read the focused guide for this boundary.
</Columns>

## References

[1]: https://github.com/jeffersoncampos12p-dev/jeston "Jeston source repository"

[2]: https://www.npmjs.com/package/@kvantjs/jeston "Jeston package on npm"

[3]: https://nodejs.org/api/http.html "Node.js HTTP API"

[4]: https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal "AbortSignal Web API"

[5]: https://react.dev/reference/react-dom/server "React server rendering APIs"

[6]: https://www.typescriptlang.org/docs/handbook/intro.html "TypeScript handbook"
