Build your own apps. Anytime. Anywhere. Describe an app, import your files, and get an installable offline PWA — generated by an LLM, served from IndexedDB by a service worker so Chrome can install it.
Most “AI app builders” need a backend and a deploy step. PocketForge’s trick is that the service worker is the server: generated apps live in IndexedDB and are served at same-origin URLs the browser treats as installable PWAs.
Layout: index.html (landing), app/ (the builder PWA), sw.js and pf-shared.js (service worker + shared IndexedDB and storage helpers, loaded by both the window and the worker via importScripts).
pf-shared.js exposes the IndexedDB wrapper (all/get/put/del), served-HTML builder, manifest builder and storage shim to both contexts.
The API key is pasted into Settings and kept in the browser’s localStorage; requests carry it as X-API-Key. The Render instance may need up to a minute to wake.
The builder shell is cached (pocketforge-v1); generated apps work offline once installed.
Click a step.
A strict system prompt asks for one self-contained index.html: no CDNs, fonts, remote images or network requests; vanilla JS; phone-first; state in localStorage; source files embedded as initial data — never inventing facts not in the material.
If the model stops for length, the client re-sends the transcript and asks it to continue — up to four passes — and stitches the output. extractHtml trims to a valid document and repairs a missing close tag.
The generated HTML is shown in an iframe with a restrictive sandbox (allow-scripts allow-forms allow-modals allow-popups allow-downloads), using srcdoc; inside it storage falls back to memory.
Follow-up requests go through the same llm() path with the conversation history, producing a revised document that replaces the stored project.
Install opens /p/<id>/, served by the service worker from IndexedDB with a generated manifest and canvas-drawn icons; a floating “Install app” button handles beforeinstallprompt. Or export a host-anywhere .zip.
All generated apps share the PocketForge origin. Each gets a localStorage namespace (pf:<id>:) by redefining window.localStorage, and falls back to in-memory storage inside the sandboxed preview.
| Property | Status |
|---|---|
| Per-app localStorage keys | namespaced |
| Hard isolation between apps | no — same origin; fine for a PoC |
| Preview sandbox | iframe sandbox + srcdoc |
| Before shipping | use a separate origin per app |