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
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:
- Open http://localhost:3000 in Chrome
- DevTools β Application β Service Workers β confirm
sw.jsis registered - Browse a few lessons (they get cached)
- DevTools β Network β check Offline β reload β pages you visited should still work
- Optional: Install app from the address bar / install banner
How offline works
| Piece | Role |
|---|---|
manifest.webmanifest | App name, icons, standalone display |
Service worker (sw.js) | Generated at build time by @ducanh2912/next-pwa |
| Runtime caching | Pages (NetworkFirst), JS/CSS/images (StaleWhileRevalidate), fonts (CacheFirst) |
/offline | Fallback 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)
- Open the live site
- Menu β Install app / Add to Home screen
iPhone (Safari)
- Open the live site
- 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
- Push this repo to GitHub
- Import at vercel.com/new
- Vercel auto-detects Next.js β no build settings needed
- 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).