Case Study ng Proyekto · Progressive Web App na May Kakayahang Mag-offline
Rural Mail Digital Helper
Isang libre at mai-install na Progressive Web App (PWA) na dinisenyo at binuo ni Tyson Berry-Wogan para sa mga rural letter carrier. Pinagsasama nito ang mga naka-save na sagot sa kontrata ng USPS-NRLCA at RRECS, isang mahahanap na library ng sipi ng dokumento, mga browser-local at napi-print na working draft sa PS Form 8191 at RRECS evaluation dispute Form 1, at offline na pagmamapa ng ruta sa USGS/OpenStreetMap.
Ang mga rural letter carrier na sumusuri sa mga probisyon ng kontrata, naghahanda para sa mga talakayan ng steward, o sumusuri sa mga hinto ng ruta sa ilalim ng Rural Route Evaluated Compensation System (RRECS) ay nahaharap sa tatlong paulit-ulit na hadlang:
1. Paghahanap ng Siniping Kontrata at Mga Sagot sa RRECS
Ang mga tanong tungkol sa mga deadline ng hinaing sa Hakbang 1, suweldo sa relief-day, mga pangalawang biyahe, coverage factor, at ang Rural Route Evaluation Dispute Process (RREDP) ay sumasaklaw sa NRLCA National Agreement, Memoranda of Understanding (MOUs), at mga manwal ng USPS. Kailangan ng mga carrier ng mabilis at simpleng paghahanap na nakatali sa mga partikular na pamagat ng dokumento, numero ng pahina, at petsa.
2. Pribadong Pag-draft ng Mga Form ng Reklamo at Hindi Pagkakasundo
Ang paghahanda ng working draft para sa hinaing sa Hakbang 1 (PS Form 8191) o isang draft ng pagtatalo sa pagsusuri ng RRECS (Form 1) para sa isang union steward ay may kinalamang sensitibong detalye ng empleyado (mga pangalan, 8-digit na Employee ID Number, numero ng ruta, at mga salaysay ng insidente) na kailangang manatili sa browser ng carrier sa halip na ipadala sa isang server, at ang mahahabang pahayag ay nangangailangan ng mga pahina ng pagpapatuloy sa halip na tahimik na maputol sa loob ng maliliit na kahon ng PDF form.
3. Pagmamapa ng Mga Hintuan at Paggawa Offline sa Mga Ruta sa Probinsya
Ang mga rural delivery route ay kadalasang dumaraan sa mga lugar na mahina o walang mobile coverage. Ang mga carrier na nagpaplano ng mga lokasyon ng Mailbox, Park point, at Front door ay nangangailangan ng route mapper na lokal na nagse-save ng mga hinto sa browser, nag-uugnay ng mga kaugnay na hinto, nag-e-export ng mga portable na file ng mapa nang hindi gumagawa ng account, at nagda-download ng mga public-domain na tile ng mapa para sa offline na sanggunian.
Ang Ginagawa ng Produkto (Mga Ipinakitang Kakayahan)
Isinasaayos ng Rural Mail Digital Helper ang apat na pinagsamang workspace sa loob ng isang mai-install at may kakayahang mag-offline na Progressive Web App:
1. Saved Contract & RRECS Q&A (`#ask`)
Sinusuri ang mga naka-save na sagot sa trabaho ng rural carrier, suweldo, mga pagsusuri ng RRECS, coverage factor, mga pangalawang biyahe, mga panuntunan sa relief-day, at mga timeline ng Hakbang 1 na may mga pagsipi ng pinagmulan.
Supported unanswered public questions can be queued via `/rural-mail-digital-assistant/engine/ask` without generating in engine-open, scheduling up to six read-only cache refreshes 30 seconds apart.
When the engine reports `answer_status: "needs_material"`, the page states that the question is kept on file while looking for supporting material, with no set wait time and no queue promise.
Displays turnaround estimates only from verified completed samples in `flash-turnaround.json` (verified within the last 7 days, deduplicated by `evidence_sha256`), falling back to 7-day `healthz.cache_turnaround` statistics when at least five samples exist and showing an explicit no-estimate message rather than an invented wait time when fewer than five samples exist.
Naghahanap ng mga sipi sa buong NRLCA National Agreement, mga MOU, mga gabay sa RREDP, at mga postal manual ayon sa paksa, artikulo, o numero ng form.
Kabilang ang mga mabilisang pampasimula ng paksa para sa pamamaraan ng hinaing sa Artikulo 15, PS Form 8191, Rural Route Evaluation Dispute Process (RREDP), at mga kahilingan para sa impormasyon sa Artikulo 31.
Nagbabalik ng mga siniping sipi kasama ang mga pamagat ng pinagmulang dokumento, numero ng pahina, at petsa (mga sipi lamang, hindi buong pag-download ng dokumento).
3. Browser-Local Printable Form Drafts (`#tools`)
Questionnaire sa Isyu at Working Draft: Builds a steward preparation checklist and an escaped-text worksheet that can be printed or downloaded as `.txt` without clipping long entries.
Awtentikong PS Form 8191 Draft (Marso 2007 — EIN Edition): Uses locally vendored `pdf-lib`, `@pdf-lib/fontkit`, and `DejaVuSans.ttf` (`ps8191.js`) to fill the authentic blank AcroForm entirely in the browser. Enforces explicit bounds (100,000 characters per entry; 400,000 across the draft), carries overflow onto labelled continuation pages on whole Unicode code-point boundaries, validates Item 1b EIN as 8 digits or blank, checks glyph coverage against embedded DejaVu (Latin, Greek, Cyrillic, accents, and typographic punctuation), and immediately detaches the PDF blob if any field changes.
Muling Ginawang Draft ng RRECS Evaluation Dispute Form 1 (Oktubre 2026): Fills a recreated vector PDF layout (`rrecs-form1.js`) in the browser, preserving leading zeros on plain-text phone, installation, finance-number, and ZIP fields, with independent checkboxes for Office Time, Route Time, and Street Volume Time.
4. Interactive Offline Route Mapper (`#map`)
Lokal na nagle-lazy-load ng vendored Leaflet 1.9.4 na may apat na base layer: Street (OpenStreetMap), Satellite (imahe ng USGS National Map na may mga label), Aerial (USGS imagery-only orthoimagery), at Topo (USGS National Map).
Naka-color-code ang mga lugar Mailbox (`#15803d`), Park point (`#7c3aed`), and Pintuan sa harap (`#eab308`) pins with optional user names (up to 140 UTF-16 code units, keeping leading zeros such as `007`), undo last placement, and click-to-undo mode.
Connect Mode: Links a mailbox, a park point, and a front door in order with an optional verbatim box number (up to 40 characters), computing geodesic (haversine) straight-line distance estimates and displaying a proximity advisory when a mailbox is under 5 feet (`1.523999 m`) from another stop.
Mga Offline na Tile Pack ng USGS at Mga Portable na File: Downloads USGS Satellite or Topo tile packs (up to 6,000 tiles, zoom ≤ 16) into Cache Storage (`helper-tiles-v1`) with parallel fetch, retry, cancel/sweep cleanup, and dateline (`±180°`) wrapping. Checkpoints working maps (`nrlca_route_map_working_session_v1`), saves named routes in `localStorage`, records foreground-only GPS location trails, and exports/imports strict `nrlca-map/v1` and `nrlca-map/v2` portable JSON files plus GeoJSON and print summaries.
Tungkulin ng Tyson
Tyson Berry-Wogan conceived, designed, and built Rural Mail Digital Helper (`/rural-mail-digital-helper/`) and its companion three-minute interactive walkthrough demo (`/nrlca-demo/`).
Client-Side na PDF at Inhenyeriya ng Tipograpiya: Built `ps8191.js` and `rrecs-form1.js` to render printable working drafts on the March 2007 PS Form 8191 AcroForm and the recreated October 2026 RRECS Form 1 vector layout directly in the browser, with surrogate-safe Unicode code-point wrapping, pre-build glyph validation, continuation page layout, and SHA-256 vendor provenance verification (`vendor/ps8191/PROVENANCE.json`).
Disenyo ng Geospatial at Portable na Schema: Authored the `nrlca-map/v1` and `nrlca-map/v2` JSON Schema 2020-12 contracts and portable JavaScript codecs (`shared/map-portable-v1.js`, `shared/map-portable-v2.js`) shared between the web helper and native iOS/Android mapping parsers, including strict unknown-field refusal, dateline unwrapping, and non-destructive legacy route migration.
Arkitektura ng Atomic PWA Service Worker: Engineered the v6 atomic generation service worker (`rural-mail-digital-helper/sw.js`) that stages and validates the 30 `SHELL` entries—verifying MIME types, format magic signatures, and 22 pinned SHA-256 hashes—into a new immutable generation cache (`helper-shell-v6-g-<build>`) before updating the `__selected_generation__` pointer, without deleting the previously selected generation during publication so a failure at any promotion step keeps the old verified shell live and serving.
Mga Screenshot ng Application at Mga Visual Asset
The images below are the existing raster visual assets committed in the repository for Rural Mail Digital Helper: the walkthrough interface capture (`/posters/nrlca-demo.webp`) and the standard and maskable Progressive Web App icons (`/rural-mail-digital-helper/icons/icon-512.png` and `/rural-mail-digital-helper/icons/maskable-512.png`), which depict the three connected stop types used in the route mapper.
Pagkuha sa Walkthrough — Naka-save na Sagot sa RRECS at Mga Pagsipi ng Dokumento
Interface capture (`/posters/nrlca-demo.webp`, 720×480) showing the Ask workspace returning a cached answer on the Rural Route Evaluation Dispute Process (RREDP) with document page citations and verification notices.
Icon ng Progressive Web App — Mga Konektadong Hinto sa Ruta
Standard 512×512 PNG application icon (`/rural-mail-digital-helper/icons/icon-512.png`, SHA-256 pinned in `sw.js`) illustrating three linked route stops along a mapped path.
Maskable na Icon sa Home-Screen — Asset ng Safe-Zone sa Android at PWA
Full-bleed 512×512 maskable icon (`/rural-mail-digital-helper/icons/maskable-512.png`, SHA-256 pinned in `sw.js`) referenced by `manifest.webmanifest` for adaptive mobile home-screen installation.
Mga Limitasyon, Setup, Privacy at Mga Platform
Ipinapatupad ng Rural Mail Digital Helper ang mahigpit na mga hangganang legal, teknikal, at pang-privacy upang maunawaan ng mga carrier at steward kung ano ang ginagawa at hindi ginagawa ng tool:
Hindi Opisyal na Sistema ng Unyon o USPS
Ang Rural Mail Digital Helper ay isang independiyenteng pantulong sa edukasyon at pagpaplano—hindi opisyal na pinagmumulan ng impormasyon—at hindi dapat banggitin bilang ganoon. Palaging i-verify ang mga kasalukuyang dokumento ng kontrata at makipag-usap sa isang union steward bago ang mga deadline ng paghahain.
Mga Working Draft Lamang (Hindi Kailanman Nilagdaan o Inihain Dito)
Ang paghahanda o pag-print ng worksheet, draft ng PS Form 8191, o draft ng RRECS Evaluation Dispute Form 1 ay gumagawa ng isang working draft para sa pagsusuri ng steward lamang; hindi ito kailanman nilalagdaan, inihahain, o isinusumite rito. Ang mga pahayag ng pamamahala, pagtatasa sa pagiging napapanahon, disposisyon, at mga linya ng lagda ay sadyang iniwang blangko. Ang Oktubre 2026 RRECS Form 1 ay isang muling ginawang vector layout, hindi opisyal na orihinal ng USPS.
Browser-Local na Mga Form at Imbakan ng Ruta
Form entries run in the browser: they are not sent anywhere, not logged, and not saved by the site. Unsaved route pins stay in the current page; working map checkpoints (`nrlca_route_map_working_session_v1`), named saved routes (`nrlca_route_map_saved_routes_v1`), and downloaded offline tile packs (`helper-tiles-v1`) are stored only in that browser profile on that device (up to 500 pins, 500 connections, and a 4 MiB checkpoint JSON cap) and are not uploaded or synced. No user account is created, anyone using the same browser profile may be able to see saved local storage, and clearing browser site data removes local routes.
Mga Layer ng Mapa, Patakaran sa Tile at Straight-Line na Distansya
Gumagamit ang mapa ng mga tile ng OpenStreetMap at USGS National Map—hindi ang opisyal na mapa ng USPS Digital Point Mapping (DPM)—at ang mga pin nito para sa Mailbox, Park point, at Front door ay mga personal na label sa pagpaplano, hindi opisyal na mga simbolo ng DPM o mga sukat ng RRECS. Ang mga iginuhit na linya at distansya ng Connect ay mga pagtatantya ng straight-line geodesic, hindi road-snapped mileage, oras ng paghahatid, o kredito ng RRECS. Alinsunod sa patakaran sa paggamit ng tile ng OpenStreetMap Foundation, ang mga tile ng OSM Street ay hindi kailanman pini-prefetch o maramihang dina-download; nagka-cache lamang ang mga offline pack ng mga pampublikong tile ng USGS Satellite o Topo (hanggang zoom 16, nililimitahan sa 6,000 tile bawat ruta).
Pag-record ng Lokasyon sa Foreground Lamang
Hinihiling lamang ang pahintulot sa lokasyon kapag nag-click ang user Gamitin ang aking lokasyon o Simulan ang pag-record ng lokasyon. Gumagana lang ang pag-record ng trail habang nakikita ang page (hanggang 10,000 na naitalang fix/segment); ang pagtago sa tab, pagpapalit ng app, pag-lock ng screen, o agwat ng provider na higit sa 30 segundo ay nagpo-pause sa pag-record at nagmamarka ng segment break. Tinatayang lokasyon lang ang mga posisyon sa GPS ng browser at telepono.
Mga Platform, Saklaw ng Offline at Test Build sa Android
Runs on desktop and mobile browsers (Web, iOS, Android) and installs as an offline-capable PWA. Saved routes, pins, Connect links, and local draft forms work offline once cached; asking new questions, searching the document library, and viewing undownloaded map areas require a network connection. Interactive helper features require JavaScript enabled. The Route Map section also offers a signed Android test APK (`RuralMailDigitalHelper-Android-1.0.1-native-20261016-debug.apk`, 58.4 MiB, Android 8.0+, with SHA-256 checksum), explicitly labelled as an October 16 test candidate—not a Play Store release or the newer marker-guard source—where phone compatibility, saved-map recovery, and background/locked-screen GPS still require device verification.
Susunod na Aksyon — Buksan ang Helper o Panoorin ang Walkthrough
Ilunsad ang Rural Mail Digital Helper nang direkta sa iyong browser (o i-install ito sa iyong home screen), lumipat sa isang partikular na tool, o panoorin ang tatlong minutong interactive na walkthrough demo: