Adds unit 1 functional design and answered nfr requirements questions and plan

This commit is contained in:
2026-06-19 20:39:36 +02:00
parent 8b6ffcecba
commit 7e4397af4e
5 changed files with 285 additions and 9 deletions
@@ -10,7 +10,7 @@
- Provide `ApiClient` and `AuthContext` foundations aligned with cookie-based auth (httpOnly refresh cookie, access token in memory)
## Plan Checklist
- [ ] Confirm scaffold strategy and tools via questions below
- [x] Confirm scaffold strategy and tools via questions below
- [ ] Generate folder structure (`src/api`, `src/auth`, `src/components`, `src/routes`)
- [ ] Install and configure dependencies (TanStack Router, @tanstack/react-query, Tailwind v4, shadcn/ui)
- [ ] Configure Tailwind theme with primary color `#ac0000`
@@ -30,49 +30,49 @@ B) npm
C) yarn
X) Other (please describe after the [Answer]: tag below)
[Answer]:
[Answer]: A
## Question 2: Router choice
A) TanStack Router (required by NFR-01)
B) React Router
X) Other (please describe after the [Answer]: tag below)
[Answer]:
[Answer]: A
## Question 3: UI foundation
A) Tailwind v4 + shadcn/ui (recommended)
B) Tailwind v4 only (no shadcn/ui)
X) Other (please describe after the [Answer]: tag below)
[Answer]:
[Answer]: A
## Question 4: Primary color integration (`#ac0000`)
A) Tailwind theme config (extend colors + use via utility classes)
B) CSS variables (root-level var, consumed by components)
X) Other (please describe after the [Answer]: tag below)
[Answer]:
[Answer]: A
## Question 5: HTTP client layer
A) Fetch wrapper (`ApiClient`) with `credentials: 'include'` + JSON helpers (recommended)
B) Axios instance with `withCredentials: true`
X) Other (please describe after the [Answer]: tag below)
[Answer]:
[Answer]: A
## Question 6: API base URL source
A) `import.meta.env.VITE_API_BASE_URL` (from `.env`)
B) Derive from `window.location.origin` + `/api`
X) Other (please describe after the [Answer]: tag below)
[Answer]:
[Answer]: A
## Question 7: Session bootstrap behavior
A) On app mount, attempt silent refresh (uses httpOnly cookie) to hydrate `AuthContext` (recommended)
B) Do not auto-refresh on mount; rely on login flow and 401 handling
X) Other (please describe after the [Answer]: tag below)
[Answer]:
[Answer]: A
## Question 8: Linting/formatting baseline
A) ESLint (recommended) + Prettier with sensible defaults
@@ -80,4 +80,4 @@ B) ESLint only
C) None for now
X) Other (please describe after the [Answer]: tag below)
[Answer]:
[Answer]: A, but indentation with 4 spaces
@@ -0,0 +1,71 @@
# NFR Requirements Plan — Unit 1: Project Scaffold & Infrastructure
**Status**: Awaiting user answers to the questions below.
## Plan Checklist
- [ ] Analyze functional design artifacts (domain-entities.md, business-rules.md, business-logic-model.md)
- [ ] Identify NFR categories requiring clarification (performance, security, accessibility, maintainability, observability)
- [ ] Generate context-appropriate multiple-choice questions per question-format-guide.md
- [ ] Store this plan file
- [ ] Wait for user completion of [Answer] tags
- [ ] Validate answers, resolve any ambiguities
- [ ] Generate nfr-requirements.md and tech-stack-decisions.md artifacts
## NFR Questions
## Question 1
What is the target initial JavaScript bundle size budget (gzipped) for the production build of the CMS frontend?
A) < 200 KB (strict, requires aggressive code-splitting and tree-shaking)
B) < 300 KB (balanced for shadcn/ui + TanStack Router + React 18)
C) < 500 KB (lenient, acceptable for admin panel with multiple pages)
X) Other (please describe after [Answer]: tag below)
[Answer]: X, as small as possible to reduce initial bundle size, but no exact number.
## Question 2
What accessibility (a11y) compliance level must the admin UI components and pages meet?
A) WCAG 2.2 AA (standard for most admin interfaces; keyboard navigation + screen reader support)
B) WCAG 2.2 AAA (highest level; includes enhanced contrast, cognitive accessibility)
C) Basic keyboard navigation and focus management only (minimal viable for internal tool)
X) Other (please describe after [Answer]: tag below)
[Answer]: C
## Question 3
Should the scaffold include a client-side error monitoring / observability solution from day one?
A) No observability in scaffold (console + toast only; add later)
B) Sentry (error tracking + performance monitoring)
C) OpenTelemetry / custom lightweight solution
X) Other (please describe after [Answer]: tag below)
[Answer]: A
## Question 4
Should Vitest + React Testing Library + MSW (mock service worker) be included in the initial project scaffold for component and integration tests?
A) Yes — full test setup with example tests for login flow and auth guard
B) No — only Playwright E2E later; keep scaffold minimal
X) Other (please describe after [Answer]: tag below)
[Answer]: A
## Question 5
Is internationalization (i18n) support required in the initial scaffold, or can labels remain hard-coded for now?
A) Yes — add react-i18next + language switcher (English + Dutch)
B) No — English only for v1; Dutch translations can be added later without i18n framework
X) Other (please describe after [Answer]: tag below)
[Answer]: A
## Question 6
Should pre-commit hooks (husky + lint-staged) enforcing ESLint + Prettier + TypeScript checks be part of the scaffold?
A) Yes — enforce formatting and type safety on every commit
B) No — rely on editor integration and CI only
X) Other (please describe after [Answer]: tag below)
[Answer]: B