Yap technical documentation
The code-shaped half of Yap: the process layout, the clients, voice, what the server does internally, how memory is measured, and where the project is going. The wire contract, the encryption construction and the deployment steps have their own pages, so each one is a single thing you can read, link and search for.
1. Process shape
Client (single native process) Server (single Rust binary)
UI: Slint, software renderer axum REST: history, uploads, export, delete
virtualized ListView, models capped WS gateway: Protobuf frames, reconnect refetch
yap-core (Rust) TLS auth: argon2id, opaque tokens, refresh rotation
WS client, Protobuf, store <------> perms: u64 bitfield, roles + channel overrides
OpenMLS, SQLCipher cache, FTS5 MLS delivery service (ciphertext only)
image decode in Rust, LRU-capped FTS5 search (public channels only)
voice: str0m + Opus + cpal <--UDP--> link-preview proxy (SSRF-hardened)
SFU: str0m, one UDP port, Opus only
sqlx: SQLite default, Postgres feature
No webview, no JavaScript runtime, no remote code in the desktop client. All decoding (images, markdown) happens in Rust.
The official deployment is a different shape: a Cloudflare Worker (server/worker) speaks the same REST and gateway protocol over a SQLite-backed Durable Object, so there is no origin machine to break into. Both backends implement protocol v1; a change lands in both, plus docs/protocol.md.
2. Clients
| Client | How it runs | What it does |
|---|---|---|
Desktop (client/desktop) | Native Slint app with a software renderer, one process, ~25 MB idle | The full client: chat, voice, encrypted spaces and DMs, roles, uploads |
Browser (server/panel, at app.getyap.dev) | Worker-served page; the token pair is sealed in an HttpOnly yap_app cookie, so the page never holds a token | Sign in, read, send, join voice. Chat arrives by polling GET /channels/{id}/messages?after= every 2.5 s; voice needs the gateway, bridged at /gateway and authenticated by the sealed cookie. Encrypted spaces and DMs are listed but not opened |
Developer portal (developer.getyap.dev) | Same Worker as the browser client, on its own host | Sign-up, sign-in, bot applications with avatar, banner and bio, API keys with usage |
The two hosts are custom domains on one Worker (server/panel/wrangler.toml): developer.getyap.dev and app.getyap.dev, each mounted at its own root. The static site is untouched, and the browser never needs CORS against the API because the Worker makes those calls itself.
Python bot library
The yapbot wrapper, prefix and slash commands, gateway events and its REST helpers now live on Write a bot in Python. It is published on PyPI (pip install yapbot, 0.1.1), and every class, decorator, event and REST method is documented in the yapbot API reference.
Protocol v1, auth and limits
The REST and gateway contract, login keys, rotating tokens and the sign-up cap moved to Protocol v1, auth and the limits.
Encryption (E2EE v1)
The envelope, the keys, what the server still sees and the accepted gaps are on Encryption: how it works and where it stops.
3. Voice
WebRTC mesh through str0m, Opus, capped at 8 people per channel. The clients carry and mix the audio; the server relays setup and the roster, never audio. The desktop and browser both support it. The Windows desktop can share a display or window: frames travel over a WebRTC data channel on the same peer connections, so the server never sees them. Calls that cross the internet need a relay: the official server mints Cloudflare TURN credentials from TURN_KEY_ID and TURN_KEY_API_TOKEN, and without those set a VoiceJoin is refused with FORBIDDEN. Self-hosted servers can run the embedded SFU instead: str0m, one UDP port, Opus only.
4. Server internals
axumREST plus the protobuf gateway; permissions as au64bitfield with roles plus category and channel overrides.sqlxwith SQLite by default and a Postgres feature. Self-hosted data is one SQLite file.- Full-text search with FTS5, public channels only; nothing in an encrypted space is indexed by the server.
- Link previews are fetched by the server through an SSRF-hardened proxy, never by the client, and never in encrypted channels.
- Uploads count against a per-account budget; avatars and banners are served from
/users/{id}/avatar. - TLS here, users' content not less visible: see what the server can see for the honest summary.
Hosting and self-hosting
The three deployments, the Docker commands and flags, and the checks behind the verified list are on Hosting, self-hosting and the verified list.
5. Memory measurements
Windows 11, release builds, summed RSS across every process the app starts. client/tools/rss-probe measures it; CI fails the build above 300 MB.
| Client | Processes | Summed RSS | Private |
|---|---|---|---|
| Tauri 2 + Svelte, empty shell, defaults | 7 | 352 MB | 144 MB |
| same, GPU + network in browser process | 5 | 280 MB | 122 MB |
| same, software GPU in-process | 5 | 272 MB | 81 MB |
same, --single-process (unsandboxed) | 3 | 210 MB | 58 MB |
| Slint, FemtoVG (OpenGL) | 1 | 86-121 MB | ~100 MB |
| Slint, software renderer | 1 | 25-32 MB | 7-11 MB |
Milestone 1, same machine: idle at the login screen 25.3 MB summed RSS (6.8 MB private); signed in with 5 channels × 200 messages loaded, 30.1 MB (10.0 MB private). Reproduce with client/tools/bench.ps1, which refuses to report unless 1,000 messages actually loaded. spikes/tauri-shell reproduces the webview rows.
6. Roadmap detail
| Item | State | What it means technically |
|---|---|---|
| Windows alpha build | done | Manual download, unsigned; 25–30 MB enforced in CI |
| Accounts, spaces, channels, invites | done | Live chat over the protobuf gateway; custom invite names never expire |
| Encrypted spaces | done, v1 | yap1: envelopes sealed on the client, no forward secrecy or signatures |
| Roles and permissions | done | Roles plus category and channel overrides on a u64 bitfield |
| Voice channels | done, beta | WebRTC mesh, 8 per channel, TURN needed off-LAN |
| Screen sharing | done, desktop | Display or window into a call over a peer-to-peer WebRTC data channel; no server media, no system audio, Windows capture only |
| Browser client | done | app.getyap.dev, polled chat, gateway bridged through the Worker |
| Encrypted DMs | done | E2EE v1 on every new DM, plus a ChaCha20/HMAC local history cache keyed from the identity |
| Files and link previews | done | Files up to 10 MiB in plaintext channels; previews fetched by an SSRF-hardened server, never in encrypted channels |
| Signed updates | done | Ed25519-signed manifest, verified download, applied at the next launch; unsigned installers still say so |
| Passkeys | post-MVP | Native platform APIs |
7. Repository layout
/server yap-server (axum + SQLite), yap-proto (protobuf schema), yap-sfu, worker (Cloudflare), panel (portal + browser client)
/client desktop (Slint), tools/rss-probe
/docs protocol.md, ARCHITECTURE.md, E2EE.md, DESKTOP-WIRING.md
/deploy Dockerfile, docker-compose.yml, Caddyfile
/site the product site (separate repository: foreski/yap-site)
/spikes tauri-shell (measurement reference, not built by default)
Read more: ARCHITECTURE.md, protocol.md, E2EE.md.
8. Licence
Not an open-source project. The server (server/) is AGPL-3.0-only. The desktop client, the Cloudflare Workers and the hosted service are proprietary. API documentation is open-sourced with the first stable release.
Updated . The protocol, encryption, self-hosting and bot sections moved to their own pages above; each of them carries the same date.