📱 Zeni PWA Templates

Khách hàng deploy app web → tự động có "Install-able" PWA. Người dùng cuối click 1 nút "Install" trên Chrome/Edge/Safari = app icon trên màn hình desktop / mobile, chạy như native app.

💡 Tại sao PWA? Thay thế Tauri / Electron / .exe trong 90% use case — không cần customer cài rustc, MSVC, Xcode. Customer code 1 lần (Next.js / Vite) → Zeni tự inject manifest + service worker → app install-able trên mọi thiết bị.

Khi nào dùng PWA?

Use caseRecommend
Web app cần "icon trên desktop / mobile"PWA (Zeni Templates)
Offline-capable web appPWA (auto-cache + offline.html)
App cần file system access đầy đủ (đọc/ghi mọi nơi)❌ Tauri / Electron (dùng Zeni Build Farm)
App cần native API (Bluetooth, USB, NFC)❌ Tauri / Electron
Mobile app App Store / Play Store❌ Flutter / React Native (dùng Zeni Build Farm)

2 Templates Available

1. Next.js PWA

framework: nextjs-pwa
detect_files: next.config.js / next.config.mjs / next.config.ts
auto-inject: next-pwa plugin + manifest.webmanifest + sw.js + offline.html
default_port: 3000

2. Vite + React PWA

framework: vite-pwa
detect_files: vite.config.js / vite.config.ts
auto-inject: vite-plugin-pwa + workbox + manifest.webmanifest + sw.js
default_port: 80 (nginx serve build)

Cách deploy

Cách 1: Click 1 nút trên Dashboard

  1. Đăng nhập zenicloud.io
  2. Click "🎯 Templates"
  3. Chọn "📱 Next.js PWA" hoặc "⚛️ Vite + React PWA"
  4. App live trong ~60s với install button trên browser

Cách 2: CLI

cd my-nextjs-app
npm install -g @zenicloud/cli
zeni init           # auto-detect Next.js PWA
zeni deploy

Cách 3: API trực tiếp (cho AI agent)

curl -X POST https://zenicloud.io/api/v1/deploy/quick?ws=myws \
  -H "Authorization: Bearer $ZENI_TOKEN" \
  -d '{"zip_base64":"...","name":"my-pwa","framework":"nextjs-pwa","port":3000}'

Khi nào PWA tự động kích hoạt

Zeni Cloud auto-inject PWA assets nếu:

File auto-injected

FileChức năng
public/manifest.webmanifestTên app, icon, theme color, display=standalone
public/sw.jsService worker — cache offline + runtime cache
public/offline.htmlTrang fallback khi mất kết nối
public/zeni-pwa-register.jsAuto-register service worker
⚠️ Customer giữ quyền override: Nếu file đã tồn tại trong source code (manifest.webmanifest, sw.js...), Zeni KHÔNG ghi đè — tôn trọng config của customer.

Zeni Cloud · zenicloud.io · 100% Google Cloud Platform