Deploying this tutorial

This is a Next.js app with PWA / offline support. Deploy it on Vercel with zero config.

Live site: system-design-iota-ten.vercel.app
GitHub: github.com/saroj990/system-design

Local development

npm install
npm run dev

Open http://localhost:3000

The service worker is disabled in development so hot reload stays clean. Test offline with a production build.

Production build (required to test PWA)

npm run build
npm start

Then:

  1. Open http://localhost:3000 in Chrome
  2. DevTools β†’ Application β†’ Service Workers β€” confirm sw.js is registered
  3. Browse a few lessons (they get cached)
  4. DevTools β†’ Network β†’ check Offline β†’ reload β€” pages you visited should still work
  5. Optional: Install app from the address bar / install banner

How offline works

PieceRole
manifest.webmanifestApp name, icons, standalone display
Service worker (sw.js)Generated at build time by @ducanh2912/next-pwa
Runtime cachingPages (NetworkFirst), JS/CSS/images (StaleWhileRevalidate), fonts (CacheFirst)
/offlineFallback when a page isn’t in the cache

Important: Offline β‰  download the whole course automatically. Pages become available offline after you visit them once online (or after the install caches the app shell). Tip: open the fundamentals list and key case studies once while online.

Install on a phone

Android (Chrome)

  1. Open the live site
  2. Menu β†’ Install app / Add to Home screen

iPhone (Safari)

  1. Open the live site
  2. Share β†’ Add to Home Screen

iOS offline support is more limited than Chrome, but the installed shortcut still works well for reading cached pages.

Deploy to Vercel

  1. Push this repo to GitHub
  2. Import at vercel.com/new
  3. Vercel auto-detects Next.js β€” no build settings needed
  4. Deploy

Every push to main / master triggers a new deployment. The service worker is generated during next build on Vercel.

Project structure

app/              Next.js pages & layout (includes /offline)
components/       Sidebar, Markdown, Mermaid, PWA install prompt
fundamentals/     Markdown lessons (15)
case-studies/     Markdown case studies (40)
lib/              Content loading & navigation
public/           Manifest, icons, generated sw.js (build)

Custom domain

In Vercel: Project β†’ Settings β†’ Domains β†’ add your domain and update DNS.

HTTPS is required for service workers (Vercel provides this automatically).