iToverDose/Software· 14 JUNE 2026 · 20:05

Build an offline wiki in a 19 KB single-file HTML reader

Discover how a developer created a lightweight offline wiki that loads instantly in any browser without installation or internet. Just 19 KB makes knowledge sharing via USB, Bluetooth, or AirDrop effortless.

DEV Community3 min read0 Comments

For years, finding a truly portable offline knowledge tool proved frustrating. Existing solutions like Kiwix required downloading multi-gigabyte archives, while IPFS demanded network setup and connectivity. What users actually needed was something radically simple: a self-contained knowledge file that opens instantly on any device, requires no installation, and can be shared through basic channels like Bluetooth or a USB stick.

That gap inspired the creation of Portable Knowledge Mesh, a breakthrough offline wiki system that fits entirely within a single 19 KB HTML file. This elegant solution transforms any smartphone or laptop into a fully functional offline encyclopedia with zero technical barriers.

A knowledge tool designed for real-world sharing

The core innovation lies in its file-based architecture. Unlike conventional web applications, Portable Knowledge Mesh operates directly from a local file path without requiring secure contexts or internet connectivity. The system opens by simply double-clicking reader.html, even when launched from a USB drive, email attachment, or file transfer.

Key design choices enable this remarkable portability:

  • No installation required — works in any browser, from ancient mobile devices to modern laptops
  • No internet dependency — functions completely offline without backend services or API keys
  • Immediate usability — launches within milliseconds of opening the file
  • Universal sharing — transfers knowledge through standard methods: Bluetooth, USB, AirDrop, QR codes, or email attachments

The entire system, including the reader and a 21-article survival knowledge pack, consumes less than 50 KB total space — smaller than many individual images on modern websites.

Cryptographic protection for trustworthy knowledge

When knowledge spreads device-to-device without central servers, authenticity becomes critical. Portable Knowledge Mesh incorporates robust cryptographic verification to prevent tampering and ensure content integrity.

Each knowledge pack contains:

  • Individual article blocks hashed with SHA-256
  • A Merkle tree structure that aggregates all block hashes
  • A publisher signature using ECDSA P-256 cryptography (via WebCrypto API)

The verification process happens entirely in the browser:

async function verifyPack(mesh) {
  const m = mesh.manifest;
  const per = {};
  for (const [id, md] of Object.entries(mesh.content.blocks)) {
    per[id] = await sha256Hex(md);
  }
  const root = await sha256Hex(
    Object.keys(per).sort().map(id => per[id]).join('')
  );
  if (root !== m.merkle_root) return 'tampered';

  const key = await crypto.subtle.importKey(
    'jwk', 
    m.publisher.pubkey_jwk, 
    { name: 'ECDSA', namedCurve: 'P-256' }, 
    true, 
    ['verify']
  );

  const ok = await crypto.subtle.verify(
    { name: 'ECDSA', hash: 'SHA-256' },
    key,
    b64ToBytes(m.signature_b64),
    new TextEncoder().encode(m.merkle_root)
  );

  return ok ? 'verified' : 'tampered';
}

This approach defends against two attack vectors: modifying article content breaks hash consistency, while altering the manifest fails signature validation without the private key. The system automatically rejects any forged or corrupted packs.

Engineering challenges behind the elegant solution

Building a truly portable offline system required overcoming several technical hurdles:

File protocol limitations: Standard web technologies like Service Workers and IndexedDB fail in file:// contexts. The solution uses in-memory storage with sessionStorage fallback, keeping dependencies minimal while ensuring cross-browser compatibility.

Offline editing complexities: Early plans to implement CRDTs (Conflict-free Replicated Data Types) for collaborative editing hit a critical limitation — tombstone accumulation in sequence CRDTs causes unbounded growth, eventually exceeding browser storage quotas. This became especially problematic in offline environments where devices might not reconnect for months.

The team pivoted to a more efficient approach:

  • LWW-Map per article block maintains only current values, eliminating historical baggage
  • Lamport clocks replace unreliable system clocks by using logical timestamps for conflict resolution
  • Trusted snapshots allow trusted editors to publish compressed baselines that peers can adopt without storing entire edit histories

Future directions for community-driven knowledge

The current v0.1 release delivers a robust read-only offline wiki experience. Development continues with ambitious plans for v0.2 and beyond:

  • Editable overlays enabling local communities to modify and adapt knowledge
  • Web of trust for validating trusted editors within decentralized networks
  • Lamport-based synchronization for offline collaboration
  • PWA installation for improved user experience
  • WebRTC LAN synchronization for local network knowledge sharing

The project ships with "Barefoot Skills," a curated 21-article survival knowledge pack covering essential topics from first aid to knot-tying. This demonstrates the system's practical utility while providing an immediately useful resource.

Portable Knowledge Mesh proves that complex problems sometimes require elegantly simple solutions. By prioritizing real-world sharing scenarios over technical complexity, this 19 KB wonder file delivers a powerful knowledge-sharing tool that works everywhere, requires nothing to use, and can spread like digital information naturally should — hand to hand, device to device, without intermediaries.

AI summary

İnternet bağlantısı gerektirmeyen, sadece 19 KB boyutunda bir HTML dosyasıyla çalışan taşınabilir wiki aracı hakkında detaylı rehber. Kurulum gerektirmeyen ve Bluetooth/USB ile paylaşılabilen bu çözümle bilgiye her yerde ulaşın.

Comments

00
LEAVE A COMMENT
ID #NYLG57

0 / 1200 CHARACTERS

Human check

6 + 7 = ?

Will appear after editor review

Moderation · Spam protection active

No approved comments yet. Be first.