Commit Graph
3 Commits
Author SHA1 Message Date
Bkk1234 634dc3ae3c feat(pwa): harden the auto-update chain and add a version tool
- ui/pwa.js: register with updateViaCache:'none', check for updates on load, every
  30 min, on tab focus and on 'online'; controllerchange reloads the page itself but
  waits while the user is typing in a form (admin edits survive), retrying on blur/hide
- sw.js: precache the maskable icon; bump VERSION -> 2026.11.24.2
- scripts/bump-version.mjs: bump sw.js VERSION + <meta app-version> together, --check
  fails on drift; wired into
> [email protected] check
> node --check ui/app.js && node --check ui/data.js && node --check ui/router.js && node --check ui/ui.js && node --check ui/pwa.js && node --check ui/views/home.js && node --check ui/views/admin.js && node --check sw.js && node --check server/publish.mjs && node --check server/db.mjs && node --check scripts/bump-version.mjs && node scripts/bump-version.mjs --check

[version] ตรงกันที่ 2026.11.24.2, exposed as
> [email protected] version
> node scripts/bump-version.mjs

[version] ตั้งเป็น 2026.11.24.3 แล้ว (sw.js + index.html)
- README/AGENTS: document the PWA behaviour and the bump workflow

Verified in Chrome: SPA route changes keep timeOrigin and navigation count at 1 (no
reload), a simulated deploy (version bump -> reg.update) replaced the cache from
hobbypj-2026.11.24.1 to .2 with the old cache deleted and the page reloading by
itself, Page.getAppManifest errors: [], and with the network emulated offline the
shell + 6 cards still render while an uncached file fails.
2026-11-24 14:52:50 +07:00
Bkk1234 5fb095b872 feat(storage): move project data to SQLite via node:sqlite
- server/db.mjs: schema (site + projects), transactional replace, WAL, VACUUM INTO backups (keep 10), JSON export, first-run seed from data/projects.json
- publish.mjs: read/write through the database, export mirror JSON for git/static/offline, validate duplicate project_id
- ui/data.js: read live data from /api/projects first, fall back to data/projects.json
- Dockerfile/compose/.env.example: DB_PATH, drop experimental sqlite warning flag
- docs: AGENTS.md + README describe the database layer and traps
2026-11-23 00:24:47 +07:00
Bkk1234 c00bc62272 feat: hobby project landing page (PWA + SPA) with admin backoffice
- landing page: welcome hero, live search, project card grid (10 projects from owner list)
- warm brown/white theme (fastwork-inspired layout), embedded K2D Thai font
- PWA: manifest, PIL-generated icons, versioned service worker with auto-update
- backoffice at #/admin: edit name/description/url, reorder, delete, publish
- server/publish.mjs: zero-dependency static server + PUT api/projects with
  validation, JSON write, git commit and push; loopback-only unless ADMIN_TOKEN
- docs: README, DESIGN.md (color/type contract), AGENTS.md
2026-11-19 01:03:13 +07:00