PWA Architecture — Member Pages to App

Drafted 06 October 2026 (Tuesday, UTC). The structural surface for converting the per-member landing page (and the broader ORB member-side surface) into a Progressive Web App. The on-the-cheap path: same HTML/CSS/JS, plus a manifest.json and a service worker. The user installs the page as an app on their phone; the page opens full-screen; works offline; loads fast.

Same page. Real app.
Web push. Home-screen icon. Offline support.
The on-the-cheap path: PWA.
What this page is. The architecture for the per-member-page-to-PWA conversion. The page names the manifest.json shape, the service worker pattern, the installation flow, the connection to the per-member landing page, the operator-side wiring, the offline-support piece, the push-notification piece, and the comparison to native app conversion. The agent builds the structural surface; the operator wires the deployment.

1. Why PWA is the on-the-cheap path

PWA (Progressive Web App) is the on-the-cheap option for converting web pages into installable apps. Honest comparison:

OptionCostTime to deployUser installApp Store presence
PWALow (same HTML + 2 small files)DaysHome-screen icon; browser install promptNo
TWA (Trusted Web Activity)Low-medium (small Android wrapper)WeeksPlay Store installYes (Play Store)
Capacitor / CordovaMedium (native shell)Weeks-monthsApp Store + Play Store installYes (both stores)
Native (React Native / Flutter)High (full native build)MonthsApp Store + Play Store installYes (both stores)

Honest framing. PWA is the on-the-cheap path because the existing HTML/CSS/JS the agent has built becomes the app with two small additions: a manifest.json file and a service worker. The user installs the page on their phone's home screen; the page opens full-screen; works offline; loads fast. App Store presence is the only thing PWA doesn't give you; if App Store presence is required, TWA / Capacitor is the next step up.


2. The manifest.json template

The manifest.json file tells the browser how the page behaves when installed as an app. The manifest references the per-member URL as the start URL; the icons are the member's branding; the theme color matches the ORB palette.

{
  "name": "{{MEMBER_NAME}} · Cosmic Orb",
  "short_name": "{{MEMBER_SHORT_NAME}}",
  "description": "{{MEMBER_TAGLINE}}",
  "start_url": "/per-member-landing-template?member={{MEMBER_SLUG}}&source=pwa",
  "display": "standalone",
  "background_color": "#fafaf6",
  "theme_color": "#272c68",
  "orientation": "portrait",
  "icons": [
    {
      "src": "{{MEMBER_ICON_192_URL}}",
      "sizes": "192x192",
      "type": "image/png",
      "purpose": "any"
    },
    {
      "src": "{{MEMBER_ICON_512_URL}}",
      "sizes": "512x512",
      "type": "image/png",
      "purpose": "any"
    },
    {
      "src": "{{MEMBER_ICON_MASKABLE_512_URL}}",
      "sizes": "512x512",
      "type": "image/png",
      "purpose": "maskable"
    }
  ],
  "categories": ["business", "lifestyle", "social"],
  "shortcuts": [
    {
      "name": "JOKE of the WEEK",
      "url": "/per-member-landing-template?member={{MEMBER_SLUG}}&shortcut=joke",
      "icons": [{"src": "{{JOKE_ICON_URL}}", "sizes": "96x96"}]
    },
    {
      "name": "Refer a friend",
      "url": "/per-member-landing-template?member={{MEMBER_SLUG}}&shortcut=refer",
      "icons": [{"src": "{{REFER_ICON_URL}}", "sizes": "96x96"}]
    },
    {
      "name": "Charity support",
      "url": "/per-member-landing-template?member={{MEMBER_SLUG}}&shortcut=charity",
      "icons": [{"src": "{{CHARITY_ICON_URL}}", "sizes": "96x96"}]
    }
  ]
}

Per-member operator workflow.

  1. Operator generates a manifest.json per member by substituting the member's name, slug, tagline, icon URLs.
  2. Operator uploads the manifest.json to the page's root directory.
  3. The page's HTML includes a <link rel="manifest" href="/manifest.json"> tag in the head.
  4. The browser detects the manifest; on supported browsers, the user sees an "Install" prompt.

3. The service worker template

The service worker is a small JavaScript file that runs in the background. It enables offline support, fast loads, and push notifications. The service worker caches the page's assets on first load; subsequent loads come from the cache; updates are picked up on next visit.

// Service Worker for Cosmic Orb member pages
const CACHE_NAME = "cosmic-orb-member-v1";
const ASSETS = [
  "/",
  "/per-member-landing-template",
  "/manifest.json",
  "{{MEMBER_ICON_192_URL}}",
  "{{MEMBER_ICON_512_URL}}"
];

self.addEventListener("install", event => {
  event.waitUntil(
    caches.open(CACHE_NAME).then(cache => cache.addAll(ASSETS))
  );
});

self.addEventListener("activate", event => {
  event.waitUntil(
    caches.keys().then(keys =>
      Promise.all(
        keys.filter(key => key !== CACHE_NAME).map(key => caches.delete(key))
      )
    )
  );
});

self.addEventListener("fetch", event => {
  event.respondWith(
    caches.match(event.request).then(cached => {
      return cached || fetch(event.request).then(response => {
        if (response.status === 200) {
          const clone = response.clone();
          caches.open(CACHE_NAME).then(cache => cache.put(event.request, clone));
        }
        return response;
      });
    }).catch(() => caches.match("/per-member-landing-template"))
  );
});

Honest framing. The service worker is registered on the page via a small script in the HTML head. Once registered, the service worker takes over offline support, caching, and (optionally) push notifications. The service worker is a static file served at /service-worker.js; the page's HTML includes navigator.serviceWorker.register("/service-worker.js").


4. The page-level wiring

The per-member landing page needs three additions in its HTML head:

<head>
  <link rel="manifest" href="/manifest.json">
  <meta name="theme-color" content="#272c68">
  <meta name="apple-mobile-web-app-capable" content="yes">
  <meta name="apple-mobile-web-app-status-bar-style" content="default">
  <meta name="apple-mobile-web-app-title" content="{{MEMBER_NAME}}">
  <link rel="apple-touch-icon" href="{{MEMBER_ICON_192_URL}}">
</head>

Plus a service worker registration script at the end of the body:

<script>
if ("serviceWorker" in navigator) {
  navigator.serviceWorker.register("/service-worker.js")
    .then(reg => console.log("Service Worker registered", reg))
    .catch(err => console.error("Service Worker registration failed", err));
}
</script>

The agent's Per-Member Landing Page (Template) needs these additions applied per-member. The operator populates the per-member values (manifest, icons, theme color) at deployment.


5. The installation flow

On supported browsers, the user sees an "Install" prompt the first time they visit the per-member page. The flow:

  1. User visits the per-member URL in their mobile browser.
  2. Browser detects the manifest.json + service worker.
  3. Browser fires the beforeinstallprompt event.
  4. The page's JavaScript captures the event and shows a custom install prompt (e.g., "Get the app for faster access").
  5. User taps "Install"; the page adds an icon to the home screen; the page opens full-screen on next launch.

Once installed, the per-member page behaves like a native app:


6. Push notifications (optional, future iteration)

The service worker can register for push notifications. The operator wires a push service (e.g., OneSignal, Firebase Cloud Messaging, or a self-hosted Web Push server). The flow:

  1. User installs the PWA.
  2. The PWA's JavaScript requests notification permission.
  3. User grants permission; the service worker registers for push.
  4. The operator's push service sends notifications to the user's device.
  5. The service worker receives the push event; the user sees a notification.

The push-notification piece is operator-side and counsel-side work. The structural surface is named; the actual wiring is a future-session item. Push notifications are valuable for the JOKE-of-the-DAY / EMPOWER-of-the-DAY subscription surface; the JOKE content can be delivered as a push notification, not just an email.


7. Comparison to native app conversion

Honest framing on what PWA does and doesn't give you:

CapabilityPWANative app
Home-screen iconYesYes
Full-screen launchYesYes
Offline supportYesYes
Push notificationsYes (with service worker + push service)Yes
App Store presenceNoYes
App Store installNo (browser install prompt)Yes
Native device APIs (camera, GPS, etc.)Partial (browser-permissioned)Yes
Discoverability in app storesNoYes

Honest framing. PWA gives you 90% of what a native app gives you for 10% of the cost. The 10% you're missing is the App Store presence, which is the load-bearing piece for some user-acquisition strategies. If App Store presence is required, TWA / Capacitor is the next step up; if not, PWA is the on-the-cheap path.


8. Operator workflow summary

  1. Operator generates a manifest.json per member by substituting the member's name, slug, tagline, icon URLs.
  2. Operator uploads the manifest.json to the page's root directory.
  3. Operator uploads the service-worker.js to the page's root directory.
  4. Operator updates the per-member landing page's HTML head to include the manifest link, theme color, and apple-mobile-web-app tags.
  5. Operator updates the per-member landing page's body to include the service worker registration script.
  6. Operator deploys the page over HTTPS (PWAs require HTTPS).
  7. The user visits the page in their mobile browser; the install prompt appears; the user installs; the page behaves like a native app.

The agent builds the structural surface (the manifest template, the service worker template, the page-level wiring). The operator deploys at member-onboarding.


9. Status

What is in place today (06 October 2026):
What is NOT in place today: