Guides
These pages cover what works in TopGun today. The roadmap is the canonical source for what’s planned (custom conflict resolvers, entry processors, RBAC, cluster mTLS).
Building with TopGun
Offline-first apps
Make reads instant and writes survive a flight without network — the default behaviour, made explicit.
Read GuideReal-time collaboration
Two users editing the same record at the same time, conflict-free, with the React hooks.
Read GuideLive notifications (pub/sub topics)
Fire-and-forget topic messages for chat, presence, and ephemeral signals.
Read GuideSchema-typed data
Define maps with Zod, get end-to-end TypeScript inference on reads, writes, and queries.
Read GuideSearch & live queries
BM25 full-text search, filtered + sorted queries, and how live subscriptions keep results fresh.
Read GuideCounters & locks
PN-Counter for distributed counts and single-node distributed locks with TTL-based expiry.
Read GuideAuth, security, AI
Authentication & security
Clerk, Better Auth, Firebase, or custom JWT — wiring auth providers and validating tokens server-side.
Read GuideSecurity
TLS termination at the proxy, client-side encrypted storage, and credential hygiene.
Read GuideMCP server
Connect Claude Desktop, Cursor, or any MCP client to a running TopGun database.
Read GuideBuilding with AI coding agents
Prompt patterns, AGENTS.md / CLAUDE.md guidance, and the hook-first canonical app shape.
Read GuideMigration
Migrating from Firebase
Realtime Database / Firestore → TopGun. Maps, queries, presence, offline.
Read GuideMigrating from Supabase Realtime
Channels → topics, postgres_changes → queries, RLS context.
Read GuideMigrating from Replicache
Mutators → CRDT writes, pull/push → built-in delta sync.
Read GuideMigrating from Y.js
Document-level merges via HLC LWW, with a note on where character-level OT differs.
Read GuideOperations
Deploy
Self-host with Docker, Kubernetes, or a bare binary. Backends (redb default, Postgres optional).
Read GuidePerformance tuning
RAM ceilings, eviction water marks, write-behind cadence, and how to read the perf-gate output.
Read GuideTroubleshooting
Common errors — auth, IndexedDB, WebSocket, sync state — and how to diagnose them.
Read Guide