Webclient
The Webclient consists of the Shell and the client-side App runtime. The Shell owns the browser DOM, navigation, consent interfaces for grants, Dataset overview, notification inbox, and communication with client App Wasm. Apps declare their UI via components of the design system and the Shell validates and renders it. Client logic runs in dedicated Wasm workers, never as App-authored JavaScript on the browser’s main thread.
UI composition
Client App Wasm keeps its own UI state and sends validated diffs or patches to the Shell’s design-system component tree. The Shell delivers user interactions back to the App as named events. The Shell controls the theme and may expose a limited set of App styling tokens. Icons, titles, and other graphics come from package assets mediated by the Host and Shell. The available widget set can grow through Host and Shell updates. App-defined custom components are future work. See Design system for the composition model and its open details.
Browser isolation
Each App runs in a dedicated (Wasm) worker and communicates with the shell via events. It has no direct fetch, cookie, or web-storage access. The Shell’s long-lived session cookie is HttpOnly and never visible to App Wasm. A Host-mediated client cache may persist across worker restarts and is cleared when the App is uninstalled.
The client App talks only to the Shell through a per-install bridge, using browser messaging APIs such as postMessage or MessageChannel. Server App Wasm talks only to the Host. App communication therefore follows two hops: client App → Shell → Host → server App, with responses returning along the same path.
sequenceDiagram
participant CW as Client App Wasm
participant Shell
participant Host
participant SW as Server App Wasm
CW->>Shell: bridge only
Shell->>Host: WebSocket / HTTP
Host->>SW: events + Host APIs
SW-->>Host: results
Host-->>Shell: push / RPC replies
Shell-->>CW: demux by install id
Each browser tab uses one Shell-owned, bidirectional WebSocket to the Host. The Shell demultiplexes messages to App workers by install id. Apps never receive the socket or direct fetch access. HTTP handles large or binary uploads and serves as a fallback when WebSockets are unavailable. Idle connection teardown may be added later, but user-visible alerts still need a delivery path.
Events are delivered at least once with stable event ids. The Host retains events for a connected session until acknowledgment or equivalent confirmation, so Apps must handle duplicates safely. On disconnect, events may queue until reconnect or timeout. After timeout, the Shell must resynchronize or start a new session. Closing a tab drops its in-browser queue, while the server queue may wait until timeout. The Shell reports connectivity or delivery problems. Exact timeout values, acknowledgment behavior, and durable multi-tab queues remain to be defined.
Worker lifecycle
Apps must tolerate worker termination. If a visible App appears hung, the Shell asks the user what to do. A background worker may be stopped without a prompt. Apps with no open UI can still wake for events, subject to a hard resource cap. See Worker lifecycle for recovery behavior, kill policy, and the browser resource limits behind it.
Isolation decision
The design uses a single Host origin and bridge-only client Wasm rather than separate per-App hostnames. Research preferred per-App origins, as used by Sandstorm, for stronger origin isolation, but their DNS and TLS operational costs make it impractical for self-hosting as Nextcloud replacement. Same-origin iframes do not provide meaningful isolation; opaque-origin sandboxed iframes interfere with normal App persistence. iframe credentialless may be considered as an additional defense later.
Browser Wasm has no portable ambient Web APIs, but JavaScript glue or toolchain shims could expose fetch or POSIX-style networking. The Host and Shell therefore control Wasm instantiation and reject App-supplied ambient loaders. Future Wasm access to browser APIs remains a watch item. On a shared hostname, cross-App isolation depends on per-install bridge handles and Host-enforced Grants, not per-App DNS.
For the bridge and WIT contracts, see App Wasm interface. Further research: browser App isolation and client Wasm browser capabilities.
Transport research compared bridge messaging, HTTP RPC, long polling, SSE, WebSocket, and WebTransport. The decision is always bridge messaging between App and Shell, and one WebSocket per tab as the primary bidirectional Shell–Host channel, with HTTP for uploads and fallback. WebTransport is deferred. See the client–Host communication survey.