IndexedDB data can be evicted under storage pressure, especially on iOS Safari. navigator.storage.persist() asks the browser to keep our data. On Chromium+Firefox it succeeds silently when conditions allow (installed PWA, engagement heuristics); on Safari it typically grants only for installed PWAs. - persistentStorage.js: isPersisted() and requestPersistence() with graceful fallback when the Storage API is unavailable. - persistence.js: request persistence once, after the first successful save — a heuristic that works across Firefox (user gesture context) and Chromium/Safari (data-stored context). - sw.js: bump cache version, precache new file. - index.html: load new script. |
||
|---|---|---|
| _docs | ||
| public | ||
| src | ||
| .gitignore | ||
| README.md | ||
README.md
Duimstok-inspecties Bovenbouw
ProRail duimstok-inspecties voor wissels, overwegen en spoor. MVP / PWA — vanilla HTML, CSS, JS, IndexedDB, service worker.
Project-structuur
01_Applicatie/
├── public/ frontend assets (open public/index.html direct)
│ ├── index.html
│ ├── manifest.webmanifest
│ ├── sw.js service worker
│ ├── icons/
│ ├── css/
│ └── js/
├── src/ applicatielogica (DDD-lagen)
│ ├── Domain/
│ ├── Application/
│ └── Infrastructure/
└── _docs/ projectdocumentatie
Uitvoeren
Snel testen (geen PWA-functionaliteit):
Dubbelklik public/index.html. Werkt vanaf file://.
Volledige PWA (service worker + installatie):
Start een webserver vanuit 01_Applicatie/ en open de app via http://localhost:<poort>/public/:
python -m http.server 8000
# open http://localhost:8000/public/
Service worker, installatieknop en offline-caching werken alleen vanaf
http(s):// of localhost — niet vanaf file://.
Branches
master— live productie (auto-deploy bij merge)develop— staging (auto-deploy bij merge)- feature branches — nieuwe functionaliteit, merge via PR in
develop
Zie _docs/ voor verdere projectdocumentatie.