Maintain the NTUH North Branch long-term care resource coordination PoC. The platform supports case managers, social workers, long-term care staff, and family caregivers with a static resource dispatch and lookup workspace.
Apply these priorities in order when requirements conflict:
- Accessibility
- Data integrity
- Rendering stability
- Static export compatibility
- Performance
- Visual polish
- Next.js 16.2.6 with App Router
- React 19
- TypeScript
- Tailwind CSS v4 with
@tailwindcss/postcss - Maplibre GL JS
Do not replace Maplibre with Leaflet. Do not add Redux, Zustand, MobX, or another global state library. Use React-native state and memoization primitives.
- Keep
output: 'export'. - Do not add
getServerSideProps, dynamic API routes, or Node.js runtime dependencies. - Map components must stay client-only through
next/dynamic(..., { ssr: false }). - Preserve the
isMountedgate insrc/app/page.tsxunless a replacement is explicitly verified against hydration mismatch. - Keep the initial page state empty; do not render cards or map markers before filters/search/url state intentionally selects resources.
- All interactive elements must support visible keyboard focus and keyboard activation.
- Use semantic roles,
aria-label,aria-current,aria-expanded,aria-live="polite", andtabIndexwhere appropriate. - Do not break Tab navigation.
- Preserve high-contrast support.
- Avoid
h-screen; prefermin-h-[100dvh]or other fluid viewport-safe layout.
- Public repo must not track raw, cleaned, or private operational resource data.
src/data/resources.public.jsonis synthetic sample data for public builds.src/data/resources.build.jsonandsrc/data/resource-manifest.jsonare generated ignored build inputs.src/data/resources.jsonremains an ignored private ETL output. Do not edit it manually.- Dataset updates must go through ETL scripts, then
npm run prepare:data. - Preserve phone numbers, email addresses, URLs, LINE IDs, and
@handles. - Normalize whitespace at ETL or rendering boundaries.
- Null-check optional fields before rendering.
- Filter invalid coordinates before rendering map markers.
- Do not hardcode institution names in generic logic unless a documented product exception requires it.
- README and public docs must describe the private data loading strategy without hardcoding private dataset metrics.
- Historical documents are append-only unless the user explicitly approves rewriting them.
- If data loading behavior changes, update the documentation drift check before considering the change complete.
- Security descriptions must describe browser-side controls as friction, traceability, and deterrence only. Do not claim that a static frontend prevents leakage, screenshots, copying, scraping, or unauthorized access.
- Prefer localized, reviewable diffs.
- Do not perform destructive git operations unless the user explicitly asks.
- Keep generated output, caches, reports, and local artifacts out of commits unless the user explicitly asks to ship them.
- For substantial changes, verify in this order when applicable:
npm run lintnpm run check:docsnpm run buildnpm run test:unitnpm run test:e2enpm run test:memory
Treat these as critical failures:
- Breaking static export.
- Introducing hydration mismatch.
- Removing accessibility behavior.
- Rendering invalid map data.
- Replacing Maplibre with Leaflet.
- Breaking keyboard navigation or high-contrast support.
- Manually editing canonical processed data.
- Overwriting historical documentation without explicit approval.