Adds nfr requirements and design for unit 1
This commit is contained in:
+67
@@ -0,0 +1,67 @@
|
||||
# Tech Stack Decisions — Unit 1: Project Scaffold & Infrastructure
|
||||
|
||||
## Existing Stack (from ZIP example + requirements)
|
||||
All prior choices retained:
|
||||
- **Vite 6** — Build tool
|
||||
- **React 18** — UI library
|
||||
- **TypeScript 5** — Type safety
|
||||
- **TanStack Router v1** — File-based routing (replaces React Router)
|
||||
- **Tailwind CSS v4** + **shadcn/ui** — Styling & components (primary color `#ac0000`)
|
||||
- **pnpm** — Package manager
|
||||
- **ESLint + Prettier** (4-space indent) — Formatting
|
||||
|
||||
---
|
||||
|
||||
## New: Testing Framework
|
||||
|
||||
| Decision | Choice | Rationale |
|
||||
|----------|--------|-----------|
|
||||
| Test runner | Vitest | Native ESM, fast, Vite-native, excellent TypeScript support |
|
||||
| Component testing | React Testing Library | Industry standard for React; focuses on user behavior |
|
||||
| API mocking | MSW (Mock Service Worker) | Works in browser + Node; realistic network layer for auth flows |
|
||||
| Test command | `pnpm test` | Consistent with existing pnpm scripts |
|
||||
|
||||
---
|
||||
|
||||
## New: Internationalization
|
||||
|
||||
| Decision | Choice | Rationale |
|
||||
|----------|--------|-----------|
|
||||
| i18n library | react-i18next + i18next-browser-languagedetector | Most popular React i18n solution; automatic language detection |
|
||||
| Translation files | JSON under `public/locales/{en,nl}/` | Standard, easy to edit, works with Vite static assets |
|
||||
| Language switcher | Custom component in user menu | Keeps UI consistent with shadcn/ui |
|
||||
|
||||
---
|
||||
|
||||
## New: Environment Configuration
|
||||
|
||||
| Decision | Choice | Rationale |
|
||||
|----------|--------|-----------|
|
||||
| Env variables | Vite `import.meta.env.VITE_*` | Official, type-safe, exposed to client |
|
||||
| Example file | `.env.example` (committed) | Documents required variables for new developers |
|
||||
| Local overrides | `.env.local` (gitignored) | Follows Vite + dotenv conventions |
|
||||
|
||||
---
|
||||
|
||||
## Explicitly NOT included (per answers)
|
||||
|
||||
- No Sentry / OpenTelemetry in scaffold
|
||||
- No husky + lint-staged pre-commit hooks
|
||||
- No WCAG 2.2 AA/AAA a11y requirements beyond basic keyboard support
|
||||
- No hard bundle-size budget (optimize for smallest possible)
|
||||
|
||||
---
|
||||
|
||||
## appsettings / env additions (frontend only)
|
||||
|
||||
`.env.example` (committed):
|
||||
```env
|
||||
VITE_API_BASE_URL=http://localhost:5000
|
||||
```
|
||||
|
||||
`.env.local` (developer only, gitignored):
|
||||
```env
|
||||
VITE_API_BASE_URL=http://localhost:5000
|
||||
```
|
||||
|
||||
No changes needed to backend `appsettings.json` for Unit 1.
|
||||
Reference in New Issue
Block a user