react-brain
Browse decisions
React & language foundations 3App architecture 9UI 12Platform & native 9Build, test, observe, secure 6AI in React apps 3stack composerdecision recordscensusstaleness bencharchitecturechangelogmethodologyroadmap

entriesapp-architecture · verified 2026-06-25 · react + react-native

Peer-to-peer / local-first backend (Holepunch · Pear)

draftedconfidence: mediumthis tier holds 50% on the public scorecard (3/19 graded · 0 overturned) →

related decisions: data

cited by: data · networking · desktop · storage · build · testing

re-verified 2× — 2026-07-13 · 2026-07-06 · changelog

recommendation

Holepunch is a SERVERLESS, local-first alternative to the client-server + REST/GraphQL model: data is a local append-only log (Hypercore), merged across writers with Autobase, indexed in Hyperbee, synced peer-to-peer over Hyperswarm, and shipped by Pear. Choose it when serverless / offline-first / private / censorship-resistant matters; choose conventional client-server (RB-E-DATA + a hosted DB) when you want central control, SQL, and a familiar ops story.

  • offline-first / local-first / no-backend-ops / private / P2P → Holepunch (Hypercore + Autobase + Hyperbee + Hyperswarm)
  • multi-writer shared/collaborative state → Autobase over per-writer Hypercores
  • conventional CRUD with a central server/team → REST/GraphQL + TanStack Query (RB-E-DATA), not this
  • ANY Holepunch depth (replication, identity, schema, sessions, blind-pairing, Pear/Bare workflow) → holepunch-p2p-systems skill

Options & tradeoffs

the field considered — and why each one isn’t the default here

optiontradeoffevidence
Hypercoresigned append-only log; the primitive everything builds on
Autobasemultiwriter — linearize many writers' Hypercores into one shared view (collaboration)10k/wk
Hyperbeeordered key-value / B-tree over a Hypercore; the queryable index/view layer
Corestoremanages many Hypercores (naming, lifecycle)17k/wk
Hyperswarm / HyperDHTpeer discovery + encrypted connections over a DHT — no servers
Hyperdrive / HyperblobsP2P filesystem / blob store
hrpc + Hyperschematyped RPC + binary schema between the app (UI thread) and a local Bare worker2k/wk
Pear / BarePear = the P2P runtime + content-addressed distribution (desktop & mobile); Bare = the lightweight JS runtime for mobile workers (bare-kit)

evidence: npm weekly downloads (signals snapshot) · “ships in n/D” = adoption across the production-app census, honest denominators

npm weekly downloads (from the corpus's last signals run): autobase 10k · corestore 17k · hrpc 2k

Verified notes

The heartit ecosystem's backbone: ledgerhr (Pear desktop), ourpot + bitbarter (Pear mobile via bare-kit) all run on Holepunch — so for these apps a conventional data-cache (TanStack Query), hosted DB, REST API, and central server are N/A by design; the "data layer" is the Hypercore/ Autobase/Hyperbee stack queried locally via hrpc, and brittle (testing) + esbuild/bare-pack (build) follow the Holepunch ecosystem, not the mainstream-React defaults. This entry exists so the encyclopedia stops treating that stack as a deviation. Added 2026-06-25 after the evidence-loop corpus self-audit found all three heartit apps on Holepunch with no entry to map it to. DEPTH (correctness, replication, identity, sessions, Pear/Bare workflow) is owned by the holepunch-p2p-systems skill.

Canonical reading

Editorial annotations on why each piece matters — the articles themselves are the originals; read them there.

Pear by Holepunch — building blocks & architecture (docs)Holepunch (Pear docs)

The canonical reference for the Holepunch stack — Hypercore (append-only log), Autobase (multiwriter), Hyperbee (B-tree index), Hyperswarm/HyperDHT (discovery), Hyperdrive (files), Corestore, and the Pear runtime. The 'why' behind P2P/local-first; pair with the holepunch-p2p-systems skill for build/review depth.

Depth (in-domain rules) is owned by the holepunch-p2p-systems skill — this entry is selection breadth.

Related in app-architecture: state · data · nav · meta-frameworks · forms · networking · crossplatform · desktop