Technology stack
The technologies and responsibilities behind each layer.
Native UI: NSGo
NSGo maps Go-written desktop and mobile interfaces to native platform views. Device navigation, virtual session lists, Markdown and image previews use native UI without bundling a browser runtime. Package size and memory measurements.
Application core and providers: Go
The Go core shares device management, pairing, encryption, networking and synchronization. Providers encapsulate agent discovery, launch and native protocols behind shared capabilities. Applications call the Go core directly.
Networking: WebRTC, TCP and WebSocket
Native WebRTC uses Pion; browsers use RTCPeerConnection and DataChannel. Native clients also provide TCP candidate discovery and hole punching. Public STUN and self-hosted probes discover address mappings in parallel.
WebSockets carry signaling and, when needed, end-to-end encrypted relay traffic. Users configure one service root URL; the service publishes probe endpoints and connection capabilities.
Web: Next.js, React and OpenNext
The website, docs and /chat share Next.js App Router. React provides responsive layouts, virtual messages and incremental synchronization. Browsers use WebRTC and Web Crypto directly.
OpenNext adapts the build to Cloudflare Workers. Fumadocs generates multilingual documentation, navigation, search and tables of contents from repository Markdown/MDX.
Local data: SQLite and IndexedDB
Native apps store settings and session caches in SQLite and attachments in local files. Browsers store pairing identity, session snapshots and attachment caches in IndexedDB. Reconnection fetches the latest state before resuming incremental subscriptions.
Cloud: Workers, Durable Objects and D1
Workers handle HTTP requests and connection endpoints. Durable Objects coordinate device rooms and hibernating WebSockets. D1 persists device identities, pairing relationships and service metadata. The cloud does not persist plaintext chats or attachments.
Development and extensions
Dependency versions are recorded in go.mod, clients/nsgo/go.mod, package.json and pnpm-lock.yaml. See Local development for setup and checks, or Add a provider to integrate agents.