Architecture

This doc describes boundaries, data flow, and how components are wired.

High level

K-Web is a client-heavy app. The server’s default job is:

The UI is made of Web Components:

Event-first wiring

All cross-component communication happens via CustomEvents. See ./event-contracts.md.

Rules:

App shell responsibilities

<kweb-app> owns:

State model

We separate three related states:

A practical approach:

Data adapters

The internal format is defined in ./data-model.md.

Adapters are optional modules that translate external sources into the internal format:

Adapters must not leak into core component logic. Core components only know the internal format.

Server notes

Node server can be Express initially.

Minimum server endpoints (optional for v1 if local-only):

A v1 alternative is local-only storage (IndexedDB / local file export) and the server only serves the app.

Security and trust boundaries

Definition of done (architecture)