Holi Labs
2 min Local-first

Build a browser workspace that never traps the user

A practical architecture for working with a chosen folder or a browser-owned fallback without changing the editor flow.

#local-first #files #indexeddb
Contents
Start with one workspace contract Adapter A: a folder chosen by the user Adapter B: a browser-owned workspace Switch without losing work Add a recovery path Privacy check Shipping checklist

A local-first editor should not make people understand browser storage before they can create something. The product flow can stay the same whether the files live in a folder selected by the user or in storage managed by the browser.

Start with one workspace contract

Give the editor a small interface instead of direct access to either storage API:

interface Workspace {
  list(path: string): Promise<Entry[]>;
  read(path: string): Promise<Uint8Array>;
  write(path: string, data: Uint8Array): Promise<void>;
  remove(path: string): Promise<void>;
}

The UI can now open, save, rename, and preview files without knowing which adapter is active.

Adapter A: a folder chosen by the user

Use the File System Access API when it is available and the person chooses a folder. Keep the directory handle locally, but request permission again when the browser requires it. A saved handle is not permission to read forever.

Important rules:

  • Opening a folder must be a deliberate gesture.
  • Do not scan outside the selected directory.
  • Show the active folder name and permission state.
  • If permission is lost, keep the document in memory and offer a recovery export.

Adapter B: a browser-owned workspace

When there is no active folder, create the same project tree in IndexedDB or OPFS. This is the default workspace—not an error state. It should support the same commands as the folder adapter.

A useful initial tree might be:

workspace/
  projects/
    welcome/
      main.typ
      images/
        sample.svg
  shared/
  exports/

Switch without losing work

Changing adapters is a migration, not a preference toggle. Copy into the destination, verify every file, and only then mark the new workspace active. Never delete the source automatically.

Add a recovery path

Browser storage can be cleared by the browser or the user. A resilient product therefore needs:

  1. A visible workspace status.
  2. Export of a project or the full workspace.
  3. Import that validates paths before writing.
  4. A warning before large or irreversible changes.

Privacy check

Neither adapter needs a server. The selected folder path, filenames, handles, and document bytes should remain on the device. Serving the web application still exposes connection metadata such as IP address and request timing to the hosting provider, but not the local workspace content unless a separate connected feature explicitly sends it.

Shipping checklist

  • The editor works before an account or folder exists.
  • Folder permission has a clear requested, granted, and lost state.
  • Both adapters pass the same behavior tests.
  • The user can export before clearing or migrating storage.
  • Network inspection shows no document or filename upload during local editing.
Next Design a QR code that still scans

Local preferences

Configuration

These preferences stay in this browser and do not require an account.

Appearance

Theme Applies on this device

Navigation

Home Holi.tools Papers
Session No account · local preference

Current v0.6.0

Versions

Keep Holi available

Support independent tools

Donations help cover hosting and development without making accounts or remote storage mandatory.

Contact
v0.6.0 2026-09-02
  • Defined Tutorials, Field notes, Experiments, and Papers as formats in one Holi Labs publication
  • Added a localized Papers collection with a subtle crane category mark across all seven languages
  • Added format filters and the axolotl identity while preserving one shared library and privacy shell
v0.5.0 2026-09-02
  • Extended the Labs library shell, privacy summary, search, filters, and article routes to all seven Holi languages
  • Localized the shared product dock and removed its unstable outer glow
  • Kept code blocks, URLs, file paths, and technical product names intact across translated tutorials
v0.4.0 2026-09-02
  • Rebuilt Labs as a practical library with featured reading, search, category filters, and reading time
  • Published seven complete English and Spanish tutorials, guides, and engineering notes
  • Added coherent light and dark Labs palettes and limited public routes to fully translated locales
v0.3.0 2026-09-02
  • Unified Configuration, Versions, and Privacy in the shared Holi product dock
  • Added local theme and language preferences plus Labs navigation inside Configuration
  • Placed donations, support, and the visible Shadow Log inside Versions
v0.2.1 2026-09-02
  • Separated privacy and Version Log into left and right floating controls
  • Moved privacy facts into a dedicated glass drawer
v0.2.0 2026-09-02
  • Added a visible privacy summary to experiment, article, and tag pages
  • Made the current version and Shadow Log available throughout Labs
  • Reframed Labs as a research publication rather than a product backlog
v0.1.1 2026-01-12
  • Added English and Spanish routes
  • Synchronized the content collection
  • Improved stability
v0.1.0 2026-01-12
  • Created the first Labs content collection
  • Published initial graphics and performance notes

Privacy at a glance

Privacy summary

Reading and exporting articles does not give personal files to Holi. Cloudflare can observe your IP and access time.

Content
Labs publishes static articles and does not request your local documents.
Export
Copying summaries and generating Markdown or print output happens in your browser.
Hosting
Cloudflare may process IP, time, requested path, traffic volume, and routing data.
External links
Donation, support, and external sources open only when you choose them.

About

Holi Labs

Tutorials, field notes, and technical guides for building useful local-first web tools.

Explore Holi.tools

Donate

Donate

If Holi.tools helps you, you can support its continued development here:

GitHub Sponsors Ko-fi

Support & suggestions

Support & suggestions

For support, bug reports, or suggestions:

Email [email protected] GitHub Issues

Source code: https://github.com/HugoAndresAmayaChairez/holi.tools