Frontend School
DashboardProblemsLearnPracticeMock InterviewReportsStatsBuy Credits
DashboardProblemsLearnPracticeMock Interview
Frontend System Design Roadmap
  1. 1.HTTP/1.1 vs HTTP/2 vs HTTP/3 (QUIC)
  2. 2.TCP and TLS Handshakes: Connection Setup Costs
  3. 3.Browser Network Stack and Connection Pooling
  4. 4.GET vs POST and Idempotency in HTTP
  5. 5.The Critical Rendering Path (CRP)
  6. 6.DOM, CSSOM and the Render Tree
  7. 7.Layout, Paint and Compositing
  8. 8.Reflows and Repaints Explained
  9. 9.Event Loop: Call Stack, Task and Microtask Queues
  10. 10.Async JavaScript: Promises and async/await
  11. 11.Web Workers: Multi-threading in the Browser
  12. 12.Browser Storage: Cookies, Web Storage, IndexedDB
  13. 13.Client-Side Storage: Limits and Security Risks
  14. 14.Choosing the Right Client-Side Storage
  15. 15.HTTP Caching: Cache-Control, ETag, Last-Modified
  16. 16.Browser-Level Caching Mechanisms
  17. 17.Cache Invalidation for Frontend Apps
  18. 18.Structuring a Large Single-Page App
  19. 19.Component-Based Architecture Principles
  20. 20.Props, State and Component Lifecycle
  21. 21.Module Bundling Basics
  22. 22.Core Web Vitals: LCP, INP and CLS
  23. 23.FCP and Time to Interactive (TTI) Explained
  24. 24.Measuring Performance: Lighthouse and WebPageTest
  25. 25.Asset Compression and Minification Basics
  26. 26.What Is a CDN and How Does It Work?
  27. 27.CDN Benefits: Latency, Availability, Offload
  28. 28.CDN Cache Behavior and Invalidation
  29. 29.Global State vs Local Component State
  30. 30.State Patterns: Redux, Zustand and Context
  31. 31.Data Fetching: React Query and SWR
  32. 32.Immutable Data in Frontend State
  33. 33.SSR vs CSR: Rendering Trade-offs
  34. 34.Hydration and Time to First Byte (TTFB)
  35. 35.Static Site Generation (SSG) for Speed and SEO
  36. 36.Incremental Static Regeneration (ISR)
  37. 37.Micro-Frontends: Core Principles
  38. 38.Micro-Frontend Integration Strategies
  39. 39.Communication Between Micro-Frontends
  40. 40.Micro-Frontends: Pros and Cons for Large Teams
  41. 41.Real-Time: Polling, SSE and WebSockets
  42. 42.Real-Time Use Cases: Chat, Alerts, Live Data
  43. 43.Designing a Real-Time Data Flow
  44. 44.Scaling WebSocket Connections
  45. 45.Responsive Images: srcset, sizes and picture
  46. 46.Modern Image Formats: WebP, AVIF, JPEG XL
  47. 47.Lazy Loading Images and Videos
  48. 48.Video Streaming: HLS, DASH, Adaptive Bitrate
  49. 49.REST and GraphQL for Frontend Engineers
  50. 50.Batching, Throttling and Debouncing API Calls
  51. 51.Handling API Errors in the Frontend
  52. 52.Authentication Flows: OAuth and JWT
  53. 53.Global Error Boundaries in React
  54. 54.Error Reporting: Sentry and LogRocket
  55. 55.Graceful Degradation and Fallback UIs
  56. 56.Real User Monitoring (RUM)
  57. 57.CORS: Cross-Origin Resource Sharing
  58. 58.Preventing XSS (Cross-Site Scripting)
  59. 59.CSRF Protection for Frontend Apps
  60. 60.Content Security Policy (CSP)
  61. 61.Storing Auth Tokens: Cookies vs localStorage
  62. 62.PWA Manifest and Installability
  63. 63.Service Workers: Lifecycle and Caching Strategies
  64. 64.Offline Support and Background Sync
  65. 65.Push Notifications for Web Apps
  66. 66.Webpack vs Vite vs Parcel
  67. 67.Code Splitting, Tree Shaking, Asset Optimization
  68. 68.Module Resolution and Hot Module Replacement
  69. 69.Monorepo Tooling: Nx and Lerna
  70. 70.Atomic Design for Component Libraries
  71. 71.Theming and Customization in Design Systems
  72. 72.Accessibility in Component Libraries
  73. 73.Component Library Docs, Testing and Versioning
  74. 74.Publishing and Consuming a Component Library
  75. 75.Full-Text Search: Levenshtein and Fuzzy Matching
  76. 76.Indexing Large Datasets in the Browser
  77. 77.Search Performance: Debouncing and Web Workers
  78. 78.Integrating Backend Search Services
  79. 79.Choosing a Chart Library: D3, Chart.js, Recharts
  80. 80.Rendering Large Datasets: Canvas vs SVG
  81. 81.Interactive, Responsive Data Visualizations
  82. 82.Data Fetching and Aggregation for Dashboards
  83. 83.A/B Test Design and Rollout Strategies
  84. 84.Client-Side vs Server-Side A/B Testing
  85. 85.Feature Flags and Remote Configuration
  86. 86.Experiment Data Collection and Analytics
Frontend System Design Roadmap
62

Frontend System Design · Lesson 62 of 86 · 4 min

PWA Manifest and Installability

This topic signals you understand how to bridge the gap between a web app and a native-like experience, a key product and engineering goal.

After this, you'll know exactly what makes a web app "installable" and how to control that experience. This isn't just about adding an icon to a home screen; it's about demonstrating you can deliver a reliable, integrated application that meets modern user expectations.

The Manifest: Your App's ID Card

The web app manifest is a JSON file, typically manifest.json, that you link in your HTML's <head>. It tells the browser and operating system how to treat your site as a standalone application. Without it, your app is just another tab.

Key properties you must know:

  • name and short_name: The full name for app stores or install prompts, and the short name for the home screen icon label.
  • start_url: The entry point when a user launches the app from their home screen. The trap: This URL must be reachable offline. A common failure is pointing this to a route that isn't precached by your service worker. Use a relative path like / or /app.
  • display: Defines the browser UI. standalone is the one you want for an app-like feel; it hides the browser's address bar and navigation controls. fullscreen is for immersive experiences like games.
  • icons: An array of image objects. You must provide at least a 192x192 and a 512x512 pixel icon. To show you're on top of things, also include a maskable icon, which ensures your icon looks good on all Android devices.
  • background_color and theme_color: background_color sets the splash screen color for a smoother transition on launch. theme_color tints the OS UI, like the status bar.

For extra credit, mention shortcuts to define a context menu for your app icon (like "New Document") or related_applications to link to your native App Store/Play Store app.

The Installability Checklist

A browser won't offer to install just any site. It runs a strict, automated check. Your PWA is only installable if it meets every criterion.

  1. Served over HTTPS. No exceptions.
  2. A valid manifest file is linked. No syntax errors, correct paths.
  3. A service worker is registered. It can be empty, but it must be there to signal offline capability.
  4. The start_url responds with a 200, even offline. This proves the service worker is doing its basic job.
  5. The manifest includes the required 192x192 and 512x512 icons.

Browsers also use engagement heuristics (e.g., the user has visited twice with at least five minutes between visits). The install prompt won't appear on the first-ever page load.

This flow is deterministic. If the prompt isn't showing up, you've failed one of these checks.

In an interview, don't just list these criteria. Explain the why. HTTPS provides a secure context for an installed app. The service worker guarantees a baseline of reliability. The manifest provides the OS integration metadata. This shows you understand the principles, not just the recipe.

Taking Control of the Install Prompt

When the installability criteria are met, the browser fires the beforeinstallprompt event. Your job is to catch it, prevent the browser's default action, and show your own UI at the right moment.

The trap: Forgetting to call event.preventDefault(). If you don't, the browser may show its own small, easy-to-miss install banner. By preventing the default, you take full control of when and how the user is prompted.

Here is the complete implementation.

First, your manifest.json:

{
  "name": "Frontend System Design App",
  "short_name": "FSD App",
  "start_url": ".",
  "display": "standalone",
  "background_color": "#fff",
  "theme_color": "#3367D6",
  "icons": [
    {
      "src": "images/icons/icon-192x192.png",
      "sizes": "192x192",
      "type": "image/png"
    },
    {
      "src": "images/icons/icon-512x512.png",
      "sizes": "512x512",
      "type": "image/png"
    }
  ]
}

Link it in your index.html and add a button:

<head>
  <link rel="manifest" href="/manifest.json">
</head>
<body>
  <button id="installButton" style="display: none;">Install App</button>
  <script src="/app.js"></script>
</body>

Finally, the JavaScript logic in app.js:

let deferredPrompt;
const installButton = document.getElementById('installButton');

window.addEventListener('beforeinstallprompt', (e) => {
  // Prevent the browser's default install prompt
  e.preventDefault();
  // Stash the event so it can be triggered later
  deferredPrompt = e;
  // Show your custom install button
  installButton.style.display = 'block';
});

installButton.addEventListener('click', async () => {
  if (!deferredPrompt) {
    return;
  }
  // Show the browser's install prompt
  deferredPrompt.prompt();
  
  // Wait for the user to respond to the prompt
  const { outcome } = await deferredPrompt.userChoice;
  
  console.log(`User response to the install prompt: ${outcome}`);
  
  // The prompt can only be used once. Clear it.
  deferredPrompt = null;
  installButton.style.display = 'none';
});

// Optional: Listen for when the app is successfully installed
window.addEventListener('appinstalled', () => {
  deferredPrompt = null;
  console.log('PWA was installed');
});

The userChoice promise resolves to an object with an outcome property: 'accepted' or 'dismissed'. You use this for analytics to understand how effective your custom UI is.

How to Debug When It Doesn't Work

When the install prompt doesn't appear, don't guess. Use your browser's tools.

In Chrome DevTools, go to the Application tab.

  1. Manifest: This pane shows how the browser parsed your manifest.json. It will flag syntax errors, missing icons, and other problems. It also has an "Add to home screen" button to manually trigger the prompt for testing, bypassing the engagement heuristic.
  2. Service Workers: Verify that your service worker is registered and running for the correct scope.

The fastest way to diagnose issues is to run a Lighthouse audit. Its PWA category checks all installability criteria and gives you a clear pass/fail report with instructions on how to fix any failures.

Try it

Create a minimal index.html, an empty service-worker.js, and a basic manifest.json. Serve them locally over HTTPS (tools like mkcert and http-server work well). Use DevTools to verify the installability criteria are met and that your custom install button successfully triggers the prompt.

Next: Service Workers: Lifecycle and Caching Strategies.

Lock it in — apply this lesson under interview conditions.

Try a free mock interviewPractice system design problems
Previous

Storing Auth Tokens: Cookies vs localStorage

Next

Service Workers: Lifecycle and Caching Strategies