Files
Piik/docs/project-memory.md
T
AAA f92162b3bb feat: launch Piik with a unified interface and public website
Piik now has one public presentation and a coordinated App/Server release path. This phase unifies the room UI, rewrites the bilingual README and guides, adds a static website with an inline product film, and prepares matching GitHub/Gitee packages and update links.

The film uses the current homepage and shared product controls on one seekable timeline. Runtime fixes preserve presentation when the App opens a room, normalize Site origins, and keep capture and media-recovery status in the television indicator. New visits use Chinese for a Chinese system language and English otherwise; explicit language and visual-mode choices remain available. An optional site passphrase controls site entry, while room authorization remains enforced.

GitHub is the release authority. Gitee mirrors verified packages and provides update metadata when GitHub is unavailable. Reviewed PR release notes become the GitHub Release description. The separate public demo uses P2P only, with HTTPS and STUN verified.

Validation: 756 Web tests, TypeScript and production build; Go core tests, formatting, vet and available target builds; bounded Windows capture and App/Site interoperability; browser film checks, audible playback and narrow layouts; anonymous Gitee Windows-package download, checksum and launcher/update-link checks. Public demo acceptance covers authenticated WebSocket signaling, synthetic P2P video and room cleanup on one network. macOS/Linux physical capture and the wider device/network/endurance matrix remain explicitly deferred.

Publication builds every package from the merged source SHA. The repository is public, main protection is active, and Pages is configured for piik.tv. CI/publisher and Pages deployment records own publication results.

## Release notes

### 中文

Piik 是免费开源的屏幕共享工具。开个房间,发出邀请,最多 20 位朋友就能用浏览器加入观看。

- 使用浏览器或 Piik App 分享游戏、窗口和整个屏幕。
- 优先建立直连;自托管站点可开启媒体转发作为备用线路。
- Piik App 支持本地房间、临时公网邀请和已有站点。
- Piik Server 内置网页界面、房间管理和连接服务,方便自行部署。
- 提供中英文界面与使用指南,以及 GitHub、Gitee 两条下载线路。

[官网](https://piik.tv) · [在线体验](https://demo.piik.tv) · [使用指南](https://github.com/TNTcraftHIM/Piik/blob/main/docs/guide/getting-started.zh-CN.md) · [自行部署](https://github.com/TNTcraftHIM/Piik/blob/main/docs/operations/self-hosting.zh-CN.md) · [Gitee 下载](https://gitee.com/TNTcraftHIM/Piik/releases)

Windows App 和桌面浏览器是本次主要验证的平台。macOS 和 Linux 尚未经过实机测试,欢迎有设备的朋友测试并反馈。演示站和 App 公网邀请使用 P2P,受限网络下可能无法连接;自托管站点可开启媒体转发。

### English

Piik is free, open-source screen sharing for you and up to 20 viewers. Start a room, send an invitation, and your friends can join in a browser.

- Share games, windows or a whole screen from your browser or Piik App.
- Direct connections come first, with optional media forwarding on self-hosted sites.
- Piik App supports local rooms, temporary public invitations and existing sites.
- Piik Server includes the web interface, rooms and connection services for self-hosting.
- English and Chinese interfaces and guides are available, with GitHub and Gitee downloads.

[Website](https://piik.tv) · [Online demo](https://demo.piik.tv) · [User guide](https://github.com/TNTcraftHIM/Piik/blob/main/docs/guide/getting-started.md) · [Self-hosting](https://github.com/TNTcraftHIM/Piik/blob/main/docs/operations/self-hosting.md) · [Gitee downloads](https://gitee.com/TNTcraftHIM/Piik/releases)

Windows App and desktop browsers are the primary validated paths. macOS and Linux have not yet been tested on physical devices; testing and feedback are welcome. The demo and App public invitations rely on P2P and may not connect on restrictive networks. Self-hosted sites can enable media forwarding.
2026-09-12 22:09:12 +08:00

6.9 KiB

Project Memory

Last updated: 2026-09-11

Piik is private, low-latency screen sharing for one Host and up to 20 authenticated friends. The current product surface is Web Host, Web Viewer, and Browser relay; desktop and mobile Browsers are Viewer targets. It is not a public broadcast service. Hosted and App run one shared Go core (ADR-0012); Node and Vite build the Browser UI and are not a runtime. Source includes a cross-platform App that runs that same core in a self-contained Local deployment or opens one configured Site through the system Browser. Its single Go process presents Local, temporary public-link, and saved-Site choices on every launch, starts one process-level loopback capability service, owns the Local room authority in-process when selected, and owns the explicit native media path chosen in the same Web UI. Room source and media implementation are independent: a topology may mix Browser and Native peers without changing participant, signaling, capacity, or route identity. Local is LAN-first; explicit one-link mode exposes that same authority through a temporary public control tunnel while media remains P2P. Host authority belongs to a tab, with one separate persistent origin resume hint. The App admits two independent native control sessions under its one loopback service.

The current source embeds Binding-only STUN and optional SFU forwarding in the Hosted Go process. Native and SFU use one shared Pion/LiveKit media adapter; Native parents reuse suitable encoded outputs and derive a missing lower output only for direct-child demand. Source-owned groups retain the highest needed output and lower fallbacks, while each child receives its selected output. Native Host SFU publication reuses the encoded source directly; its loopback Browser edge owns preview only. Eligible Browser capture and relay now share independent local WebRTC producers for compatible direct children under ADR-0014; unsupported APIs and failed pooling retain ordinary senders. Windows, macOS and Linux producers share one encoded-frame boundary and Host quality controls. Source replacement retains route and connection identity; lower-output adaptation preserves the original and higher sibling outputs. Status owns the remaining physical and release acceptance boundary; runtime release descriptors own deployed identity. The Local launcher keeps an optional user-chosen site-access password; leaving it blank keeps the self-contained site open.

Product Map

  • Rooms and access owns room codes, invitations, code entry, credentials, and lightweight/SQLite persistence.
  • Routing and transport owns P2P-first distribution, endpoint capacity, SFU fallback, recovery, and privacy limits.
  • Capture and media quality owns Browser capture, profiles, codec selection, audio, and framework adaptation.
  • Presentation and lifecycle owns Host and Viewer workflows, playback authority, roster, state, and Browser lifecycle.

Non-obvious decisions live in ADRs; reproducible evidence and platform limits live in research. Source code and tests own self-evident implementation and routine UI detail.

Core Invariants

  • Rooms use random four-digit codes, exact Host ownership, room-scoped Viewer invitations and independent open | private code entry. Room authority ends through explicit replacement/deletion, with separate invitation rotation or revocation. Hosted defaults to SQLite, with explicit process-memory opt-out; App Local remains process-only. Site access has a separate 24-hour idle cookie lifetime. Production persists SQLite room authority; live participants, routes, and media remain process-only.
  • Media is automatic and distributed. Ordinary peers are STUN-only and prefer direct/peer UDP. A deployment may enable same-host auxiliary STUN for bounded, room-wide, connection-local NAT prediction; its Host switch defaults on when available, and anonymous provenance distinguishes ordinary from predicted selected paths. The configuration default remains stock ICE. The only application fallback is one bounded embedded SFU/UDP publication; Piik configures no TURN or TCP media route. A pre-share peer-only policy can exclude that SFU suffix for one share generation.
  • Every endpoint shares one steady outbound-copy cap, default 2 and limited to 1..3. One room controller owns one committed graph, one reconcile loop, and one serial child operation. First decoded frame commits availability work; accepted quality work adds native edge proof before commit in that operation.
  • Browser WebRTC and the shared Pion/LiveKit media adapter own congestion control, media adaptation, pacing and layer selection. Parent demand is local to direct children and never a room-wide minimum or topology rebalance. Current source defaults persistent native-edge local P2P convergence on, with a pre-share Host opt-out. SFU quality work is limited to multi-root Host fanout relief and each Viewer must prove its own candidate non-regression before commit. A persistently limited edge with no different Peer parent may use one same-parent connection regeneration through that same operation; its exact post-commit sender identity damps only another same-edge regeneration. No weighted score, all-pairs probe, general parent-wide prediction, or periodic rebalance is accepted.
  • Browser video uses motion; each share chooses H.264 with VP8 fallback through an actual sender probe unless the Host explicitly selects VP8 or H264. Screen audio uses 64/128/192 kbps ceilings with 128 default.
  • Viewer playback uses one native video element. Presentation and recovery are fenced by current route/media identity and current-frame proof; hidden-page time alone is not media-failure evidence or a keepalive guarantee.

Current Snapshot

The current contract tuple is owned by status. Embedded SFU SDP/ICE and demand travel over the authenticated room WebSocket, without an external room service or media token. Committed first-frame readiness, bounded candidate-relative progress, durable room authority and the H.264/VP8 sender gate remain. Status indexes source and deployment evidence; protocol rollback requires matching Browser and App artifacts, not only an application symlink.

Current work is owned by the TODO ledger. Open physical evidence is owned by verification status. Environment and initial services are owned by configuration and self-hosting; application release is owned by deployment, with exact deployed identity retained in the release descriptor and deployment record. Git history and pull requests own completed timelines.