Files
slp-modular-cms/aidlc-docs/features/cms-frontend/construction/unit-1/nfr-requirements/nfr-requirements.md
T

2.5 KiB

NFR Requirements — Unit 1: Project Scaffold & Infrastructure

NFR-U1-01: Performance — Bundle Size

  • Target: Keep initial JS bundle (gzipped) as small as possible
  • Vite must be configured for aggressive tree-shaking and code-splitting via TanStack Router file-based routes
  • No hard numeric budget; continuous monitoring via vite build --analyze recommended in CI later
  • See BR-U1-01, BR-U1-05 for lazy loading expectations

NFR-U1-02: Accessibility — Keyboard & Focus (A11Y)

  • Minimum requirement: Basic keyboard navigation and visible focus indicators on all interactive elements
  • All form controls, buttons, and links must be reachable via Tab and operable with Enter/Space
  • No full WCAG 2.2 AA/AAA compliance required for v1 (internal admin tool)
  • shadcn/ui components must expose proper ARIA attributes by default

NFR-U1-03: Observability — Client-side Error Reporting

  • No external error monitoring (Sentry, OpenTelemetry) in initial scaffold
  • Errors are logged to console + shown via user-friendly toast/banner (using existing shadcn/ui toast primitives)
  • Future extension point: add observability library later without changing API client contract

NFR-U1-04: Testing — Component & Integration Tests

  • Vitest + React Testing Library + MSW MUST be included in the scaffold
  • Example tests required for: login form submission, 401-intercept + retry flow, and authenticated route guard
  • Tests must run with pnpm test and achieve >70% coverage on auth-related components
  • MSW handlers must mock the real backend endpoints (/api/v1/auth/*)

NFR-U1-05: Internationalization — i18n

  • react-i18next + i18next-browser-languagedetector MUST be added
  • Supported languages in v1: English (default) + Dutch
  • Language switcher component must be present in the top bar / user menu
  • All user-facing strings in the scaffold (login, dashboard shell, error messages) must be wrapped in t() calls
  • Translation files: public/locales/en/*.json and public/locales/nl/*.json

NFR-U1-06: Maintainability — Pre-commit Hooks

  • No husky + lint-staged in the initial scaffold
  • Rely on editor integration (ESLint/Prettier on save) and CI pipeline only
  • Pre-commit enforcement can be added in a later NFR iteration if desired

NFR-U1-07: Maintainability — Configuration

  • All environment-specific values (API base URL, feature flags) stored in .env / .env.example following Vite conventions
  • No magic strings for route paths or API endpoints — use constants / TanStack Router file naming