Merge pull request 'Completes the front-end shell and adds CI/CD' (#3) from feature/frontend-shell into master
Continuous Integration / check (push) Successful in 6m25s
Continuous Integration / lighthouse (push) Successful in 12m19s
Continuous Integration / deploy-production (push) Skipped
Continuous Integration / deploy-test (push) Successful in 1m4s

Reviewed-on: #3
This commit was merged in pull request #3.
This commit is contained in:
2026-10-19 01:29:10 +02:00
159 changed files with 13556 additions and 414 deletions
+15
View File
@@ -0,0 +1,15 @@
# Tekstbestanden altijd met LF, op elke machine en in de CI-runner. Prettier
# eist LF; zonder dit zet Git op Windows CRLF neer bij een checkout en faalt
# `pnpm check` op de opmaak.
* text=auto eol=lf
# Binaire bestanden nooit aanpassen
*.png binary
*.jpg binary
*.jpeg binary
*.gif binary
*.webp binary
*.ico binary
*.woff binary
*.woff2 binary
*.pdf binary
@@ -0,0 +1,254 @@
name: Continuous Integration
# Branchstrategie (zie aidlc-docs/.../operations/deployment/deployment-plan.md):
# - Pull request → controles, geen deploy
# - Merge/push naar master → controles + automatisch naar test
# - Handmatig, elke branch → controles + naar test als 'Deploy to Test' aan staat
# - Handmatig, release/* → controles + naar productie als 'Deploy to Production' aan staat
on:
workflow_dispatch:
inputs:
deploy_test:
description: 'Deploy to Test'
type: boolean
default: false
deploy_production:
description: 'Deploy to Production (alleen vanaf een release/*-branch)'
type: boolean
default: false
pull_request:
types: [opened, synchronize, reopened]
push:
branches: [master]
# Alleen bij pull requests een verouderde run afbreken; een deploy wordt nooit
# halverwege gestopt.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
env:
NODE_VERSION: '24'
# Vaste Playwright-versie: levert Chromium voor linux-arm64 (er bestaat geen
# officiële Chrome voor ARM64, en Ubuntu's chromium is een snap die niet in
# een container werkt)
PLAYWRIGHT_VERSION: '1.55.0'
defaults:
run:
working-directory: web
jobs:
# lint, opmaak, tests (incl. property-based en axe), build en audit
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
# pnpm-versie komt uit "packageManager" in web/package.json
- uses: pnpm/action-setup@v4
with:
package_json_file: web/package.json
- name: Get pnpm store directory
id: pnpm-store
run: echo "path=$(pnpm store path)" >> "$GITHUB_OUTPUT"
- name: Cache pnpm store
uses: actions/cache@v4
with:
path: ${{ steps.pnpm-store.outputs.path }}
key: pnpm-${{ hashFiles('web/pnpm-lock.yaml') }}
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Lint
run: pnpm lint
- name: Format
run: pnpm format:check
# Logt de fast-check-seed; opnieuw afspelen met FC_SEED=<seed> pnpm test
- name: Tests
run: pnpm test
- name: Build
run: pnpm build
- name: Audit (productiepakketten, blokkerend)
run: pnpm audit:deps
- name: Audit (ontwikkeltools, alleen melden)
run: pnpm audit:dev
- name: Upload build artifact
uses: actions/upload-artifact@v3
with:
name: dist
path: web/dist/
retention-days: 7
# Lighthouse tegen de gebouwde site (mobiel en desktop)
lighthouse:
needs: check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- uses: pnpm/action-setup@v4
with:
package_json_file: web/package.json
- name: Get pnpm store directory
id: pnpm-store
run: echo "path=$(pnpm store path)" >> "$GITHUB_OUTPUT"
- name: Restore pnpm store
uses: actions/cache@v4
with:
path: ${{ steps.pnpm-store.outputs.path }}
key: pnpm-${{ hashFiles('web/pnpm-lock.yaml') }}
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Download build artifact
uses: actions/download-artifact@v3
with:
name: dist
path: web/dist
- name: Install Chromium
run: |
pnpm dlx playwright@${{ env.PLAYWRIGHT_VERSION }} install --with-deps chromium
CHROME_PATH="$(find "$HOME/.cache/ms-playwright" -path '*chrome-linux*' -name chrome -type f | head -n 1)"
test -x "$CHROME_PATH"
echo "CHROME_PATH=$CHROME_PATH" >> "$GITHUB_ENV"
"$CHROME_PATH" --version
# Chrome in een container (gelezen door lighthouserc.cjs, zie daar waarom
# niet via LHCI_*):
# --no-sandbox: als root weigert Chrome anders te starten
# --disable-dev-shm-usage: /dev/shm is in een container maar 64 MB; met
# de grote hero-foto's crasht het tabblad anders (TARGET_CRASHED)
# Performance op de Pi is niet representatief (CPU-vertraging bovenop een
# trage machine): hier alleen melden, blokkerend in `pnpm check` op een pc.
# Toegankelijkheid, Best Practices en SEO blokkeren wel.
- name: Lighthouse
env:
LIGHTHOUSE_CHROME_FLAGS: '--no-sandbox --headless=new --disable-dev-shm-usage'
LIGHTHOUSE_PERFORMANCE: warn
run: pnpm lighthouse
- name: Upload Lighthouse-rapporten
if: always()
uses: actions/upload-artifact@v3
with:
name: lighthouse-reports
path: web/lighthouse-reports/
retention-days: 14
deploy-test:
needs: [check, lighthouse]
if: (github.event_name == 'workflow_dispatch' && github.event.inputs.deploy_test == 'true') || (github.event_name == 'push' && github.ref == 'refs/heads/master')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Download build artifact
uses: actions/download-artifact@v3
with:
name: dist
path: web/dist
# Eenvoudig: de testmap leegmaken en de nieuwe build erin zetten. Oude
# versies worden niet bewaard. Op de Pi draait ook de huidige
# WordPress-site; daarom weigert deze stap een lege variabele, '/', of
# een map waarin WordPress staat.
- name: Upload naar de testserver
env:
# Secrets via env, zodat bash tekens als $ of ` niet nog eens uitlegt
SSHPASS: ${{ secrets.PI_MAIN_PASSWORD }}
SSH_PORT: ${{ secrets.PI_MAIN_PORT }}
SSH_USER: ${{ secrets.PI_MAIN_USERNAME }}
SSH_HOST: ${{ secrets.PI_MAIN_ADDRESS }}
DEPLOY_PATH: ${{ vars.DEPLOY_PATH_TEST }}
run: |
case "$DEPLOY_PATH" in
''|'/'|*' '*) echo "DEPLOY_PATH_TEST ontbreekt of is ongeldig: '$DEPLOY_PATH'"; exit 1 ;;
esac
sudo apt-get update && sudo apt-get install -y sshpass
SSH="sshpass -e ssh -p $SSH_PORT -o StrictHostKeyChecking=accept-new $SSH_USER@$SSH_HOST"
$SSH "set -e
if [ -e '$DEPLOY_PATH/wp-config.php' ] || [ -d '$DEPLOY_PATH/wp-content' ]; then
echo 'Geweigerd: $DEPLOY_PATH bevat WordPress'; exit 1
fi
mkdir -p '$DEPLOY_PATH'
find '$DEPLOY_PATH' -mindepth 1 -delete"
sshpass -e scp -P "$SSH_PORT" -o StrictHostKeyChecking=accept-new -r dist/. "$SSH_USER@$SSH_HOST:$DEPLOY_PATH/"
echo "Gedeployd naar test: ${GITHUB_REF_NAME} (${GITHUB_SHA::7})"
- name: Controle na deploy
env:
HEALTH_URL: ${{ vars.HEALTH_CHECK_URL_TEST }}
run: |
if [ -z "$HEALTH_URL" ]; then echo "Geen HEALTH_CHECK_URL_TEST ingesteld; overgeslagen"; exit 0; fi
curl -fsS -o /dev/null --retry 5 --retry-delay 3 "$HEALTH_URL"
curl -fsSI "$HEALTH_URL" | grep -qi '^content-security-policy:'
echo "Test bereikbaar met security headers"
deploy-production:
needs: [check, lighthouse]
# Alleen handmatig, en alleen vanaf een release-branch
if: github.event_name == 'workflow_dispatch' && github.event.inputs.deploy_production == 'true' && startsWith(github.ref, 'refs/heads/release/')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Download build artifact
uses: actions/download-artifact@v3
with:
name: dist
path: web/dist
- name: IIS-configuratie toevoegen
run: cp deploy/iis/web.config dist/web.config
# FTP met TLS (verplicht) naar de webhoster. Eerst alle bestanden behalve
# index.html, dan index.html, en pas daarna oude bestanden opruimen. Zo
# verwijst een bezoeker nooit naar een bestand dat er nog niet staat.
- name: Upload naar productie (FTPS)
env:
FTP_HOST: ${{ secrets.FTP_HOST }}
FTP_USER: ${{ secrets.FTP_USERNAME }}
LFTP_PASSWORD: ${{ secrets.FTP_PASSWORD }}
FTP_DIR: ${{ vars.FTP_REMOTE_DIR || 'wwwroot' }}
run: |
sudo apt-get update && sudo apt-get install -y lftp
lftp --env-password -u "$FTP_USER" "$FTP_HOST" -e "
set ftp:ssl-force true;
set ftp:ssl-protect-data true;
set net:max-retries 3;
mirror --reverse --verbose --exclude-glob index.html dist/ $FTP_DIR/;
put -O $FTP_DIR dist/index.html;
mirror --reverse --delete --verbose dist/ $FTP_DIR/;
quit"
echo "Gedeployd naar productie: ${GITHUB_REF_NAME} (${GITHUB_SHA::7})"
- name: Controle na deploy
env:
HEALTH_URL: ${{ vars.HEALTH_CHECK_URL_PRODUCTION }}
run: |
if [ -z "$HEALTH_URL" ]; then echo "Geen HEALTH_CHECK_URL_PRODUCTION ingesteld; overgeslagen"; exit 0; fi
curl -fsS -o /dev/null --retry 5 --retry-delay 3 "$HEALTH_URL"
curl -fsSI "$HEALTH_URL" | grep -qi '^content-security-policy:'
echo "Productie bereikbaar met security headers"
@@ -0,0 +1,42 @@
# API Documentation
## REST APIs
None. The project has no back-end yet. The static design README anticipates these future endpoints on a .NET API:
- `POST /api/contact` — contact form, payload `{ naam, email, onderwerp, bericht }`
- `/api/pages`, `/api/portfolio`, `/api/packages` — CMS content
## Internal APIs
### Routes (TanStack Router, file-based)
| Path | File | Head | Component |
|------|------|------|-----------|
| (root) | `routes/__root.tsx` | `siteHead` | `AppShell` via `RootLayout` |
| `/` | `routes/index.tsx` | `pageHead(...)` | `Hero` |
| `/over-mij` | `routes/over-mij.tsx` | `pageHead(...)` | placeholder |
### seo.ts
- **Methods**: `pageHead({ title: string, description: string })` → `{ meta: [...] }`; `siteHead` constant
- **Return Types**: TanStack Router `head` option object (title, description, og:title, og:description)
### Components (props)
- `AppShell()` — no props
- `NavigationBar()` — no props; reads route via `useRouterState`, scroll via `useScrolledPast`
- `NavLink(props: ComponentProps<ChakraLink>)`
- `MobileNav({ id: string, open: boolean, onClose: () => void })`
- `Footer()` — no props
- `LinkButton(props: ChakraLink props & { variant?: 'outline' | 'accent' | 'light' })`
- `Hero({ content: HeroContent })`, `HeroArrows({ onPrev, onNext })`, `HeroSocials({ socials: HeroSocial[] })`
### Hooks
- `useScrolledPast(getThreshold: () => number): boolean` — `getThreshold` must be referentially stable (it is an effect dependency)
- `useHeroSlider(count: number)` → `{ active, reducedMotion, autoplay, paused, next, prev, handlers }`
## Data Models
### NavItem (`navItems.ts`)
- **Fields**: `to` (route path), `label` (Dutch menu label)
- **Validation**: `as const` — `to` must be a registered route for type-safe `Link`
### HeroContent (`Hero/types.ts`)
- **Fields**: `title`, `tagline`, `cta: { label, to }`, `slides: { id, src, alt }[]`, `socials: { platform, href }[]`
- **Relationships**: `HeroSocial.platform` is a `SocialPlatform` key from `socialPlatforms.ts`
- **Validation**: empty `href` → social not shown
@@ -0,0 +1,107 @@
# System Architecture
## System Overview
A single client-side React SPA (`web/`) built with Vite. Routing is file-based via TanStack Router; styling uses Chakra UI v3 with a custom theme system (tokens taken from the static design). There is no back-end, API, database or deployment pipeline yet; the README states a .NET API is planned. Content is currently hard-coded in TypeScript modules shaped so they can later come from that API.
## Architecture Diagram
```mermaid
graph TD
Main["main.tsx: ChakraProvider + ThemeProvider + RouterProvider"] --> Root["routes/__root.tsx: HeadContent + AppShell + Devtools"]
Root --> Shell["components/AppShell.tsx"]
Shell --> Nav["NavigationBar (+ NavLink, MobileNav, navItems)"]
Shell --> Outlet["Outlet (active page route)"]
Shell --> Footer["Footer (placeholder)"]
Outlet --> Home["routes/index.tsx: Hero"]
Outlet --> About["routes/over-mij.tsx: placeholder"]
Home --> Hero["Hero (+ HeroArrows, HeroSocials, useHeroSlider)"]
Hero --> Content["heroContent.ts (static content)"]
Nav --> Scroll["hooks/useScrolledPast"]
Theme["theme.ts + recipes/linkButton.ts"] -.-> Main
Seo["seo.ts: pageHead / siteHead"] -.-> Root
Seo -.-> Home
classDef entry fill:#f6e05e,stroke:#c05621,stroke-width:1px,color:#000;
classDef shell fill:#63b3ed,stroke:#2b6cb0,stroke-width:1px,color:#000;
classDef page fill:#9ae6b4,stroke:#2f855a,stroke-width:1px,color:#000;
classDef support fill:#e2e8f0,stroke:#4a5568,stroke-width:1px,color:#000;
class Main,Root entry;
class Shell,Nav,Footer,Outlet shell;
class Home,About,Hero page;
class Content,Scroll,Theme,Seo support;
```
Text alternative: main.tsx mounts providers and the router; the root route renders AppShell (NavigationBar, the active page via Outlet, Footer); the home route renders the Hero; theme and SEO helpers support all of it.
## Component Descriptions
### main.tsx
- **Purpose**: Application bootstrap
- **Responsibilities**: Creates the router, registers types, mounts ChakraProvider (custom system), next-themes ThemeProvider (light only), loads self-hosted fonts, removes static fallback head tags
- **Dependencies**: routeTree.gen.ts, theme.ts
- **Type**: Application
### routes/__root.tsx
- **Purpose**: Root route / layout
- **Responsibilities**: Site-wide head tags (`siteHead`), renders `HeadContent`, `AppShell` and router devtools
- **Dependencies**: AppShell, seo.ts
- **Type**: Application
### components/AppShell.tsx
- **Purpose**: Application shell
- **Responsibilities**: Renders NavigationBar, `<Outlet />`, Footer. No `<main>` landmark, skip link or to-top button yet
- **Type**: Application
### components/NavigationBar/
- **Purpose**: Site header and navigation
- **Responsibilities**: Fixed header; transparent over the hero on desktop on `/` until scrolled 150px; shrinks after scroll (desktop); swaps dark/light logo; desktop link list with animated underline (`NavLink`); hamburger button and full-screen `MobileNav` below `lg` (Escape to close, body scroll lock, clip-path reveal). `navItems.ts` is the single menu source (currently Home, Over mij)
- **Type**: Application
### components/Footer.tsx
- **Purpose**: Site footer
- **Responsibilities**: Placeholder copyright line only; uses Tailwind-style `className`s that have no effect (Tailwind is not installed)
- **Type**: Application
### components/Hero/
- **Purpose**: Homepage hero slider
- **Responsibilities**: Crossfade slides with zoom, progress bar driven autoplay, arrows, swipe, pause on hover/focus/hidden tab, reduced-motion support, social icons. Content typed in `types.ts` for future API use; `socialPlatforms.ts` maps platform keys to offline Iconify icons
- **Type**: Application
### theme.ts / recipes/linkButton.ts
- **Purpose**: Design system
- **Responsibilities**: Colour, font, spacing, easing, duration tokens; semantic `bg`/`fg`, `header` size tokens; `eyebrow`/`display` text styles; `linkButton` recipe (outline / accent / light)
- **Type**: Application (shared UI foundation)
### seo.ts
- **Purpose**: Head tag helpers
- **Responsibilities**: `pageHead({title, description})` for route `head` options; `siteHead` for site-wide Open Graph tags
- **Type**: Application (utility)
## Data Flow
```mermaid
sequenceDiagram
box rgba(246,224,94,0.4) Browser
participant V as Visitor
end
box rgba(99,179,237,0.4) SPA
participant R as Router
participant S as AppShell
participant P as Page route
end
V->>R: Open URL or click nav link
R->>S: Render root layout
S->>P: Render matched route via Outlet
P-->>R: head() title and meta
R-->>V: Updated page and head tags
```
Text alternative: a visitor navigates, the router renders the root layout (AppShell), which renders the matched page through the Outlet; the page's head() supplies title/meta tags.
## Integration Points
- **External APIs**: None yet (planned .NET API for content and contact form)
- **Databases**: None
- **Third-party Services**: Outbound links only — Facebook, Instagram profiles
## Infrastructure Components
- **CDK Stacks**: None
- **Deployment Model**: Not defined yet; output is a static Vite build (`dist/`)
- **Networking**: N/A
@@ -0,0 +1,47 @@
# Business Overview
## Business Context Diagram
```mermaid
graph LR
Visitor["Website visitor (prospective client)"] --> Site["Andrea Slop Fotografie website (React SPA)"]
Crawler["Search engines and link previews"] --> Site
Site --> Social["Facebook and Instagram profiles"]
Site --> Mail["E-mail (info@andreaslop.nl)"]
Owner["Andrea (photographer, content owner)"] -.-> CMS["Planned .NET API / CMS"]
CMS -.-> Site
classDef person fill:#f6e05e,stroke:#c05621,stroke-width:1px,color:#000;
classDef system fill:#63b3ed,stroke:#2b6cb0,stroke-width:1px,color:#000;
classDef external fill:#9ae6b4,stroke:#2f855a,stroke-width:1px,color:#000;
classDef planned fill:#e2e8f0,stroke:#4a5568,stroke-width:1px,stroke-dasharray:5 5,color:#000;
class Visitor,Owner,Crawler person;
class Site system;
class Social,Mail external;
class CMS planned;
```
Text alternative: visitors and crawlers use the website, which links out to social profiles and e-mail; a planned .NET API/CMS (dashed) will later supply content managed by Andrea.
## Business Description
- **Business Description**: Portfolio and marketing website for Andrea Slop Fotografie, a lifestyle photographer in Huizen (NL). It presents her work (loveshoots, family, pregnancy and newborn shoots), tells who she is, lists shoot types and prices, and gets prospective clients to make contact. It replaces an existing WordPress (Solene theme) site at andreaslop.nl.
- **Business Transactions** (current state — front-end only, no back-end yet):
- **Browse the homepage** — hero slider with featured photos, call-to-action to "Over mij"
- **Navigate between pages** — header navigation (desktop) and hamburger menu (mobile)
- **Visit social profiles** — Facebook / Instagram links in the hero
- **Share / discover pages** — per-page title, meta description and Open Graph tags for search engines and link previews
- *Planned (static design only)*: portfolio browsing with lightbox, shoot types and pricing, contact form, Instagram feed
- **Business Dictionary**:
- **Shell** — the Header / page content / Footer frame shared by every page (see LAYOUT.md)
- **Hero** — full-screen photo slider at the top of the homepage
- **Info menu / side area** — slide-in panel from the design with socials and e-mail (out of scope for this site, by owner decision)
- **Shoot** — a photo session type (newborn, pregnancy, loveshoot, portraits)
- **CMS** — the planned .NET API that will provide page content; content is hard-coded until then
## Component Level Business Descriptions
### web (React front-end)
- **Purpose**: The public website visitors see
- **Responsibilities**: Page routing, layout shell, homepage hero, SEO head tags, design system (colours, fonts, buttons)
### design/andreaslop-static (reference only)
- **Purpose**: Static HTML/CSS/JS rebuild of the live site, used as the visual and structural source of truth
- **Responsibilities**: Defines page sections, header/footer markup, design tokens and interactions to port to React
@@ -0,0 +1,26 @@
# Code Quality Assessment
## Test Coverage
- **Overall**: None
- **Unit Tests**: None (no test runner installed)
- **Integration Tests**: None
- Verification so far is `tsc` type-checking during `pnpm build` and manual browser checks
## Code Quality Indicators
- **Linting**: Not configured (TypeScript `noUnused*` flags only)
- **Code Style**: Mostly consistent (Prettier: 4 spaces, single quotes). Exception: `routes/over-mij.tsx` uses double quotes and 2-space indent
- **Documentation**: Good inline comments in Dutch explaining intent; README is a stub
## Technical Debt
- `theme.ts` `globalCss.body.height: '250vh'` — temporary scroll-testing hack; forces every page to be 2.5 screens tall
- `components/Footer.tsx` and `routes/over-mij.tsx` use Tailwind-style `className`s (`p-2`, `text-sm`, …) that do nothing — Tailwind is not installed
- `AppShell` has no `<main>` landmark; static design has a skip link targeting `#main`
- Header logo is not a link to the homepage (design: link with aria-label)
- Social links are defined inside `Hero/heroContent.ts`; the footer in the design needs the same links → candidate for shared site-level content
- `NavigationBar.tsx` uses `let [open, setOpen]` (should be `const`)
- Unused Vite starter assets: `assets/hero.png`, `assets/typescript.svg`, `assets/vite.svg`
- Design asset `footer-mark.png` (footer logo) not yet present in `web/src/assets`
## Patterns and Anti-patterns
- **Good Patterns**: design tokens as single source of truth; API-shaped static content; accessible interactions (aria labels, Escape to close, reduced motion, focus-visible handling); shared `navItems` for desktop and mobile
- **Anti-patterns**: no-op `className` usage (see above); global body height hack
@@ -0,0 +1,93 @@
# Code Structure
## Build System
- **Type**: npm-compatible via **pnpm** (lockfile `web/pnpm-lock.yaml`)
- **Configuration**:
- `web/package.json` — scripts `dev` (vite), `build` (`tsc && vite build`), `preview`, `typegen` (Chakra typegen for theme)
- `web/vite.config.js` — TanStack Router plugin (`autoCodeSplitting`) before `@vitejs/plugin-react`; `resolve.tsconfigPaths`
- `web/tsconfig.json` — strict-ish bundler mode, `@/*` → `src/*` alias, `noUnusedLocals/Parameters`, `erasableSyntaxOnly`
- `web/.prettierrc` — 4 spaces, single quotes, semicolons
## Key Classes/Modules
```mermaid
graph TD
Root["routes/__root.tsx"] --> AppShell["components/AppShell.tsx"]
AppShell --> NavigationBar["NavigationBar/NavigationBar.tsx"]
AppShell --> Footer["components/Footer.tsx"]
NavigationBar --> NavLink["NavigationBar/NavLink.tsx"]
NavigationBar --> MobileNav["NavigationBar/MobileNav.tsx"]
NavigationBar --> navItems["NavigationBar/navItems.ts"]
MobileNav --> navItems
NavigationBar --> useScrolledPast["hooks/useScrolledPast.tsx"]
Index["routes/index.tsx"] --> Hero["Hero/Hero.tsx"]
Hero --> HeroArrows["Hero/HeroArrows.tsx"]
Hero --> HeroSocials["Hero/HeroSocials.tsx"]
Hero --> useHeroSlider["Hero/useHeroSlider.ts"]
Hero --> LinkButton["components/LinkButton.tsx"]
HeroSocials --> socialPlatforms["Hero/socialPlatforms.ts"]
classDef shell fill:#63b3ed,stroke:#2b6cb0,stroke-width:1px,color:#000;
classDef page fill:#9ae6b4,stroke:#2f855a,stroke-width:1px,color:#000;
classDef util fill:#e2e8f0,stroke:#4a5568,stroke-width:1px,color:#000;
class Root,AppShell,NavigationBar,Footer,NavLink,MobileNav shell;
class Index,Hero,HeroArrows,HeroSocials page;
class navItems,useScrolledPast,useHeroSlider,LinkButton,socialPlatforms util;
```
Text alternative: the root route renders AppShell (NavigationBar with NavLink/MobileNav/navItems, plus Footer); the index route renders Hero with its arrows, socials, slider hook and the shared LinkButton.
### Existing Files Inventory
- `web/index.html` — HTML entry; static fallback title/meta for non-JS crawlers (`data-fallback`)
- `web/src/main.tsx` — bootstrap: providers, router, fonts, removes fallback head tags
- `web/src/routeTree.gen.ts` — generated by TanStack Router plugin (do not edit)
- `web/src/routes/__root.tsx` — root layout route, site-wide head
- `web/src/routes/index.tsx` — home page (`/`), renders Hero
- `web/src/routes/over-mij.tsx` — about page (`/over-mij`), placeholder content
- `web/src/components/AppShell.tsx` — shell: NavigationBar + Outlet + Footer
- `web/src/components/Footer.tsx` — placeholder footer
- `web/src/components/LinkButton.tsx` — router `Link` styled with `linkButton` recipe
- `web/src/components/NavigationBar/NavigationBar.tsx` — header, logo, desktop nav, hamburger
- `web/src/components/NavigationBar/NavLink.tsx` — desktop nav link with underline animation
- `web/src/components/NavigationBar/MobileNav.tsx` — full-screen mobile menu
- `web/src/components/NavigationBar/navItems.ts` — menu items (Home, Over mij)
- `web/src/components/Hero/*` — hero slider (component, arrows, socials, hook, content, types, platforms)
- `web/src/hooks/useScrolledPast.tsx` — boolean "scrolled past threshold" hook
- `web/src/recipes/linkButton.ts` — Chakra recipe for the square design button
- `web/src/theme.ts` — Chakra system config (tokens, semantic tokens, text styles, recipes)
- `web/src/seo.ts` — `pageHead` / `siteHead` helpers
- `web/src/assets/*` — hero photos, light/dark logos, unused Vite starter assets (`hero.png`, `typescript.svg`, `vite.svg`)
- `web/public/favicon.png`, `web/public/icons.svg` — static public assets
## Design Patterns
### Chakra `chakra()` factory around router `Link`
- **Location**: NavLink, MobileNav, LinkButton
- **Purpose**: Router-aware links with Chakra style props and `_currentPage` / `aria-current` styling
- **Implementation**: `const ChakraLink = chakra(Link)`
### Design tokens + recipes
- **Location**: theme.ts, recipes/
- **Purpose**: Single source for colours, fonts, spacing, motion; reusable component variants
- **Implementation**: `defineConfig` tokens/semanticTokens/textStyles, `defineRecipe` + `useRecipe`
### API-shaped static content
- **Location**: Hero/heroContent.ts + types.ts, navItems.ts
- **Purpose**: Hard-coded content today, swappable for CMS API responses later
- **Implementation**: Plain data objects typed with interfaces; components receive them as props
### Route-level head management
- **Location**: seo.ts, each route's `head` option, `HeadContent` in root
- **Purpose**: Per-page SEO without SSR
## Critical Dependencies
### @chakra-ui/react
- **Version**: ^3.37.0
- **Usage**: All layout and styling
- **Purpose**: Component library and styling system
### @tanstack/react-router (+ router-plugin)
- **Version**: ^1.170.39 / ^1.168.40
- **Usage**: File-based routes, `Link`, `Outlet`, `HeadContent`, `useRouterState`
- **Purpose**: Routing and head management
### @iconify/react + @iconify-icons/ant-design
- **Version**: ^6.0.2 / 2.0.1
- **Usage**: Offline icons in Hero
- **Purpose**: Icons bundled at build time (no API calls)
@@ -0,0 +1,24 @@
# Component Inventory
## Application Packages
- `web` — React 19 SPA (Vite, Chakra UI v3, TanStack Router): the public website
## Infrastructure Packages
- None (no IaC, Docker, or CI/CD configuration present)
## Shared Packages
- None as separate packages. Inside `web`, shared modules are `theme.ts`, `recipes/`, `seo.ts`, `hooks/`, `components/LinkButton.tsx`
## Test Packages
- None
## Reference (non-code)
- `design/andreaslop-static` — static HTML/CSS/JS design reference (not built or deployed)
- `design/AndreaSlopFotografie_React.zip` — archive of design files
## Total Count
- **Total Packages**: 1
- **Application**: 1
- **Infrastructure**: 0
- **Shared**: 0
- **Test**: 0
@@ -0,0 +1,54 @@
# Dependencies
## Internal Dependencies
```mermaid
graph LR
routes["routes/*"] --> components["components/*"]
routes --> seo["seo.ts"]
components --> hooks["hooks/*"]
components --> theme["theme.ts tokens (via Chakra props)"]
components --> assets["assets/*"]
main["main.tsx"] --> theme
main --> routes
classDef app fill:#63b3ed,stroke:#2b6cb0,stroke-width:1px,color:#000;
classDef support fill:#e2e8f0,stroke:#4a5568,stroke-width:1px,color:#000;
class main,routes,components app;
class seo,hooks,theme,assets support;
```
Text alternative: main depends on theme and routes; routes depend on components and seo; components depend on hooks, theme tokens and assets.
### routes depend on components
- **Type**: Compile
- **Reason**: Routes render AppShell (root) and page components
### components depend on theme tokens
- **Type**: Runtime (string token references such as `bg="paper"`, `h="header"`)
- **Reason**: All visual values come from the Chakra system
## External Dependencies
### @chakra-ui/react
- **Version**: ^3.37.0
- **Purpose**: Styling system and UI primitives
- **License**: MIT
### @tanstack/react-router
- **Version**: ^1.170.39
- **Purpose**: Routing
- **License**: MIT
### react / react-dom
- **Version**: ^19.3.0
- **Purpose**: UI runtime
- **License**: MIT
### next-themes
- **Version**: ^0.4.6
- **Purpose**: Colour mode
- **License**: MIT
### @iconify/react, @iconify-icons/ant-design
- **Version**: ^6.0.2, 2.0.1
- **Purpose**: Icons
- **License**: MIT (icons: Ant Design, MIT)
### @fontsource/jost, @fontsource/marcellus
- **Version**: ^5.3.0
- **Purpose**: Self-hosted web fonts
- **License**: OFL-1.1
@@ -0,0 +1,17 @@
# Reverse Engineering Metadata
**Analysis Date**: 2026-10-14T09:58:04Z
**Analyzer**: AI-DLC
**Workspace**: C:\Users\bdslo\Documents\Development\AndreaSlopFotografie
**Codebase Commit**: 8f5841c (branch feature/hero-slider-and-navigation)
**Total Files Analyzed**: 30 (web/src, web config files, design/andreaslop-static shell markup and README)
## Artifacts Generated
- [x] business-overview.md
- [x] architecture.md
- [x] code-structure.md
- [x] api-documentation.md
- [x] component-inventory.md
- [x] technology-stack.md
- [x] dependencies.md
- [x] code-quality-assessment.md
@@ -0,0 +1,28 @@
# Technology Stack
## Programming Languages
- TypeScript — ~6.0.2 — all application code (TSX)
- HTML/CSS/JS — design reference only (`design/andreaslop-static`)
- C# / .NET — planned back-end (not present)
## Frameworks
- React — ^19.3.0 — UI
- Chakra UI — ^3.37.0 (+ @emotion/react ^11.14.0) — styling system and components
- TanStack Router — ^1.170.39 — file-based routing, head management (devtools ^1.167.2)
- next-themes — ^0.4.6 — colour mode provider (fixed to light)
- @fontsource/jost, @fontsource/marcellus — ^5.3.0 — self-hosted fonts
- @iconify/react ^6.0.2 + @iconify-icons/ant-design 2.0.1 — offline icons
## Infrastructure
- None yet; static build output suitable for any static host
## Build Tools
- Vite — ^8.3.0 — dev server and bundler
- @vitejs/plugin-react — ^6.1.1
- @tanstack/router-plugin — ^1.168.40 — route tree generation, code splitting
- @chakra-ui/cli — ^3.37.0 — theme typegen
- pnpm — package manager
- Prettier — ^3.9.9 — formatting
## Testing Tools
- None configured (no test runner, no linter such as ESLint)
+5
View File
@@ -0,0 +1,5 @@
# Active Features
| Type | Name | Status | Branch | Affected Components | Session Start |
|------|------|--------|--------|---------------------|---------------|
| Feature | frontend-shell | 🟡 Operations | feature/frontend-shell | web/src (AppShell, NavigationBar, Footer, Hero socials, new BackToTop/SkipLink/404/error pages, routes, theme.ts, main.tsx), web/vite.config.js, web/package.json | 2026-10-14 |
@@ -0,0 +1,83 @@
# AI-DLC State Tracking
## Project Information
- **Feature Name**: Front-end application shell (header/navigation, footer, shell chrome)
- **Feature Slug**: frontend-shell
- **Project Type**: Brownfield
- **Start Date**: 2026-10-14T09:46:02Z
- **Current Stage**: OPERATIONS - Deployment Setup (awaiting approval)
- **Branch**: feature/frontend-shell
## Workspace State
- **Existing Code**: Yes
- **Programming Languages**: TypeScript (React/TSX)
- **Build System**: pnpm + Vite (`tsc && vite build`)
- **Project Structure**: Single front-end SPA in `web/`; static HTML design reference in `design/andreaslop-static/`; .NET back-end planned but not present
- **Reverse Engineering Needed**: Yes
- **Workspace Root**: C:\Users\bdslo\Documents\Development\AndreaSlopFotografie
## Code Location Rules
- **Application Code**: Workspace root (NEVER in aidlc-docs/) — front-end lives in `web/`
- **Feature Documentation**: aidlc-docs/features/frontend-shell/ only
- **Shared Artifacts**: aidlc-docs/_shared/
- **Structure patterns**: See code-generation.md Critical Rules
## Language Configuration
- **Documentation Language**: English
- **Conversation Language**: User Language (Dutch)
## Extension Configuration
| Extension | Enabled | Decided At |
|---|---|---|
| Security Baseline | Yes | Requirements Analysis |
| Property-Based Testing | Yes (full enforcement) | Requirements Analysis |
## Operations Configuration
- **Include Operations Phase**: Yes
- **Decided At**: Build and Test
### Deployment Setup
- **Included**: Yes
- **Method**: CI/CD (Gitea Actions) — test via SSH/scp to Raspberry Pi nginx, production via FTPS to IIS webhost (manual, release/* only)
## Scope Notes (from user)
- Side area / "Info menu" from the static design is OUT of scope (deliberately left out)
- E-mail address in the mobile menu is OUT of scope (deliberately left out)
## Execution Plan Summary
- **Total Stages**: 13 (excluding Operations)
- **Stages to Execute**: Application Design, Functional Design, NFR Requirements, Code Generation, Build and Test
- **Stages to Skip**: User Stories (single persona, concrete FRs), Units Generation (single unit), NFR Design (small patterns, folded into NFR Requirements + code plan), Infrastructure Design (no infrastructure)
## Stage Progress
### 🔵 INCEPTION PHASE
- [x] Workspace Detection
- [x] Reverse Engineering
- [x] Requirements Analysis
- [x] User Stories - SKIP
- [x] Workflow Planning
- [x] Application Design - EXECUTE (approved)
- [x] Units Generation - SKIP
### 🟢 CONSTRUCTION PHASE
- [x] Functional Design - EXECUTE (approved)
- [x] NFR Requirements - EXECUTE (approved)
- [x] NFR Design - SKIP
- [x] Infrastructure Design - SKIP
- [x] Code Generation - EXECUTE (approved)
- [x] Build and Test - EXECUTE (complete)
### 🟡 OPERATIONS PHASE
- [~] Deployment Setup - EXECUTE (artifacts generated, awaiting approval)
- [ ] Monitoring Setup - EXECUTE
- [ ] Production Readiness Validation - EXECUTE
## Current Status
- **Lifecycle Phase**: OPERATIONS
- **Current Stage**: Deployment Setup
- **Next Stage**: Monitoring Setup
## Reverse Engineering Status
- [x] Reverse Engineering - Artifacts generated on 2026-10-14T09:58:04Z (approved 2026-10-14T10:05:21Z)
- **Artifacts Location**: aidlc-docs/_shared/reverse-engineering/
+704
View File
@@ -0,0 +1,704 @@
# AI-DLC Audit Log — frontend-shell
## Initial User Request
**Timestamp**: 2026-10-14T09:46:02Z
**User Input**: "ik wil met aidlc de shell voor de front-end afmaken"
**AI Response**: "Started AI-DLC workflow. Displayed welcome message and began Workspace Detection."
**Context**: INCEPTION - Workspace Detection (start)
---
## Workspace Detection
**Timestamp**: 2026-10-14T09:46:02Z
**User Input**: "(none — automatic stage)"
**AI Response**: "No existing aidlc-docs/active-features.md or legacy aidlc-state.md found — new AI-DLC workspace. Existing code found in web/ (React 19 + Vite 8 + TypeScript 6, Chakra UI v3, TanStack Router file-based routing, pnpm). Brownfield. No shared reverse engineering artifacts. Request classified as Feature (completing the application shell: header/navigation, side area, footer, to-top, skip link — new user-facing behaviour, no defect reported). Feature slug: frontend-shell. Language preference question written to aidlc-docs/language-preference.md."
**Context**: INCEPTION - Workspace Detection; classification = Feature; next = language preference answer, then Reverse Engineering
**Findings**:
- Shell defined in LAYOUT.md as Header / Page content / Footer
- Current shell: web/src/components/AppShell.tsx renders NavigationBar + Outlet + Footer
- NavigationBar: fixed header, transparent overlay over hero on desktop, sticky shrink after scroll, mobile hamburger menu (MobileNav) — implemented
- Footer: placeholder only (copyright line with Tailwind-style classNames that do nothing)
- Missing vs. static design (design/andreaslop-static): side area / "Info menu" panel, to-top button, skip link + main landmark, mobile-nav e-mail meta, logo link to home, full footer, nav items for Portfolio / Soorten fotoshoots / Contact (routes not yet present)
---
## Workspace Detection - Language Preference and Scope Input
**Timestamp**: 2026-10-14T09:58:04Z
**User Input**: "Ik heb de vragen beantwoord. Het info-menu mag wegblijven. Ook het e-mailadresmag uit het mobiele menu blijven. Die heb ik bewust weggelaten"
**AI Response**: "Read aidlc-docs/language-preference.md: answer A (English documentation, Dutch conversation). Recorded scope decisions: side area / Info menu out of scope; e-mail address in mobile menu out of scope (deliberately omitted). Workspace Detection complete; proceeding to Reverse Engineering."
**Context**: INCEPTION - Workspace Detection complete; Language Configuration stored in aidlc-state.md
---
## Reverse Engineering
**Timestamp**: 2026-10-14T09:58:04Z
**User Input**: "(none — automatic stage start)"
**AI Response**: "Analyzed web/ (30 files incl. config) and design/andreaslop-static shell markup. Generated business-overview.md, architecture.md, code-structure.md, api-documentation.md, component-inventory.md, technology-stack.md, dependencies.md, code-quality-assessment.md and reverse-engineering-timestamp.md in aidlc-docs/_shared/reverse-engineering/. Presented completion message and asked for approval."
**Context**: INCEPTION - Reverse Engineering; awaiting user approval
---
## Reverse Engineering - Approval
**Timestamp**: 2026-10-14T10:05:21Z
**User Input**: "ga verder"
**AI Response**: "Reverse Engineering approved. Proceeding to Requirements Analysis (standard depth)."
**Context**: INCEPTION - Reverse Engineering complete
---
## Requirements Analysis - Clarifying Questions
**Timestamp**: 2026-10-14T10:05:21Z
**User Input**: "(none — stage start)"
**AI Response**: "Intent analysis: Enhancement/New Feature, multiple components within web/, moderate complexity, standard depth. Created inception/requirements/requirement-verification-questions.md with 14 questions (nav items for missing pages, footer content source, footer socials, footer logo, footer menu, to-top button, accessibility, scroll restoration, 404 page, tech debt, testing, security extension opt-in, PBT extension opt-in, Operations phase)."
**Context**: INCEPTION - Requirements Analysis; awaiting answers
---
## Requirements Analysis - Answers Received
**Timestamp**: 2026-10-14T10:17:16Z
**User Input**: "ik heb de vragen beantwoord"
**AI Response**: "Read requirement-verification-questions.md. Answers: Q1 A (placeholder routes), Q2 A (shared siteContent module), Q3 A (text links), Q4 X ('het huidige bestand heeft een witte achtergrond. Als je die wat kan aanpassen zodat de achtergrodnd doorichtig is dan kan hij in de footer erbij. Als dat niet lukt dan zou dat dele uit de footer kunnen. Het lijkt mij sowieso onnodige vulling?'), Q5 C (design links + privacy statement link), Q6 B (to-top with icon), Q7 A (WCAG 2.1 AA shell baseline), Q8 A (scroll restoration), Q9 A (404 page in shell), Q10 A (all tech debt), Q11 A (Vitest + RTL), Q12 A (security extension enabled), Q13 A (PBT extension enabled, full), Q14 C (Operations undecided). Loaded security-baseline.md and property-based-testing.md. Investigated Q4: converted design/andreaslop-static/assets/img/footer-mark.png to transparent in scratchpad (works); found web/src/assets/logo-dark.png is the same monogram and already transparent. Ambiguities detected in Q4 (conditional answer + question about value) and Q5/Q1 (privacy link target does not exist). Created requirement-clarification-questions.md with 2 questions."
**Context**: INCEPTION - Requirements Analysis; awaiting clarification answers
---
## Requirements Analysis - Clarification Answers and Requirements Document
**Timestamp**: 2026-10-14T10:35:01Z
**User Input**: "Ik heb de vragen beantwoord"
**AI Response**: "Read requirement-clarification-questions.md: Clarification 1 = A (reuse logo-dark.png as footer monogram), Clarification 2 = A (placeholder route /privacyverklaring). No remaining contradictions. Measured contrast of design colours: ink.muted 3.19:1 and accent 3.03:1 on paper.alt fail WCAG AA for small text → requirement to use ink.soft / accent.deep instead (deliberate design deviation, NFR-01). Generated inception/requirements/requirements.md with 11 functional and 5 non-functional requirements, security applicability table. User Stories assessed as skip (single visitor persona, requirements already concrete per element). Presented completion message with Request Changes / Add User Stories / Continue options."
**Context**: INCEPTION - Requirements Analysis; awaiting approval
---
## Requirements Analysis - Change Request
**Timestamp**: 2026-10-14T10:41:44Z
**User Input**: "Misschien is het impliciet, maar ik zie het nergens staan. Voor styling moet zovele mogelijk hergebruikt worden en moet Chakra benut worden. Forceer het niet, maar waar handig wel gebruiken."
**AI Response**: "Added NFR-02 'Styling: reuse first, use Chakra where it helps' to requirements.md: reuse existing tokens/textStyles/recipes/components, use Chakra components and layout primitives where they fit, centralise styling that repeats in 2+ places (theme or small shared component), do not force Chakra or add one-off recipes/tokens. Former NFR-02 renamed NFR-02a. Re-presented completion message."
**Context**: INCEPTION - Requirements Analysis; change applied, awaiting approval
---
## Requirements Analysis - Approval
**Timestamp**: 2026-10-14T10:44:41Z
**User Input**: "continue to next stage"
**AI Response**: "Requirements approved. User Stories skipped. Proceeding to Workflow Planning."
**Context**: INCEPTION - Requirements Analysis complete
---
## Workflow Planning
**Timestamp**: 2026-10-14T10:44:41Z
**User Input**: "(none — stage start)"
**AI Response**: "Created inception/plans/execution-plan.md. EXECUTE: Application Design (minimal), Functional Design (minimal, PBT-01), NFR Requirements (minimal, PBT-09/SECURITY-04/10), Code Generation, Build and Test. SKIP: User Stories, Units Generation (single unit), NFR Design (patterns small, folded into NFR Requirements + code plan), Infrastructure Design (no infra). Operations: Undecided. Risk: Low. Presented plan for approval."
**Context**: INCEPTION - Workflow Planning; awaiting approval
---
## Workflow Planning - Approval and Branch Handling
**Timestamp**: 2026-10-14T10:51:43Z
**User Input**: "De huidige branch moet inderdaad nog worden afgesloten zodat we op een nieuwe branch kunnen werken. Kan jij dat doen of moet ik dta zelf doen? Verder ziet het er goed uit en mag je verder naar de volgende stage"
**AI Response**: "Execution plan approved. Asked how to close the branch (AskUserQuestion). User chose: 'PR op Gitea, ik merge' and 'Lokaal + remote verwijderen'. Created Gitea PR #2 (feature/hero-slider-and-navigation -> master; first attempt rejected by Gitea DB because of a 4-byte emoji in the body, retried without emoji), merged fast-forward-only (master = 8f5841c) with remote branch deletion. Local SSH to origin not available from agent shells, so master was fast-forwarded locally to the same commit, origin/master ref aligned to the API-confirmed sha, stale remote-tracking ref and local branch deleted. Created local branch feature/frontend-shell from master (not pushed). Updated branch in aidlc-state.md and active-features.md."
**Context**: INCEPTION - Workflow Planning complete; branch feature/frontend-shell
---
## Application Design - Plan and Questions
**Timestamp**: 2026-10-14T10:51:43Z
**User Input**: "(none — stage start)"
**AI Response**: "Created inception/plans/application-design-plan.md (minimal depth) with 9 questions: folder structure, content module location, content provisioning (props/import/context), footer menu location, placeholder page component, status page component, footer link styling (Chakra link recipe variant), shared RouterLink refactor, hover-opacity pattern. Pre-decided per NFR-02: Chakra SkipNavLink/SkipNavContent for skip link + main, reuse useScrolledPast, LinkButton, eyebrow text style."
**Context**: INCEPTION - Application Design; awaiting answers
---
## Application Design - Answers and Artifacts
**Timestamp**: 2026-10-14T21:20:36Z
**User Input**: "ik heb de vragen beantwoord. Ga verder en commit alle changes"
**AI Response**: "Read application-design-plan.md: all 9 answers A (Q9 A = centralise hover pattern, against the recommendation — user choice). No ambiguities. Revised FR-04 in requirements.md (menus are code in navigation.ts, not siteContent). Verified TanStack Router not-found/error rendering in node_modules Match.js (global not-found renders in root Outlet, shell stays). Generated inception/application-design/components.md, component-methods.md, services.md, component-dependency.md, application-design.md. Marked plan steps complete. Committing all changes per user request and presenting completion message."
**Context**: INCEPTION - Application Design; artifacts generated, awaiting approval
---
## Session Resume
**Timestamp**: 2026-10-18T09:04:08Z
**User Input**: "kan je met aidlc verdergaan met de openstaande feature?"
**AI Response**: "Resumed feature frontend-shell (only active item, treated as option A). active-features.md (Inception) consistent with aidlc-state.md (Application Design awaiting approval). Loaded application-design.md and audit history. Re-presented the Application Design completion message; awaiting explicit approval before starting Functional Design."
**Context**: INCEPTION - Application Design; awaiting approval
---
## Application Design - Approval
**Timestamp**: 2026-10-18T09:08:25Z
**User Input**: "ga verder naar het volgende onderdeel"
**AI Response**: "Application Design approved. Marked complete in aidlc-state.md; Units Generation skipped (single unit 'frontend-shell'). Started CONSTRUCTION - Functional Design for unit frontend-shell."
**Context**: INCEPTION - Application Design complete; CONSTRUCTION - Functional Design started
---
## Functional Design - Plan and Questions
**Timestamp**: 2026-10-18T09:08:25Z
**User Input**: "(none — stage start)"
**AI Response**: "Created construction/plans/frontend-shell-functional-design-plan.md and construction/plans/frontend-shell-fd-questions.md (12 questions): 404 head mechanism, BackToTop focus after click, BackToTop hide/show animation, BackToTop hover colour, social href validation, empty-content behaviour, footer active state, placeholder copy, 404 copy, error page actions, error logging, footer e-mail display."
**Context**: CONSTRUCTION - Functional Design; awaiting answers
---
## Functional Design - Answers and Clarification
**Timestamp**: 2026-10-18T09:34:55Z
**User Input**: "ik heb de vragen beantwoord"
**AI Response**: "Read frontend-shell-fd-questions.md. Answers: Q1 A, Q2 A, Q3 A, Q4 'A, al vind ik de knop en z'n kleuren nu sowieso niet heel erg duidelijk en vraga me af of die niet wegvalt. Daarbij komt dat op een 32:9 scherm de knop nog steeds helemaal rechtsonderin getoond wordt terwijl de content een max width heeft.', Q5 A, Q6 'A, verder wil ik kijken hoe we het e-mailadres zo veilig mogelijk kunnen plaatsen om te beschermen tegen spam. Dat is nu namelijk ook al een probleem.', Q7 B, Q8 A, Q9 A, Q10 B, Q11 A, Q12 'x, bij vraag 6 heb ik ook al een opmerking geplaatst. Wat is de veiligste manier om het e-mailadres te tonen? Geef mij aanbevelingen'. Created frontend-shell-fd-clarification-questions.md with 4 questions: to-top appearance, to-top position on ultrawide screens, e-mail anti-spam display technique (with comparison of techniques and recommendation), recording out-of-scope follow-ups."
**Context**: CONSTRUCTION - Functional Design; awaiting clarification answers
---
## Functional Design - Clarifications and Artifacts
**Timestamp**: 2026-10-18T09:48:15Z
**User Input**: "ik heb de vragen beantwoord"
**AI Response**: "Read frontend-shell-fd-clarification-questions.md. Answers: CQ1 A, CQ2 A, CQ3 'A, verder ter info: techniek 4 is al toegepast met dit specifieke e-mailadres.', CQ4 'A, maar techniek 4 is al (deels) toegepast. info@andreaslop.nl is al een mailadres specifiek voor de website.' No remaining ambiguities. Generated construction/frontend-shell/functional-design/domain-entities.md, business-rules.md (incl. Testable Properties for PBT-01), business-logic-model.md (incl. recommendations outside this feature), frontend-components.md. Refinements: SiteContent.email becomes { user, domain } (FR-04 updated), StatusPage action prop becomes actions ReactNode, to-top styling/position deviates from design (FR-06 updated), ErrorPage also gets own title + noindex."
**Context**: CONSTRUCTION - Functional Design; artifacts generated, awaiting approval
---
## Functional Design - Change Request
**Timestamp**: 2026-10-18T10:16:26Z
**User Input**: "De footerIntro tekst mag worden `Lifestyle fotograaf uit Huizen. Ik leg jouw mooiste momenten vast.`
Ik zie niks staan over SEo-optimalisatie en screenreader-optimalisatie of Responsive design. Ik wil dat daar meteen rekening me egehouden wordt zodat we dat niet achteraf nog moeten toevoegen.
Denk ook aan het gebruik van chakra en het thema om redundatie zoveel mogelijk te voorkomen."
**AI Response**: "Request Changes. Updated footerIntro in domain-entities.md and requirements.md (FR-05). Created construction/plans/frontend-shell-fd-change-questions.md: listed SEO/screen-reader/responsive/reuse items that will be designed without a question, plus 6 questions with trade-offs: prerendering for link previews, canonical domain, og:image, JSON-LD structured data, robots.txt/sitemap.xml, route-change announcement for screen readers."
**Context**: CONSTRUCTION - Functional Design; change request, awaiting answers
---
## Functional Design - Change Answers and Revised Artifacts
**Timestamp**: 2026-10-18T10:32:08Z
**User Input**: "ik heb de vragen beantwoord"
**AI Response**: "Read frontend-shell-fd-change-questions.md. Answers: Q1 A, Q2 A, Q3 A, Q4 A, Q5 'B is het makkelijkste. Hoeveel meerwerk is het en hoe wordt het automatisch opgebouwd? Hoe betrouwbaar is het? Bij teveel gedoe of onzekerheden is A het beste. Anders B, met eventueel de test uit optie A', Q6 A. Assessed Q5: verified TanStack Router head supports links and scripts; chose B via a single sitePages registry + small Vite plugin + sync test (low effort, no extra dependency, reliable). Updated functional design: domain-entities.md (site config, sitePages registry, JSON-LD), business-rules.md (BR-SEO-01..11, BR-A11Y-01..07, BR-RWD-01..05, BR-THEME-01..07, extra testable properties for canonicalUrl, sitemapXml, jsonLdScript), business-logic-model.md (flows 5 focus on page change, 6 build-time SEO files; recommendations prerendering and responsive images), frontend-components.md (useRouteFocus, root head, route heads, responsive table checked against design CSS, theme usage table). Footer headings set to h2 (corrects the note in the change-question file). requirements.md: FR-12, FR-13, NFR-06 added."
**Context**: CONSTRUCTION - Functional Design; revised artifacts, awaiting approval
---
## Functional Design - Approval
**Timestamp**: 2026-10-18T10:40:10Z
**User Input**: "goedgekeurd, ga verder"
**AI Response**: "Functional Design approved. Marked complete in aidlc-state.md. Started CONSTRUCTION - NFR Requirements for unit frontend-shell."
**Context**: CONSTRUCTION - Functional Design complete; NFR Requirements started
---
## NFR Requirements - Plan and Questions
**Timestamp**: 2026-10-18T10:40:51Z
**User Input**: "(none — stage start)"
**AI Response**: "Created construction/plans/frontend-shell-nfr-requirements-plan.md with pre-decided items (test stack per PBT-09, security headers, production CSP, devtools dev-only, sitemap plugin in vite.config.ts) and 8 questions: CSP in dev, next-themes removal (verified it injects an inline script), Lighthouse targets, axe testing, ESLint, browser support, coverage, dependency audit script."
**Context**: CONSTRUCTION - NFR Requirements; awaiting answers
---
## NFR Requirements - Answers and Clarification
**Timestamp**: 2026-10-18T10:51:59Z
**User Input**: "ik heb de vragen beantwoord"
**AI Response**: "Read frontend-shell-nfr-requirements-plan.md. Answers: Q1 A, Q2 A, Q3 B, Q4 A, Q5 A, Q6 'Begin met optie A. B zou later nog kunnen met name voor de mobiele versies.', Q7 A, Q8 A. Q6 interpreted as A now, B recorded as possible follow-up. Q3 B ambiguous on when Lighthouse CI runs (every build vs pre-release check); created frontend-shell-nfr-clarification-questions.md with 1 question, noting SEO 100 target applies to indexed pages only."
**Context**: CONSTRUCTION - NFR Requirements; awaiting clarification
---
## NFR Requirements - Clarification Answer and Artifacts
**Timestamp**: 2026-10-18T10:58:52Z
**User Input**: "ik heb de vraag beantwoord"
**AI Response**: "Read clarification answer: 'A, er vanuitgaand dat ik lokaal de check kan draaien zodat ik tussendoor ook een check kan doen. Ik vraag me alleen wel af of een automatische check vlak voor release niet te laat is. Stel ik doe onderhoud en vergeet dat ik die check moet doen. Dan zie ik dat pas vlak voor release. Als het standaard in CI/CD workflow wordt meegenomen als bijvoorbeeld de laatste stap, dan hoeft het niks in de weg te zitten.' Resolved: pnpm lighthouse + pnpm check runnable locally at any time; CI/CD running pnpm check as final step on every push recorded as follow-up for Deployment Setup. Generated nfr-requirements/nfr-requirements.md and nfr-requirements/tech-stack-decisions.md."
**Context**: CONSTRUCTION - NFR Requirements; artifacts generated, awaiting approval
---
## NFR Requirements - Approval
**Timestamp**: 2026-10-18T10:59:54Z
**User Input**: "Goedgekeurd, ga verder"
**AI Response**: "NFR Requirements approved. NFR Design and Infrastructure Design skipped per execution plan. Started CONSTRUCTION - Code Generation Part 1 (Planning) for unit frontend-shell."
**Context**: CONSTRUCTION - NFR Requirements complete; Code Generation planning started
---
## Code Generation - Plan Approval Prompt
**Timestamp**: 2026-10-18T11:00:58Z
**User Input**: "(none — plan created)"
**AI Response**: "Created construction/plans/frontend-shell-code-generation-plan.md: 31 steps in 7 parts (A tooling/config, B theme, C content + pure logic + PBT, D shared primitives/hooks, E components + tests incl. axe, F routes/entry/static files, G docs + unit verification). Asked for plan approval (Request Changes / Approve Plan)."
**Context**: CONSTRUCTION - Code Generation Part 1; awaiting plan approval
---
## Code Generation - Plan Approval
**Timestamp**: 2026-10-18T11:07:51Z
**User Input**: "heb je voor de preofessionalservice nog content nodig? Of is dat iets wat ik later handmatig moet in- of aanvullen?
Ziet er verder goed uit. Dus als je niks nodig hebt mag je verder."
**AI Response**: "Answered: no extra content needed for ProfessionalService (name, url, logo, image, locality/country, areaServed, sameAs, description from home meta description all available); optional later additions: telephone, priceRange, openingHours, full address (advised to omit when working from home). Plan approved; starting Code Generation Part 2."
**Context**: CONSTRUCTION - Code Generation; plan approved, generation started
---
## Code Generation - Generation Complete
**Timestamp**: 2026-10-18T11:48:36Z
**User Input**: "(none — generation)"
**AI Response**: "Executed all 31 plan steps. Verification: lint 0 issues (72 files), Prettier clean, 77 tests in 17 files pass incl. PBT and axe, 100% coverage thresholds on pure functions met, build OK, sitemap.xml generated, e-mail address absent from dist, devtools absent from dist, pnpm audit --prod clean. Fixed during verification: Chakra Image width/height were style props (logo rendered 500px high) -> htmlWidth/htmlHeight; typegen output lost on reinstall -> postinstall typegen; footer accessible name lost a space; hero loaded all 6 slides at once -> others load after first photo painted (mobile LCP 19.7s -> 4.2s); source-map-js override. Unresolved, needs user decision: (1) mobile Lighthouse performance on / is 0.81 vs target 0.9 (all other pages and all desktop pass); (2) pnpm audit:deps fails on 5 high dev-only advisories (4 via @lhci/cli, 1 via pre-existing @chakra-ui/cli), no fix available for most. Presented completion message."
**Context**: CONSTRUCTION - Code Generation; awaiting approval and 2 decisions
---
## Code Generation - Change Request (hero images, audit)
**Timestamp**: 2026-10-18T12:06:47Z
**User Input**: "1. Ik heb hero-5.jpg vervangen voor een webversie die een stuk kleiner is.
2. Ik snap niet zo goe dhoe developer tools de productiescore beinvloeden.
Verder heb ik 2 afbeeldingen toegevoegd aan de hero. Dat zijn er nu totaal 8. Maakt dat uit? Is er een max die je aan zou raden vanuit performance-oogpunt?"
**AI Response**: "Rebuilt and re-measured: home mobile performance 0.82 (unchanged; deferred slides load after LCP), total download 2.6 MB. Explained dev tools never ship; audit:deps fails because it scans all packages incl. dev-only tools; prod audit clean. Advised just-in-time slide loading instead of a maximum; 5-8 slides fine, 150-250 KB per photo. Created construction/plans/frontend-shell-code-change-questions.md with 3 questions (mobile performance approach, audit gate scope, hero slide loading)."
**Context**: CONSTRUCTION - Code Generation; change request, awaiting answers
---
## Code Generation - Change Answers Applied
**Timestamp**: 2026-10-18T12:17:47Z
**User Input**: "ik heb de vragen beantwoord"
**AI Response**: "Answers: Q1 'B, omdat de data later uit een API komt weet ik niet of responseive foto's met een vite-plugin toevoegen verstandig is voor een tijdelijke situatie. Prerendering pakken we sowieso later op.', Q2 A, Q3 'A, maar je kan vanaf de eerste foto ook terug-klikken naar de laatste foto, dus de actieve foto + de volgende en vorige (of laatste in geval van eerste foto) wil je laden.' Applied: lighthouserc.cjs home mobile >= 0.8, new lighthouserc.desktop.cjs keeps 0.9; audit:deps --prod (blocking) + audit:dev (report only); lib/slidesToLoad (active, next, previous wrapping) with PBT, Hero uses it after first paint. Updated NFR-P-01, NFR-SEC-05, follow-up responsive images via API/CMS, BR-HERO-01, code-summary. Full pnpm check exit 0: lint, format, 82 tests in 18 files, build, audit, Lighthouse mobile+desktop. Home mobile 0.81, download 2.6 MB -> 1.2 MB."
**Context**: CONSTRUCTION - Code Generation; changes applied, awaiting approval
---
## Code Generation - Footer Brand Column Review
**Timestamp**: 2026-10-18T14:04:37Z
**User Input**: "De eerste kolom van de footer ziet er gek uit met die tekst onder de afbeelding. De 2 zinnetjes onder elkaar zetten of mnisschien de afbeelding in het midden uitlijnen zal het beter maken gok ik. heb je een suggestie?" / "Ik kan nog geen echte keuze maken, want de varianten op de tablet geven een error-afbeelding dus ik weet niet hoe dat er op een tabelt uit ziet. Zelfde voor mobile schermen. Die heb je helemaal niet gemaakt met de varianten" / "Ik heb even gekeken. ik vind optie C het mooiste, behalve voor mobiel. Daar is B het beste. Dus Optie C voor table en desktop en optie B voor mobiel"
**AI Response**: "First variant renders were broken (compile error overlay; tablet shown as error, mobile missing) - acknowledged. Re-rendered current/A/B/C (+ D) with puppeteer-core device emulation at 390/820/1440 px; no horizontal overflow at any width. Implemented user choice: mobile centred stacked (B), tablet/desktop logo 110px beside text (C); footerIntro split into two lines in content with whiteSpace pre-line. Noted remaining tablet issues (orphan word, Contact alone on second row) and offered full-width brand block on tablet. Lint, format, 82 tests, build pass. Docs updated."
**Context**: CONSTRUCTION - Code Generation; footer change applied, awaiting approval
---
## Code Generation - Approval
**Timestamp**: 2026-10-18T14:22:30Z
**User Input**: "dat ziet er goed uit. ga verder"
**AI Response**: "Code Generation approved (tablet full-width brand option not requested; footer stays as chosen). Marked complete. Started CONSTRUCTION - Build and Test."
**Context**: CONSTRUCTION - Code Generation complete; Build and Test started
---
## Build and Test Stage
**Timestamp**: 2026-10-18T14:33:42Z
**Build Status**: Success (clean install with --frozen-lockfile; postinstall typegen verified)
**Test Status**: Pass. pnpm check exit 0 in 225 s: lint, format, 82 tests in 18 files (18 property tests, seed logged), build, audit:deps clean, Lighthouse mobile+desktop pass. Home mobile 82 (target 80), other pages 94-95 mobile / 100 desktop. Security headers verified on preview with curl; e-mail and devtools absent from dist. Added PBT-08 seed logging on every run (config/testSeed.ts, FC_SEED replay). Manual keyboard/screen-reader check handed to owner.
**Files Generated**:
- build-instructions.md
- unit-test-instructions.md
- integration-test-instructions.md
- performance-test-instructions.md
- security-test-instructions.md
- manual-test-instructions.md
- build-and-test-summary.md
**Operations Phase Decision**: Undecided (asked now, Variant C)
---
## Build and Test - Manual Test Results
**Timestamp**: 2026-10-18T14:52:32Z
**User Input**: "K1: De knop wordt wel gefocust, maar ik zie niet in beeld komen "Direct naar inhoud"
K2: Ik weet niet wat er zou moeten gebeuren, we hebben nog geen inhoud, maar de volgende tab gaat eerst door de navigation menu heen en niet naar de inhoud of nu dan de footer, klopt dat?
K3-6: Dat ziet er goed uit
K7-8: Te weinig content en kan ik nog niet testen op desktop. Op mobiel met de screenreader deed deze het wel zoals verwacht.
K9: Gaat ide goed doorheen
Screen reader ziet er goed uit, behalve de kopjes in de footer. SOCIALS wordt opgelezen als loss eletters. Waarshcijnlijk omdat het alleen hoofdletters zijn. CONTACT doet die wel goed. Responsiveness ziet er ook goed uit"
**AI Response**: "Reproduced K1 with puppeteer keyboard input: skip link focused and positioned but covered by the fixed header (Chakra skipNavLink recipe sets no z-index). Fixed in recipes/skipNavLink.ts (zIndex skipNav, margin 0); verified not covered, rect 0,0. K2 not reproducible: after Enter focus is on main, next Tab goes to first focusable after main (footer on placeholders, 'Lees meer' on home); only deviation when URL already has #main (browser sets focus start point). Asked user to retest K1/K2 without #main. SOCIALS spelled out: CSS uppercase read as acronym by mobile screen readers; created construction/plans/frontend-shell-bt-questions.md (aria-label / 'Social media' / 'Volg mij')."
**Context**: CONSTRUCTION - Build and Test; fixing manual test findings
---
## Build and Test - Retest and Socials Fix
**Timestamp**: 2026-10-18T14:56:51Z
**User Input**: "k2 skipped nu het menu en hij zet de focus bij de eerstvolgende tab in de Hero. dus dat is nu wel goed. K1 is ook gefixed.
Verder heb ik de vraag ook beantwoord"
**AI Response**: "K1/K2 confirmed fixed by owner. Question 1 answered A: added aria-label={title} to FooterColumn h2 headings; Footer test asserts the labels. Lint, format, 82 tests, build pass. Updated build-and-test-summary.md with manual test results. Asked owner to retest 'Socials' on mobile screen reader and for the Operations decision."
**Context**: CONSTRUCTION - Build and Test; awaiting retest and Operations decision
---
## Build and Test - Socials Retest
**Timestamp**: 2026-10-18T15:02:17Z
**User Input**: "Hij spreekt Socials op mijn device wel goed uit nu. Op de desktop (Windows) leest hij nog steeds de losse letters, maar de tekst SOCIALS is visueel wel mooier dan Social Media. dus dat mag zo blijven. Die ene tekst in de footer is niet zo;n ramp"
**AI Response**: "Recorded: mobile reads 'Socials' correctly; Windows desktop still spells it out; accepted known issue by owner. Summary updated (no open items). Operations decision still pending; re-asked."
**Context**: CONSTRUCTION - Build and Test; awaiting Operations decision
---
## Operations - Decision and Deployment Setup Start
**Timestamp**: 2026-10-18T15:06:16Z
**User Input**: "commit de huidige changes en ga verder met de Operations Fase. We moeten in ieder geval de CI/CD opzetten. En misschien dat ik meteen logging an monitoring wel toevoegen"
**AI Response**: "Committed on feature/frontend-shell (not pushed): 4d6408b (code) and 069c7cb (AI-DLC docs). Operations Configuration set to Yes (Decided At: Build and Test); active-features status Operations. Context: self-hosted Gitea at gitea.slpsoftware.nl, no CI config, empty api/, core.autocrlf=true without .gitattributes (CRLF vs Prettier LF risk). Created operations/plans/deployment-setup-plan.md with 8 questions (inclusion, CI system, runner, hosting, environments, trigger, Lighthouse in pipeline, rollback); .gitattributes eol=lf pre-decided."
**Context**: OPERATIONS - Deployment Setup; awaiting answers
---
## Deployment Setup - Answers and Clarification
**Timestamp**: 2026-10-18T19:05:12Z
**User Input**: "Ik heb de vragen beantwoord"
**AI Response**: "Read deployment-setup-plan.md answers: A | A | A | X, voor productie wordt dat een webhoster met ftp/sftp toegang. Voor de testomgeving heb ik een eigen server, maar heb ik eventueel ook toegang met ftp/sftp. Ik heb alleen maar 1 website die ik kan hosten dus zodra ik de API ga bouwen die uit een ander project gaat komen moet de website als static files worden geserveerd door de API. Dit is een pagina met meer info over de webhost: https://www.mijnhostingpartner.nl/pg/info/aspnet-core-hosting/ en het gaat dan om het ASP.NET Core 10 Hosting pakket | B | B, ik wil de gitflow gaan toepassen. Naar test moet altijd kunnen. Zodat er makkelijk en snel een specifieke versie op de test-omgeving gedeployed of geredeployed kan worden. Naar productie mag alleen vanaf een release-branch. DIe branch wordt daarna teruggemerged naar develop en master en op master wordt dan een tag gezet. Ik heb ook van trunk-based gehoord. het zou kunnen dat dat praktischer is. Ik laat mij graag aanbevelen wat handiger is voor mij. | ik heb een headless browser op de gitea/buildserver staan. Als het goed is is dat chrome, maar niet meer helemaal zeker. | B als dat kan en ook gezien de database. Ik weet niet of er via de pipeline een migratie kan worden gedaan en ook terug worden gedraaid zodra we een API hebben?. Fetched hosting package page (Windows 2016/2019, URL Rewrite = IIS, 1 website, MSSQL/MySQL/MariaDB 50MB; FTP/SFTP not mentioned). Created operations/plans/deployment-clarification-questions.md: branching strategy (recommend trunk-based with release tags), go-live timing (first prod deploy replaces current site), transfer method to host, test server OS, Chromium in runner; plus info on EF Core migrations and roll-forward rollback."
**Context**: OPERATIONS - Deployment Setup; awaiting clarification answers
---
## Deployment Setup - Clarifications and Artifacts
**Timestamp**: 2026-10-18T19:27:28Z
**User Input**: "ik heb de vragen beantwoord"
**AI Response**: "Clarification answers: CQ1 X (master + feature/* + release/*, no develop; PR merge auto-deploys to test; manual test deploy from any branch), CQ2 A (current site on other host, go-live by DNS switch), CQ3 B (FTPS; hoster KB: port 21, TLS, wwwroot), CQ4 B (Raspberry Pi nginx behind reverse-proxy Pi), CQ5 runner raspberry-pi-arm64 labels linux-arm64/ubuntu-latest, reference projects SlpSoftware and SlpModularCms (Podman runner: container actions fail with 409, use shell steps; sshpass/scp pattern). Created .gitea/workflows/continuous_integration.yaml (check, lighthouse, deploy-test, deploy-production), web/config/serverConfig.ts + writeServerConfig.ts + test (generated web/deploy/iis/web.config and web/deploy/nginx/andreaslop-test.conf from securityHeaders), .gitattributes eol=lf, packageManager pnpm@12.11.2 (lockfile now pins pnpm). Found and fixed: LHCI_COLLECT__SETTINGS__* env replaced the desktop preset (verified locally); chrome flags now via LIGHTHOUSE_CHROME_FLAGS read in lighthouserc. Docs: operations/deployment/deployment-plan.md, deployment-instructions.md, rollback-plan.md. Lint, format, 88 tests, build pass. Not verifiable from here: Chromium in runner container, lftp TLS with hoster certificate, Pi write permissions."
**Context**: OPERATIONS - Deployment Setup; artifacts generated, awaiting approval
---
## Deployment Setup - Test/Production Parity
**Timestamp**: 2026-10-18T19:56:29Z
**User Input**: "Waarom doen we op de test-omgeving vergelijkbaar met de andere projecten en niet zo dichtbij mogelijk bij de productie-omgeving?" / "Een sub-domein telt als een extra website. In het pakket wat ik wi lheb ik er maar 1 dus het subdomein zal ik op de pi blijven hosten. Uiteindelijk gaat het erom dat de website getest kan worden. Als de deployment anders is omdat de omgeving anders is is dat prima. Als er op test maar niks wordt gedaan wat op productie niet kan of het moet goed gedocumenteerd worden als het gaat om handmatig vs automatisch"
**AI Response**: "Acknowledged test choice was based on CQ4 and reference projects without explicit parity weighing; explained identical vs different parts and IIS/FTPS-specific risk; offered options. Owner keeps test on Pi. Added 'Test vs Production' section to deployment-plan.md (identical parts, difference table with automatic/manual per aspect, IIS risk mitigation via dress rehearsal before go-live); flagged symlink rollback as test-only capability in plan and rollback-plan.md; added dress-rehearsal step to go-live in deployment-instructions.md."
**Context**: OPERATIONS - Deployment Setup; awaiting approval
---
## Deployment Setup - Simpler Test Deploy
**Timestamp**: 2026-10-18T20:18:00Z
**User Input**: "De opzet voor de testomgeving mag simpeler dan de andere apps. hij hoeft geen oud eversies tebewaren. het is maar een testomgeving. De productie site draait wel daar, maar dat is een wordpress website dus dat moet niet gaan conflicteren"
**AI Response**: "Interpreted 'daar' as the Raspberry Pi. Replaced release folders + symlink with empty-and-copy deploy to DEPLOY_PATH_TEST; added guard refusing empty path, '/', paths with spaces, or folders containing wp-config.php/wp-content (verified locally on 5 cases incl. a WordPress folder left intact). nginx test block root /var/www/andreaslop-test, never default_server (test added). Rollback on test now same pipeline route as production. Updated deployment-plan (D8, D13, difference table incl. WordPress neighbour), deployment-instructions 1.2, rollback-plan. Lint, format, tests pass."
**Context**: OPERATIONS - Deployment Setup; awaiting approval
---
## Deployment Setup - Test Path
**Timestamp**: 2026-10-18T21:13:04Z
**User Input**: "in het plan zie ik staan /var/ww/andreaslop-test, maar het moet worden /var/ww/html/andreaslop-test"
**AI Response**: "Interpreted as /var/www/html/andreaslop-test. Replaced in serverConfig.ts (nginx root), regenerated deploy/nginx/andreaslop-test.conf, deployment-instructions.md (variable example, mkdir/chown). Config tests pass. Flagged: if /var/www/html is the WordPress web root, the test folder becomes reachable as a subfolder of the WordPress site; asked owner to confirm WordPress root."
**Context**: OPERATIONS - Deployment Setup; awaiting approval
---
## Deployment Setup - nginx Config Location
**Timestamp**: 2026-10-18T21:16:29Z
**User Input**: "Het pad naar de config is ` /etc/nginx/conf.d/andreaslop-test.conf` en niet de sites-available folder"
**AI Response**: "Updated deployment-instructions.md step 1.2: copy to /etc/nginx/conf.d/andreaslop-test.conf (loaded automatically, no sites-enabled symlink), with cp command and note to re-copy after pnpm server-config."
**Context**: OPERATIONS - Deployment Setup; awaiting approval
---
## Deployment Setup - Reverse Proxy Check
**Timestamp**: 2026-10-18T21:18:22Z
**User Input**: "op de eigen server draai ik een raspbedrry pi met nginx als reverse proxy. Daar laat ik ook de ssl certificaten genereren met certbot/lets encrypt. Dan op de hostende server zorge ik dat de boel naar de juiste folder gaat. Klopt dan de huidige configuiratie nog?"
**AI Response**: "Reviewed chain proxy (TLS, certbot) -> hosting Pi nginx :80 -> folder. Config holds; two additions: proxy must pass Host header (else default block = WordPress answers), and absolute_redirect off on the backend so nginx redirects stay relative behind the proxy. Added absolute_redirect off + comment to serverConfig.ts generator with a test, regenerated deploy/nginx/andreaslop-test.conf; added proxy server block example, certbot command and 'do not duplicate headers on proxy' to deployment-instructions.md step 1.2.4."
**Context**: OPERATIONS - Deployment Setup; awaiting approval
---
## Deployment Setup - Reverse Proxy Config File
**Timestamp**: 2026-10-18T21:20:15Z
**User Input**: "heb ik voor de reverse proxy, die ook nginx draait, dan ook niet een config bestand nodig? Doe het alleen voor http, certbot maakt daar wel https van met ssl"
**AI Response**: "Added nginxProxyConf() to the generator: web/deploy/nginx/test.andreaslop.nl.proxy.conf (HTTP only, Host header + X-Forwarded-*, placeholder HOSTING_PI_ADDRESS, no security headers). Tests: Host header present, no add_header, same server_name as test block (regex anchored after a comment false match). Instructions 1.2.4 now install this file, replace placeholder, run certbot, and warn not to re-copy after certbot. Deployment plan D11 and difference table updated. 14 config tests pass."
**Context**: OPERATIONS - Deployment Setup; awaiting approval
---
## Deployment Setup - Test Fix
**Timestamp**: 2026-10-18T21:20:55Z
**User Input**: "(none — self-review)"
**AI Response**: "Found that the hostname test passed vacuously: sed dropped the backslash (^s* instead of ^\s*), so both matches were undefined. Fixed regex, asserted the proxy hostname is test.andreaslop.nl, and verified by mutation that a differing hostname makes the test fail. 14 config tests pass, format clean."
**Context**: OPERATIONS - Deployment Setup; awaiting approval
---
## Deployment Setup - Hosting Pi Address
**Timestamp**: 2026-10-18T21:23:42Z
**User Input**: "Ik heb HOSTING_PI_ADDRESS ingevuld in het test config bestand. die kan je voor de volgende kee rook aanhouden"
**AI Response**: "Owner filled 192.168.1.103 in the generated proxy config; drift test caught it. Moved the address into config/serverConfig.ts (hostingPiAddress), regenerated deploy/nginx/test.andreaslop.nl.proxy.conf (same content), removed placeholder instructions and the sed step from deployment-instructions.md 1.2.4. 14 config tests pass."
**Context**: OPERATIONS - Deployment Setup; awaiting approval
---
## Deployment Setup - Commit and Push
**Timestamp**: 2026-10-18T22:18:51Z
**User Input**: "commit ook de operations changes en push dan. Dan kan ik gaan kijken of de workflow werkt. Werkt dat of moet die workflow eerst op master komen?"
**AI Response**: "Set up ssh-agent via ~/.ssh/agent.env (owner added key in own Git Bash). Lint, format, 93 tests, build and workflow YAML pass. Committing operations work (pipeline, .gitattributes, server config generator + generated configs, deployment docs) on feature/frontend-shell and pushing the branch to origin."
**Context**: OPERATIONS - Deployment Setup; commit and push for pipeline verification
---
## Deployment Setup - Pull Request
**Timestamp**: 2026-10-18T22:22:48Z
**User Input**: "okee. kan jij een PR aanmaken? Dan kijk ik wat de PR doet met de workflow. EVentueel mergens we de changes en PR zonder de feature branch te verwijderen zodat wer daarna door kunnen op deze branch met het aan de praat krijgen, maar dan staat de workflow in ieder geval al op master"
**AI Response**: "Created Gitea PR #3 (feature/frontend-shell -> master) via the API using the stored Git Credential Manager login; body without 4-byte emoji (Gitea DB limitation, attribution line without the robot emoji); body asks to keep the branch on merge. PR mergeable. Workflow run started on the pull_request event (job 'check' running at e643660)."
**Context**: OPERATIONS - Deployment Setup; pipeline verification via PR #3
---
## Deployment Setup - Monitoring PR Run and Test 500
**Timestamp**: 2026-10-18T22:25:18Z
**User Input**: "Kan jij de workflow in de gaten houden? Dan kan je zelf kijken wat er mis gaat eventueel. Ik zie wel op test.andreaslop.nl dat ik een 500 error krijg. Klopt dat? De map is namelijk nog leeg"
**AI Response**: "Checked https://test.andreaslop.nl: 500 from nginx 1.24 with our CSP and X-Robots-Tag headers, so proxy, certbot, Host header and test block work. Cause: empty folder makes try_files fall back to /index.html, which loops (internal redirection cycle -> 500). Changed generator to 'try_files $uri $uri/ /index.html =404' (404 instead of loop), test updated, config regenerated; not pushed yet to avoid cancelling the running PR run. Started a background watcher (Gitea API, 30 s interval, logs status changes and failed job logs) on run 526 for e643660."
**Context**: OPERATIONS - Deployment Setup; watching PR #3 run
---
## Deployment Setup - First CI Run Result
**Timestamp**: 2026-10-18T22:33:41Z
**User Input**: "Top. Heb het config bestand aangepast en die heeft nu inderdaad een 404. Ik zie dat de workflow faalt bij de tests"
**AI Response**: "Owner applied try_files =404 on the hosting Pi (empty folder now 404). Watcher bug: Windows console could not print a check mark from the log and looped instead of exiting; stopped it, fetched job 4574 log via API. Run 526: lint and format passed (line endings fixed by .gitattributes); 92/93 tests passed; '/ rendert binnen de shell' timed out at 5 s (7.0 s on the arm64 Pi; first render per file is slow, e.g. Footer 3.6 s). Set vitest testTimeout 20 s with rationale; silenced the router's expected warning in the crash test. Local: lint, format, 93 tests, tsc pass. Watcher fixed (UTF-8 stdout, logs to file, always exits). Committing and pushing to re-run PR #3."
**Context**: OPERATIONS - Deployment Setup; fixing CI
---
## Deployment Setup - CI Run 527
**Timestamp**: 2026-10-18T22:41:02Z
**User Input**: "Zodra je alles gefixed heb mag je meteen comitten en pushen. Dan mag je de run weer in de gaten houden"
**AI Response**: "Owner authorised committing and pushing fixes and monitoring runs. Run 527: all 93 tests pass on the runner, audit:deps clean; audit:dev failed with 'sh: Syntax error: \"(\" unexpected' (unquoted parentheses in the echo, fine in cmd.exe, invalid in POSIX sh). Removed the parentheses; verified exit 0 in both shells. Committing, pushing and watching the next run."
**Context**: OPERATIONS - Deployment Setup; fixing CI
---
## Deployment Setup - CI Run 528
**Timestamp**: 2026-10-18T22:56:26Z
**User Input**: "(none — monitoring as authorised)"
**AI Response**: "Run 528: check job passed fully (lint, format, 93 tests, build, audit:deps, audit:dev). Lighthouse job: Playwright Chromium 140 for linux-arm64 downloaded and started, healthcheck and preview server OK; first measurement failed with TARGET_CRASHED (browser tab crashed). Cause: container /dev/shm limited to 64 MB. Added --disable-dev-shm-usage to LIGHTHOUSE_CHROME_FLAGS; verified locally that a measurement with the new flags succeeds. Committing, pushing and watching the next run."
**Context**: OPERATIONS - Deployment Setup; fixing CI
---
## Deployment Setup - CI Run 529 and Lighthouse Question
**Timestamp**: 2026-10-18T23:13:48Z
**User Input**: "Wat is de melding \"GitHub token not set\" in de lighthouse job?"
**AI Response**: "Explained: lhci healthcheck warning (not a failure) because Gitea sets GITHUB_* compat env vars and an upload target is configured; lhci can only post GitHub status checks. Left as is. Run 529: --disable-dev-shm-usage fixed the crash; Lighthouse ran on all 7 pages; accessibility, best practices and SEO passed; performance failed everywhere (0.49-0.66 vs 0.82-0.95 locally). Cause: Lighthouse simulates 4x CPU slowdown relative to the host; local benchmarkIndex 4192, the Pi is far slower, so perf is not representative. Created operations/plans/lighthouse-ci-questions.md (A: perf report-only in CI, blocking locally; B: calibrate CPU multiplier; C: no Lighthouse in CI)."
**Context**: OPERATIONS - Deployment Setup; awaiting decision
---
## Deployment Setup - Lighthouse Performance Report-only in CI
**Timestamp**: 2026-10-18T23:22:33Z
**User Input**: "Ja mee eens. Optie A. Kan jij die optie in het bestand bij het antwoord toevoegen en het dan uitvoeren? Dan kan je daarna meteen comitten en pushen. Ik heb de master branch protected gemaakt en de workflow check onderdeel als vereiste ingesteld om te slagen. Zodra je gepusht hebt laat het even weten dat zet ik auto merge aan zodat ik zsm de workflow met deploy kan laten runnen ."
**AI Response**: "Filled answer A. lighthouserc.cjs: performance assertion level from LIGHTHOUSE_PERFORMANCE (warn in CI, error otherwise), exported for the desktop config; reports to lighthouse-reports/mobile and /desktop (ignored by git, prettier, eslint). Workflow sets LIGHTHOUSE_PERFORMANCE=warn and uploads lighthouse-reports as artifact (if: always()). Verified: config levels per env; full pnpm lighthouse with warn exits 0 with 7+7 HTML reports. Docs updated: NFR-P-01, deployment-plan D6, performance-test-instructions. Committing and pushing; owner will enable auto-merge on PR #3 (master protected, check required)."
**Context**: OPERATIONS - Deployment Setup; fixing CI
---
@@ -0,0 +1,75 @@
# Build and Test Summary — frontend-shell
Run on 2026-10-18, on a clean install (`node_modules` removed, `pnpm install --frozen-lockfile`), with the full `pnpm check`: **exit 0, 225 s**.
## Build Status
- **Build tool**: pnpm 12 + Vite 8 (`tsc && vite build`)
- **Build status**: ✅ Success
- **Clean install**: ✅ `postinstall` generated the Chakra types automatically
- **Artifacts**: `dist/` with `index.html`, hashed assets, one chunk per route, plus:
- `sitemap.xml` (home only)
- `robots.txt`
- `og-image.jpg`
- `logo.png`
- **Accepted warning**: main chunk > 500 kB (≈170 kB gzip), mostly Chakra; see performance
## Test Execution Summary
### Unit tests
- **Total**: 82 tests in 18 files. **Passed**: 82. **Failed**: 0.
- **Property-based**: 18 properties over 8 pure functions. The seed is logged on every run (e.g. `1344216500`).
- **Coverage**: 100% on all pure functions (enforced); ≈80% of lines overall (reported).
- **Status**: ✅ Pass
### Integration tests
- **Scenarios**: 7 automated (`src/app.test.tsx`) + 5 build-level checks. **Passed**: all.
- **Status**: ✅ Pass
### Performance (Lighthouse)
| Measure | Result | Target |
|---|---|---|
| Home, mobile | 82 | ≥ 80 (temporary) |
| Home, desktop | 99 | ≥ 90 |
| Other pages | 94–95 mobile, 100 desktop | ≥ 90 |
| Accessibility / Best Practices | 100 everywhere | 100 |
| SEO | 100 on indexed pages | 100 indexed |
**Status**: ✅ Pass (with the agreed exception for home mobile)
### Additional tests
- **Security**: ✅ Pass
- `audit:deps` clean.
- All 5 security headers present on `preview`.
- CSP test, e-mail and devtools absent from the build, only the own origin loaded.
- `audit:dev` reports 8 dev-tool advisories, non-blocking by decision.
- **Accessibility (automated)**: ✅ Pass. axe on every page and component; Lighthouse 100.
- **Manual keyboard / screen reader** ([manual-test-instructions.md](manual-test-instructions.md)), run by the owner:
- K3–K6, K9, screen reader and responsive: ✅ good.
- K7–K8: ✅ on mobile with a screen reader; desktop not testable yet (too little content).
- **K1 (skip link invisible): fixed.** Chakra's skip link has no z-index and sat under the fixed header; it now uses `zIndex: skipNav` and `margin: 0`. ✅ Retested by the owner.
- **K2 (Tab after the skip link went into the menu): resolved with K1.** ✅ Retested by the owner: focus moves to the content.
- **"SOCIALS" spelled out by a mobile screen reader**: CSS uppercase is read as an abbreviation. Footer headings now carry an `aria-label` in normal casing (owner choice A). ✅ Mobile: read correctly. Windows desktop screen reader: still spelled out; **accepted by the owner** (visual "SOCIALS" preferred over "Social media"). Option B remains available if this ever needs to change.
- **Contract tests**: N/A, no API yet.
- **E2E**: covered by integration tests in jsdom and by Lighthouse in a real browser. No separate E2E framework.
## Extension Compliance (Build and Test)
- **PBT-08**: ✅ Compliant.
- Shrinking is on.
- Seed logged on every run and replayable with `FC_SEED`.
- Property tests are part of `pnpm check`, the future CI step.
- **SECURITY-04 / 10 / 13 / 15**: ✅ Compliant, see [security-test-instructions.md](security-test-instructions.md).
- **Other rules**: N/A at this stage.
## Overall Status
- **Build**: ✅ Success
- **All automated tests**: ✅ Pass
- **Open**: none (one accepted known issue, see manual tests)
- **Ready for Operations**: Yes, if chosen.
## Follow-ups (carried forward)
1. **CI/CD**: run `pnpm check` on every push.
2. **Production host**: send the same security headers.
3. **Responsive images**: from the API/CMS.
4. **Prerendering**: restores home mobile to ≥ 90 and correct link previews per page.
5. **Contact form and spam filter**: with the .NET API.
6. **Wider browser support**: once visitor statistics exist.
@@ -0,0 +1,54 @@
# Build Instructions — frontend-shell
## Prerequisites
- **Node.js** 24 (tested with v24.16.0)
- **pnpm** 12 (tested with 12.11.2)
- **Google Chrome**, only for `pnpm lighthouse` / `pnpm check`
- **Environment variables**: none required. `FC_SEED` is optional (see unit-test-instructions.md).
- **OS**: tested on Windows 11; nothing OS-specific in the build
## Build Steps
All commands run in `web/`.
### 1. Install dependencies
```bash
pnpm install --frozen-lockfile
```
- `--frozen-lockfile` installs exactly what `pnpm-lock.yaml` pins (SECURITY-10).
- `postinstall` runs `chakra typegen`, which generates the theme types (recipe variants such as `link` `subtle`) into `node_modules`. Without it, `tsc` fails on custom variants.
### 2. Build
```bash
pnpm build
```
This runs `tsc` (type check) and then `vite build`.
### 3. Verify the build
- **Expected output**: `✓ built in …`, no TypeScript errors.
- **Artifacts in `dist/`**:
- `index.html` with the fallback head (title, description, Open Graph, canonical)
- `assets/` with hashed JS, CSS, fonts and images; one chunk per route
- `sitemap.xml`, generated from `src/sitePages.ts`, indexed pages only
- `robots.txt`, `og-image.jpg`, `logo.png`, `favicon.png` (copied from `public/`)
- **Accepted warning**: "Some chunks are larger than 500 kB". The main chunk is ~580 kB (≈170 kB gzip), mostly Chakra UI. It is tracked under performance (NFR-P-01 exception).
### 4. Run the built site locally
```bash
pnpm preview # http://localhost:4173, with the production security headers
```
Measure performance against this, not against `pnpm dev`: the dev server is unbundled, unminified and loads devtools (measured 0.47 vs 0.82 on mobile).
## Troubleshooting
### `tsc`: `Type '"subtle"' is not assignable to …`
- **Cause**: the Chakra typegen output in `node_modules` is missing (for example after a manual reinstall with scripts disabled).
- **Fix**: `pnpm typegen`, then build again.
### `pnpm install` warns about the store location
- **Cause**: the global pnpm store is on another drive than the project, so pnpm cannot hard-link from it.
- **Fix**: none needed; pnpm uses a store on the project drive. Optionally set `storeDir`.
### Vite warns about imports without a file extension in the config
- **Cause**: Vite 8's native config loader requires extensions. The config import chain uses `.ts` extensions for that reason.
- **Fix**: keep the `.ts` extensions in `vite.config.ts`, `config/*` and the modules they import.
@@ -0,0 +1,38 @@
# Integration Test Instructions — frontend-shell
## Purpose
This feature is a single unit, so there are no cross-unit or cross-service calls. Integration here means **the real app wired together**:
- the generated route tree
- router options as in `main.tsx` (scroll restoration, default error component)
- the Chakra theme
- the shell around every page
- the head management per route
- the build-time sitemap
## Automated scenarios (`src/app.test.tsx`, part of `pnpm test`)
| # | Scenario | Expected |
|---|---|---|
| 1 | Every route in `sitePages` renders | Inside the shell (banner + contentinfo), exactly one `h1`, no axe violations |
| 2 | `/portfolio` head | Title "Portfolio \| Andrea Slop Fotografie", canonical `https://andreaslop.nl/portfolio`, `robots: noindex` |
| 3 | Structured data | Exactly one `application/ld+json` block of type `ProfessionalService` |
| 4 | Unknown URL `/bestaat-niet` | "Pagina niet gevonden" inside the shell, no axe violations |
| 5 | A page throws while rendering | "Er ging iets mis" inside the shell; error text not shown |
| 6 | Page registry vs route tree | Same set of paths (BR-SEO-07) |
| 7 | Page registry vs Lighthouse URLs | `lighthouserc.cjs` lists the same indexed / noindex pages |
Also in `pnpm test`: `useRouteFocus` (focus moves to `main` after a page change) and `NavigationBar`/`Footer` with a real router (`aria-current`, link targets).
## Build-level checks (run after `pnpm build` + `pnpm preview`)
| Check | How | Expected |
|---|---|---|
| Deep link served | `curl -s -o /dev/null -w "%{http_code}" http://localhost:4173/portfolio` | `200` (SPA fallback) |
| Sitemap | `curl http://localhost:4173/sitemap.xml` | `200`, `text/xml`, only `https://andreaslop.nl/` |
| Robots | `curl http://localhost:4173/robots.txt` | `200`, points to the sitemap |
| E-mail address not in build | `grep -rl "info@andreaslop" dist` | No result (BR-EMAIL-01) |
| No devtools in build | `ls dist/assets \| grep -i devtool` | No result (NFR-P-04) |
## Setup and cleanup
- **Setup**: no services. The automated tests use an in-memory router history and jsdom.
- **Cleanup**: stop `pnpm preview` (Ctrl+C).
@@ -0,0 +1,44 @@
# Manual Test Instructions — frontend-shell
The automated tests cover structure, roles and labels (Testing Library + axe) and Lighthouse covers contrast. What they cannot judge is how the site **feels** with a keyboard and a real screen reader (NFR-A-04). Run this checklist on the built site.
## Setup
```bash
pnpm build && pnpm preview # http://localhost:4173
```
- **Screen reader**: NVDA (Windows, free) with Chrome, or VoiceOver (macOS/iOS) with Safari.
- **Phone**: open `http://<your-PC-IP>:4173`. For that, run `pnpm preview --host`.
## Keyboard (no mouse)
| # | Step | Expected |
|---|---|---|
| K1 | Load `/`, press Tab once | "Direct naar de inhoud" appears top left |
| K2 | Press Enter | Focus jumps to the content; the next Tab goes to the first link in the page |
| K3 | Tab through the header | Logo, then the menu items, each with a clearly visible focus ring |
| K4 | Below 1024 px: Tab to the menu button, Enter, Escape | Menu opens; Escape closes it; the page does not scroll behind it |
| K5 | Open a page from the menu | Page starts at the top; focus is in the content (next Tab = first link in the page) |
| K6 | Browser back | Previous page at the previous scroll position |
| K7 | Scroll down, Tab to "Terug naar boven", Enter | Page scrolls up; the button disappears; focus is in the content |
| K8 | At the top of the page, Tab | "Terug naar boven" is skipped while invisible |
| K9 | Footer links | Visible focus; Facebook/Instagram open in a new tab |
## Screen reader
| # | Step | Expected |
|---|---|---|
| S1 | List landmarks (NVDA: D / VoiceOver: rotor) | Banner, "Hoofdmenu" navigation, main, content info, "Footermenu" navigation |
| S2 | List headings (NVDA: H) | One heading level 1 per page; "Socials" and "Contact" at level 2 |
| S3 | Footer social link | "Facebook, opent in nieuw tabblad, link" (wording differs per reader) |
| S4 | Follow a menu link | The new page is read from the start of the content |
| S5 | Unknown URL `/bestaat-niet` | "Pagina niet gevonden" is read; header and footer present |
| S6 | Hero arrows and social icons | "Vorige foto", "Volgende foto", "Instagram, opent in nieuw tabblad" |
## Visual / responsive
| # | Step | Expected |
|---|---|---|
| V1 | Widths 320, 390, 820, 1440 and ultrawide (DevTools device toolbar) | No horizontal scrolling, nothing cut off |
| V2 | Footer brand column | Mobile: logo and tagline centred, stacked. Tablet and desktop: logo with the tagline beside it |
| V3 | 32:9 screen | "Terug naar boven" aligns with the content edge, not the screen corner |
| V4 | Browser zoom 200% | Everything readable, nothing overlaps |
| V5 | OS "reduce motion" on | No smooth scrolling or slide/fade animations on the to-top button |
Record findings with page, step and browser/reader, and report them as a bug (Bug Fix lane) or a change request.
@@ -0,0 +1,40 @@
# Performance Test Instructions — frontend-shell
## Purpose
This is a static front-end without a server, so load, stress and throughput testing do not apply (NFR scalability: N/A). Performance here means **page-load quality as a visitor experiences it**, measured with Lighthouse.
## Requirements (NFR-P-01)
- **Performance**: ≥ 90 on every page, mobile and desktop.
- **Temporary exception**: home page on mobile ≥ 80, until responsive images come from the API/CMS and prerendering exists.
- **Accessibility, Best Practices**: 100 on every page.
- **SEO**: 100 on indexed pages. On `noindex` pages only the "is crawlable" audit may fail.
## Run
```bash
pnpm build
pnpm lighthouse # mobile (lighthouserc.cjs), then desktop (lighthouserc.desktop.cjs)
```
- Lighthouse CI starts `pnpm preview` itself (port 4173, real security headers).
- It measures all six routes plus `/bestaat-niet` (404) once per form factor.
- It fails if any assertion fails. Exception: in CI the workflow sets `LIGHTHOUSE_PERFORMANCE=warn`, which makes Performance report-only, because the Raspberry Pi runner gives scores 30-40 points lower than a PC for the same build. Locally, Performance blocks.
- Reports are written to `lighthouse-reports/mobile` and `lighthouse-reports/desktop` (git-ignored). Open the `.html` files for details. In CI they are attached to the run as the `lighthouse-reports` artifact.
- Requires a local Chrome.
Manual measurement in a browser: `pnpm build && pnpm preview`, then open `http://localhost:4173` in a **private window** (extensions and Brave Shields skew results) and run Lighthouse from DevTools.
## Results (2026-10-18, clean install)
| Page | Mobile Perf | Desktop Perf | A11y | Best Pr. | SEO |
|---|---|---|---|---|---|
| `/` | **82** (target 80) | 99 | 100 | 100 | 100 |
| `/over-mij`, `/portfolio`, `/soorten-fotoshoots`, `/contact`, `/privacyverklaring` | 94 | 100 | 100 | 100 | 69 (noindex, accepted) |
| `/bestaat-niet` (404) | 95 | 100 | 100 | 100 | 58 (noindex, no description; accepted) |
Home page mobile: LCP ≈ 4.3 s (simulated slow 4G), total download ≈ 1.2 MB, CLS ≈ 0.
## Known bottlenecks and follow-ups
- **Responsive images**: the first hero photo is 2560 px wide (≈325 KB), also on a phone. The fix is image variants per width from the API/CMS or an image service, used via `srcset`.
- **Render after JavaScript**: the hero title appears only after the JS bundle (≈170 kB gzip, mostly Chakra) has loaded. Prerendering (planned with hosting) fixes this.
- **Already done in this feature**:
- Hero slides load just-in-time (active, next, previous), so the download went from 2.6 MB to 1.2 MB.
- The logo is sized correctly (`htmlWidth`/`htmlHeight`).
@@ -0,0 +1,44 @@
# Security Test Instructions — frontend-shell
## Dependency scan (SECURITY-10, NFR-SEC-05)
```bash
pnpm audit:deps # blocking: packages that ship with the site
pnpm audit:dev # report only: all packages incl. dev tools
```
- **`audit:deps`**: expected "No known vulnerabilities found".
- **`audit:dev`**: reports advisories in dev-only tools and never blocks. Status on 2026-10-18: 5 high, 2 moderate, 1 low.
- 7 of them via `@lhci/cli`, 1 via `@chakra-ui/cli`.
- None of these packages end up in `dist/`.
- Review this list periodically, and when you update those tools.
- **`source-map-js`**: held at ≥ 1.2.2 through an override in `pnpm-workspace.yaml` (GHSA-68fv-2mgg-jv7q).
## HTTP security headers (SECURITY-04)
Automated: `config/securityHeaders.test.ts` checks that the production CSP has:
- no `unsafe-eval`
- no `unsafe-inline` for scripts
- no `ws:`
- `frame-ancestors 'none'`
Against the built site:
```bash
pnpm build && pnpm preview
curl -sI http://localhost:4173/
```
Expected:
- `Content-Security-Policy: default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data:; font-src 'self'; connect-src 'self'; object-src 'none'; base-uri 'self'; form-action 'self'; frame-ancestors 'none'`
- `Strict-Transport-Security: max-age=31536000; includeSubDomains` (browsers only honour it over HTTPS)
- `X-Content-Type-Options: nosniff`
- `X-Frame-Options: DENY`
- `Referrer-Policy: strict-origin-when-cross-origin`
The production host must send the same set; that is a follow-up for Operations.
## Other checks
| Check | Covered by |
|---|---|
| External links use `rel="noopener noreferrer"` and only `https:` | Footer and Hero tests, `visibleSocials` property tests |
| JSON-LD cannot close its `<script>` element | `jsonLdScript` property test (no `<` or `>` in output) |
| Error page shows no internals | ErrorPage test and integration scenario 5 |
| E-mail address not literally in the build | `grep -rl "info@andreaslop" dist` → no result |
| No third-party resources loaded | Lighthouse network log: only the own origin |
| No inline scripts besides the non-executed JSON-LD data block | `next-themes` removed; CSP `script-src 'self'` with no console violations (Best Practices 100) |
@@ -0,0 +1,34 @@
# Unit Test Execution — frontend-shell
## Run the tests
```bash
pnpm test # once, with coverage
pnpm test:watch # while developing
```
## Expected results
- **18 test files, 82 tests, 0 failures.** That includes:
- **Property-based tests** (fast-check) for every row in "Testable Properties" of business-rules.md: `backToTopThreshold`, `visibleSocials`, `emailAddress`, `copyrightLine`, `canonicalUrl`, `sitemapXml`, `jsonLdScript`, `slidesToLoad`.
- **Example-based component tests** with React Testing Library.
- **axe-core accessibility checks** in the component and integration tests (colour contrast excluded in jsdom; Lighthouse covers it).
- **Coverage**: the run fails if any pure function in `src/lib/**`, `src/seo.ts` or `src/sitemap.ts` drops below 100% (statements, branches, functions, lines). For everything else coverage is reported only (overall ≈80% of lines).
- **Report**: in the terminal; an HTML report is written to `coverage/` (git-ignored).
## Property-based testing (PBT-08)
- **Seed**: every run prints one line, for example:
```
fast-check seed: 1344216500 (opnieuw: FC_SEED=1344216500 pnpm test)
```
The seed comes from `config/testSeed.ts` and applies to all property tests in that run.
- **Replay** a run exactly, failing or not:
```bash
FC_SEED=1344216500 pnpm test
```
- **On a failure** fast-check also reports the shrunk minimal counterexample and its `path`. Shrinking is on and never disabled.
- **Flaky failures** are not retried away. Replay with the seed, find the cause, fix it.
## Fixing failing tests
1. Read the failing test name and message in the terminal output.
2. For a property test: replay with `FC_SEED`, then turn the shrunk counterexample into an example test.
3. Fix the code, or the property if it was stated too broadly. An example from this feature: monotonicity of `backToTopThreshold` holds only for finite input, because BR-TOP-01 maps non-finite input to 0.
4. Rerun `pnpm test`.
@@ -0,0 +1,90 @@
# Code Summary — frontend-shell
All application code is in `web/`. Plan: [frontend-shell-code-generation-plan.md](../../plans/frontend-shell-code-generation-plan.md).
## Structure
```mermaid
graph TD
Root["routes/__root.tsx"] --> Shell["AppShell"]
Root --> Head["siteHead + JSON-LD"]
Shell --> Skip["SkipNavLink"]
Shell --> Nav["NavigationBar"]
Shell --> Main["main#35;main + Outlet"]
Shell --> Foot["Footer"]
Shell --> Top["BackToTop"]
Main --> Pages["Route pages via PageIntro / Hero"]
Main --> Status["NotFound / ErrorPage via StatusPage"]
Pages --> Registry["sitePages + pageHead"]
Registry --> Sitemap["sitemap.xml at build"]
classDef layout fill:#4CAF50,stroke:#2e7d32,stroke-width:1px,color:#000;
classDef ui fill:#2196F3,stroke:#0d47a1,stroke-width:1px,color:#000;
classDef data fill:#fbd38d,stroke:#92400e,stroke-width:1px,color:#000;
class Root,Shell,Main layout;
class Skip,Nav,Foot,Top,Pages,Status ui;
class Head,Registry,Sitemap data;
```
Text alternative: the root route renders the shell and site-wide head data; the shell holds the skip link, navigation, main content, footer and back-to-top button; pages take their head data from the page registry, which also generates the sitemap.
## Files
### Created
| Area | Files | Covers |
|---|---|---|
| Config | `vite.config.ts` (replaces `.js`), `config/securityHeaders.ts`, `config/sitemapPlugin.ts`, `eslint.config.js`, `lighthouserc.cjs` + `.d.cts` | TD-03…07, NFR-SEC-01…03, BR-SEO-06 |
| Theme | `recipes/container.ts`, `link.ts`, `skipNavLink.ts`, `iconControl.ts` | BR-THEME-02…07 |
| Content | `content/siteContent.ts` | FR-04, BR-EMAIL-01 |
| Logic | `lib/slidesToLoad.ts`, `lib/backToTopThreshold.ts`, `visibleSocials.ts`, `emailAddress.ts`, `copyrightLine.ts`, `navigation.ts`, `sitePages.ts`, `sitemap.ts` | BR-TOP-01, BR-SOC-*, BR-EMAIL-*, BR-FOOT-02, BR-NAV-*, BR-SEO-* |
| Components | `RouterLink`, `PageIntro/`, `StatusPage/` (`StatusPage`, `NotFound`, `ErrorPage`), `Footer/` (`Footer`, `FooterColumn`, `FooterLink`), `BackToTop/` | FR-01, FR-05…FR-10 |
| Hooks | `hooks/useRouteFocus.ts` | BR-A11Y-01 |
| Routes | `portfolio.tsx`, `soorten-fotoshoots.tsx`, `contact.tsx`, `privacyverklaring.tsx` | FR-01 |
| Static | `public/robots.txt`, `public/og-image.jpg` (1200×630 crop of `hero-1.jpg`), `public/logo.png` | BR-SEO-04/05/08 |
| Tests | 17 test files, incl. `src/test/` (setup, axe matcher, arbitraries, `renderWithProviders`) and `src/app.test.tsx` (integration) | NFR-M-01, NFR-A-02 |
### Modified
- `theme.ts`: removed `250vh`; added focus ring, `content`/`pageTop`/z-index tokens, `pageTitle`, recipe registration.
- `seo.ts`: `pageHead(path)` from the registry, canonical, Open Graph image, `siteHead`, JSON-LD.
- `main.tsx`: `next-themes` removed, `scrollRestoration`, `defaultErrorComponent`.
- `routes/__root.tsx`, `index.tsx`, `over-mij.tsx`.
- `AppShell`, `NavigationBar` (logo link, `mainNav`, 44px menu button, z-index tokens), `MobileNav`, `NavLink`, `LinkButton` (onto `RouterLink`).
- `Hero`: socials prop; first only the active photo, after it is painted also the next and previous (BR-HERO-01). `HeroArrows` and `HeroSocials` use `iconControl`.
- `index.html`: fallback head with `og:image`, canonical, `twitter:card`.
- `package.json`: scripts, dependencies, `postinstall` typegen. `pnpm-workspace.yaml`: `source-map-js` override.
- `tsconfig.json`, `.gitignore`, `.prettierignore`.
- Formatting only: Prettier over all of `web/`, which also touched existing files such as `useHeroSlider.ts` and line endings.
### Moved / deleted
- Moved: `components/Hero/{heroContent,socialPlatforms,types}.ts` → `content/`.
- Deleted: `components/Footer.tsx`, `NavigationBar/navItems.ts`, `assets/hero.png`, `assets/typescript.svg`, `assets/vite.svg`.
## Deviations From the Plan
| Planned | Done instead | Why |
|---|---|---|
| `vitest-axe` | Own `toHaveNoViolations` on `axe-core` (TD-02 fallback) | `vitest-axe` 0.1.0 types target the old Vitest `Vi` namespace |
| ESLint 10 | ESLint 9 | `eslint-plugin-jsx-a11y` supports up to ESLint 9 |
| — | `inert` on the hidden to-top button | Makes BR-TOP-03 hold without CSS and testable in jsdom |
| — | Hero loads the active slide first, then only its neighbours | Stacked slides defeat `loading="lazy"`; mobile LCP 19.7s → 4.3s, home download 2.6 MB → 1.2 MB |
| Footer brand column: logo above text, left-aligned | Mobile centred and stacked; tablet/desktop logo 110px beside the text; tagline split into two lines in the content | User choice after reviewing renders at 390/820/1440px |
| Home mobile Performance ≥ 0.9 | ≥ 0.8 for now (`lighthouserc.cjs`); desktop stays 0.9 (`lighthouserc.desktop.cjs`) | User choice; responsive images come with the API/CMS |
| `audit:deps` on all packages | `audit:deps` on production packages; `audit:dev` reports dev tools without blocking | User choice; dev tools never ship |
| — | `.ts` extensions in the config import chain | Vite 8 warns these become required for its native config loader |
| — | `postinstall: chakra typegen` | Typegen output lives in `node_modules` and was lost on reinstall |
## Scripts
| Command | Does |
|---|---|
| `pnpm test` / `pnpm test:watch` | Vitest with coverage (100% threshold on pure functions) |
| `pnpm lint`, `pnpm format:check` | ESLint, Prettier |
| `pnpm build` | Type check + Vite build, including `sitemap.xml` |
| `pnpm audit:deps` | `pnpm audit --prod --audit-level high` (blocks) |
| `pnpm audit:dev` | `pnpm audit`, report only |
| `pnpm lighthouse` | Lighthouse CI, mobile (`lighthouserc.cjs`) then desktop (`lighthouserc.desktop.cjs`); needs local Chrome |
| `pnpm check` | All of the above in order |
## LAYOUT.md
No change. The shell blocks (Header / Content / Footer) are unchanged. Skip link and back-to-top are not page sections.
@@ -0,0 +1,175 @@
# Business Logic Model — frontend-shell
The shell has four flows: content provisioning, page navigation, not-found/error rendering and the back-to-top interaction. Rules are referenced by ID from [business-rules.md](business-rules.md).
## 1. Content provisioning
```mermaid
graph TD
Site["content/siteContent"] --> Shell["AppShell"]
Hero_c["content/heroContent"] --> Home["Home route"]
Site --> Home
Shell -->|"content prop"| Footer["Footer"]
Home -->|"content + socials props"| Hero["Hero"]
Footer --> VS1["visibleSocials"]
Footer --> EA["emailAddress"]
Hero --> VS2["visibleSocials"]
classDef data fill:#fbd38d,stroke:#92400e,stroke-width:1px,color:#000;
classDef provider fill:#4CAF50,stroke:#2e7d32,stroke-width:1px,color:#000;
classDef ui fill:#2196F3,stroke:#0d47a1,stroke-width:1px,color:#000;
classDef fn fill:#9C27B0,stroke:#4a148c,stroke-width:1px,color:#000;
class Site,Hero_c data;
class Shell,Home provider;
class Footer,Hero ui;
class VS1,VS2,EA fn;
```
Text alternative: static content modules are imported only by AppShell and the home route, which pass them as props to Footer and Hero; both use the pure helpers to decide what to show.
- Components never import content (AD D3). Later the two import points become route loaders or API calls.
- The e-mail address is joined in `Footer` at render (BR-EMAIL-01).
## 2. Page navigation and scroll position
```mermaid
sequenceDiagram
box rgba(246,224,94,0.4) Visitor
participant V as Visitor
end
box rgba(99,179,237,0.4) App
participant R as Router
participant S as AppShell
participant P as Page
end
V->>R: Click menu link
R->>S: Render matched route in main
S->>P: Render page with its head
R-->>V: Scroll to top of new page
V->>R: Browser back
R-->>V: Restore previous scroll position
```
Text alternative: a menu click renders the new page inside the shell and starts at the top; browser back restores the earlier scroll position (FR-08, router scroll restoration).
## 3. Not-found and error rendering
```mermaid
graph TD
Url["URL requested"] --> Match{"Route matches?"}
Match -->|"no"| NF["NotFound in main, shell stays"]
NF --> NFHead["Own title + noindex"]
Match -->|"yes"| Render{"Error while rendering?"}
Render -->|"no"| Page["Page in main"]
Render -->|"in a page"| ErrIn["ErrorPage in main, shell stays"]
Render -->|"in the shell"| ErrOut["ErrorPage without shell"]
ErrIn --> Log["console.error once"]
ErrOut --> Log
ErrIn --> Retry{"Opnieuw proberen?"}
Retry -->|"yes"| Reset["Reset boundary + invalidate router"]
Reset --> Render
Retry -->|"Terug naar home"| HomeR["Navigate to /"]
classDef decision fill:#f6e05e,stroke:#c05621,stroke-width:1px,color:#000;
classDef ok fill:#9ae6b4,stroke:#2f855a,stroke-width:1px,color:#000;
classDef fail fill:#F44336,stroke:#b71c1c,stroke-width:1px,color:#000;
classDef action fill:#63b3ed,stroke:#2b6cb0,stroke-width:1px,color:#000;
class Match,Render,Retry decision;
class Page,HomeR ok;
class NF,ErrIn,ErrOut fail;
class Url,NFHead,Log,Reset action;
```
Text alternative: an unknown URL shows NotFound inside the shell; a page error shows ErrorPage inside the shell and a shell error shows it without the shell; errors are logged once, and the visitor can retry (re-render) or go home.
## 4. Back-to-top interaction
```mermaid
sequenceDiagram
box rgba(246,224,94,0.4) Visitor
participant V as Visitor
end
box rgba(154,230,180,0.4) Shell
participant H as useScrolledPast
participant B as BackToTop
participant M as main
end
V->>H: Scroll down
H->>B: scrollY above threshold so visible
V->>B: Click or Enter
B->>V: Scroll to top, smooth or instant
B->>M: Move focus with preventScroll
H->>B: scrollY below threshold so hidden
```
Text alternative: scrolling past the threshold makes the button visible; activating it scrolls to the top (instant under reduced motion), moves focus to main and the button hides again (BR-TOP-02, -05, -06).
## 5. Focus on page change (BR-A11Y-01)
```mermaid
sequenceDiagram
box rgba(246,224,94,0.4) Visitor
participant V as Visitor
end
box rgba(154,230,180,0.4) App
participant R as Router
participant F as useRouteFocus
participant M as main
end
V->>R: Follow a link or use back and forward
R->>R: Render new page and restore scroll
R->>F: Resolved with a new pathname
alt First load
F->>F: Do nothing
else Pathname changed
F->>M: Focus with preventScroll
end
M-->>V: Screen reader reads from start of content
```
Text alternative: after the router has rendered a page with a new pathname (not on first load), focus moves to main without scrolling, so a screen reader starts reading the new content.
## 6. Build-time SEO files (BR-SEO-06 to -08)
```mermaid
graph LR
Pages["sitePages registry"] --> Plugin["Vite sitemap plugin"]
Url["siteUrl"] --> Plugin
Plugin -->|"indexed pages only"| Xml["dist/sitemap.xml"]
Robots["public/robots.txt"] --> Dist["dist/robots.txt"]
Pages --> Test{"Test: registry equals route tree?"}
Tree["Generated route tree"] --> Test
Test -->|"no"| Fail["Test fails"]
classDef code fill:#9ae6b4,stroke:#2f855a,stroke-width:1px,color:#000;
classDef build fill:#63b3ed,stroke:#2b6cb0,stroke-width:1px,color:#000;
classDef out fill:#fbd38d,stroke:#92400e,stroke-width:1px,color:#000;
classDef check fill:#f6e05e,stroke:#c05621,stroke-width:1px,color:#000;
classDef fail fill:#F44336,stroke:#b71c1c,stroke-width:1px,color:#000;
class Pages,Url,Tree,Robots code;
class Plugin build;
class Xml,Dist out;
class Test check;
class Fail fail;
```
Text alternative: during the build a small Vite plugin turns the indexed entries of the page registry into sitemap.xml and robots.txt is copied as a static file; a test fails when the registry and the route tree list different pages.
**Effort and reliability of the generated sitemap (CH Q5)**:
- The plugin is about 30 lines. The XML is built by the pure, property-tested function `sitemapXml`.
- It needs no route crawling and no extra dependency. It reads the same `sitePages` module the route heads use, so a page can never be indexed in the sitemap and `noindex` in its head at the same time.
- The only manual step is adding a new page to `sitePages`. BR-SEO-07 makes the tests fail when that is forgotten.
## Recommendations Outside This Feature (CQ4 = A)
Recorded so they come back with the Contact page and the .NET API:
1. **Contact form** as the main contact channel (technique 3). The address then appears nowhere on the site. Needs the back-end: server-side sending, a honeypot field and rate limiting, and possibly a CAPTCHA.
2. **Dedicated address + spam filter** (technique 4). Already partly in place: `info@andreaslop.nl` is used only for the website. Remaining step: a strict spam filter on that mailbox.
3. **CMS content**: the e-mail address keeps the `{ user, domain }` shape in the API (BR-EMAIL-01).
4. **Old static site**: as long as it is online, it exposes the address literally in its HTML. Replacing it with this site removes that source.
5. **Prerendering** (CH Q1 = A): generate static HTML per route at build time once the real pages exist, so link previews (WhatsApp, Facebook, LinkedIn) show the right title and image per page. BR-SEO-11 keeps this possible without rework. Belongs with hosting/Operations.
6. **Responsive images**: serve smaller variants of the hero and portfolio photos per screen width (`srcset`). Comes with the portfolio feature, where most photos are.
@@ -0,0 +1,182 @@
# Business Rules — frontend-shell
Rule IDs are referenced by the code generation plan and the tests. "Q" = [frontend-shell-fd-questions.md](../../plans/frontend-shell-fd-questions.md), "CQ" = [frontend-shell-fd-clarification-questions.md](../../plans/frontend-shell-fd-clarification-questions.md).
## Back-to-top button
| ID | Rule | Source |
|---|---|---|
| BR-TOP-01 | Threshold = `backToTopThreshold(viewportHeight)` = `0.6 × max(0, viewportHeight)`. Non-finite input counts as 0. | FR-06 |
| BR-TOP-02 | Visible when `scrollY > threshold` (strictly greater), otherwise hidden. Evaluated on mount and on every (passive) scroll event via `useScrolledPast`. | FR-06 |
| BR-TOP-03 | Hidden means `visibility: hidden`: not focusable, not in the accessibility tree, not clickable. | FR-06 |
| BR-TOP-04 | Show/hide animation: fade + 8px upward slide with the `interaction` duration and `smooth` easing. Under `prefers-reduced-motion: reduce`: instant, no transition. | Q3 = A |
| BR-TOP-05 | Click: scroll to the top, `smooth`, or `instant` under reduced motion. | FR-06 |
| BR-TOP-06 | After the click, focus moves to `main#main` with `preventScroll`, so the smooth scroll is not interrupted. `main` shows no focus ring for programmatic focus. | Q2 = A |
| BR-TOP-07 | Appearance: `ink` background, white `up-outlined` icon, no border, square, 46×46px. Hover/focus-visible: background `accent.deep`. Focus-visible also shows a focus ring. | CQ1 = A, Q4 = A |
| BR-TOP-08 | Position: fixed at the bottom right. The right offset is the design offset (`clamp(1rem, 3vw, 2rem)`), but on viewports wider than the `Container` max width it aligns with the container's right edge instead of the screen corner. | CQ2 = A |
| BR-TOP-09 | Stacking: below the header and the mobile menu. | FR-06 |
## Hero slides
| ID | Rule | Source |
|---|---|---|
| BR-HERO-01 | Only the active slide loads first. Once it has loaded and been painted, `slidesToLoad(active, count)` decides which slides are mounted: the active one, the next and the previous, wrapping around (from the first slide the previous is the last). Slides further away load when the slider gets near them. | Code change Q3 = A |
## Social links
| ID | Rule | Source |
|---|---|---|
| BR-SOC-01 | `visibleSocials(socials)` keeps a link only when `href` parses as a URL with protocol `https:`. Empty, `http:`, `javascript:`, relative or unparseable values are dropped. | Q5 = A |
| BR-SOC-02 | Order is preserved; no entries are added or changed. | — |
| BR-SOC-03 | Hero and Footer both use `visibleSocials`; the Hero shows icons, the Footer shows platform names. | FR-04, AD D11 |
| BR-SOC-04 | External links open in a new tab with `rel="noopener noreferrer"`. | NFR-04 |
## E-mail address
| ID | Rule | Source |
|---|---|---|
| BR-EMAIL-01 | The address is stored as `{ user, domain }` and joined in the browser by `emailAddress(parts)` at render time. The complete address is never a literal in source, bundle or content data. | CQ3 = A |
| BR-EMAIL-02 | `emailAddress` returns `null` when the parts are invalid: either part empty, containing whitespace or `@`, or a domain without a `.`. Otherwise it returns `user@domain`. | CQ3 = A |
| BR-EMAIL-03 | The Footer shows the joined address as link text with `href="mailto:<address>"`, as in the design. | CQ3 = A |
## Footer
| ID | Rule | Source |
|---|---|---|
| BR-FOOT-01 | A column with nothing to show is omitted entirely (heading included): Socials when `visibleSocials` is empty, Contact when `emailAddress` is `null`. The grid closes up. | Q6 = A |
| BR-FOOT-02 | Copyright: `copyrightLine(year)` = `"© {year} Andrea Slop Fotografie"`, with `year = new Date().getFullYear()` at render. | FR-05 |
| BR-FOOT-03 | Footer menu links get `aria-current="page"` when active (router default), with **no** visual difference. | Q7 = B |
| BR-FOOT-04 | Link colours: `ink.soft`, hover/focus `accent.deep` (`link` variant `subtle`). Column headings and bottom bar use `ink.soft`. | NFR-01 |
## Navigation
| ID | Rule | Source |
|---|---|---|
| BR-NAV-01 | `mainNav` and `footerNav` each contain no duplicate `to`. | — |
| BR-NAV-02 | `mainNav` starts with Home `/` and does not contain `/privacyverklaring`. | FR-02 |
| BR-NAV-03 | Every `to` in both menus is a registered route (type-checked). | AD D4 |
## Not-found page
| ID | Rule | Source |
|---|---|---|
| BR-404-01 | Any URL without a matching route renders `NotFound` inside the shell (root `notFoundComponent`). | FR-09 |
| BR-404-02 | `NotFound` renders its own `<title>` "Pagina niet gevonden \| Andrea Slop Fotografie" and `<meta name="robots" content="noindex">`. React 19 hoists both into `<head>` and removes them on navigation. Only the root route matches, and it sets no title, so there is no duplicate `<title>`. | Q1 = A |
## Error page
| ID | Rule | Source |
|---|---|---|
| BR-ERR-01 | Render and route errors render `ErrorPage`: inside the shell for page errors, without the shell for errors in the shell itself. | FR-10, AD services |
| BR-ERR-02 | `ErrorPage` never renders the error message, stack or any error property. | SECURITY-09/15 |
| BR-ERR-03 | `ErrorPage` logs the error once with `console.error(error)`, in every environment. | Q11 = A |
| BR-ERR-04 | Actions: "Opnieuw proberen" (resets the error boundary and invalidates the router, so the route loads again) and "Terug naar home". | Q10 = B |
| BR-ERR-05 | `ErrorPage` sets `<title>` "Er ging iets mis \| Andrea Slop Fotografie" and `robots: noindex`, the same way as BR-404-02. | Derived from BR-404-02 |
## SEO (change request)
"CH" = [frontend-shell-fd-change-questions.md](../../plans/frontend-shell-fd-change-questions.md).
| ID | Rule | Source |
|---|---|---|
| BR-SEO-01 | Every route takes its title, description and `indexed` flag from the `sitePages` registry via `pageHead(path)`. Title = `"{title} \| Andrea Slop Fotografie"`. Home keeps its full keyword title. | FR-01, CH |
| BR-SEO-02 | Every page sets `<link rel="canonical">` and `og:url` to `canonicalUrl(path)` = `siteUrl` + path. No trailing slash (the root is `siteUrl/`), no query, no hash. | CH Q2 = A |
| BR-SEO-03 | Pages with `indexed: false`, the 404 page and the error page set `robots: noindex`. Indexed pages set no robots tag. | CH |
| BR-SEO-04 | Every page has `og:image` (absolute URL), `og:image:alt`, `og:image:width`/`height` and `twitter:card = summary_large_image`. The default is `defaultOgImage`; a page may override it. The fallback head in `index.html` has the same tags for the home page. | CH Q3 = A |
| BR-SEO-05 | The root head renders one `ProfessionalService` JSON-LD block. It sits where `HeadContent` renders (in the body of this SPA); Google reads JSON-LD anywhere in the page. `jsonLdScript` serialises it with `<`, `>` and `&` escaped as `<`, `>`, `&`, so content can never close the `<script>` element. | CH Q4 = A, security |
| BR-SEO-06 | At build time a small Vite plugin generates `sitemap.xml` from `sitePages`: one `<url><loc>` per indexed page, as an absolute, XML-escaped URL. No `lastmod`, because Google ignores unreliable values. | CH Q5 = B |
| BR-SEO-07 | A test fails when a route has no `sitePages` entry, or an entry has no route. | CH Q5 (check from A) |
| BR-SEO-08 | `public/robots.txt` allows everything and points to `https://andreaslop.nl/sitemap.xml`. | CH Q5 |
| BR-SEO-09 | Exactly one `h1` per page, and no skipped heading levels. Footer column headings are `h2` (styled as `eyebrow`), because they are top-level sections of the page. | CH |
| BR-SEO-10 | Internal navigation uses real `<a href>` links (router `Link`). Images: <ul><li>a meaningful `alt`, or `alt=""` when decorative</li><li>`width`/`height` against layout shift</li><li>`loading="lazy"` below the fold</li><li>the first hero slide loads eagerly with `fetchpriority="high"`</li></ul> | CH |
| BR-SEO-11 | No `window` or `document` access during render, only in effects and handlers. All head data goes through route `head`. This keeps prerendering possible later without rework. | CH Q1 = A |
## Screen readers and keyboard (change request)
| ID | Rule | Source |
|---|---|---|
| BR-A11Y-01 | After every client-side page change, focus moves to `main#main` with `preventScroll`. A page change means the pathname changes; the first load does not count. The router's scroll restoration keeps handling the scroll position. Same mechanism as the skip link and BR-TOP-06. | CH Q6 = A |
| BR-A11Y-02 | Landmarks: <ul><li>one `header`</li><li>`nav aria-label="Hoofdmenu"` and `nav aria-label="Mobiel menu"`</li><li>one `main#main`</li><li>one `footer` with `nav aria-label="Footermenu"`</li></ul> | NFR-01 |
| BR-A11Y-03 | Links that open a new tab announce it. Text links get the visually hidden text " (opent in nieuw tabblad)". Icon-only links get it in their `aria-label`, e.g. "Instagram (opent in nieuw tabblad)". | CH |
| BR-A11Y-04 | Icons are `aria-hidden`; icon-only controls have an `aria-label`. | NFR-01 |
| BR-A11Y-05 | The whole site has one focus style, from the theme (BR-THEME-02). Components do not define their own outline; they may only switch the ring colour on photos. | CH |
| BR-A11Y-06 | `main` and other programmatic focus targets (`tabIndex=-1`) show no focus ring. | BR-TOP-06 |
| BR-A11Y-07 | All animations and smooth scrolling are off under `prefers-reduced-motion: reduce`. | NFR-01 |
## Responsive (change request)
| ID | Rule | Source |
|---|---|---|
| BR-RWD-01 | Mobile-first, with Chakra's default breakpoints: `sm` 480, `md` 768, `lg` 1024, `xl` 1280, `2xl` 1536. Per-component behaviour is in [frontend-components.md](frontend-components.md). | CH |
| BR-RWD-02 | No horizontal scrolling from 320px wide up to 32:9 (WCAG 1.4.10 Reflow). | CH |
| BR-RWD-03 | Text sizes are in `rem`. At 200% browser zoom no content is clipped or overlaps (WCAG 1.4.4). | CH |
| BR-RWD-04 | Below `lg`, touch targets are at least 44×44px: menu items, footer links, to-top, hamburger and hero controls. Footer links reach this with vertical padding, not with bigger text. | CH |
| BR-RWD-05 | Page content never exceeds the shared content width (BR-THEME-04). On ultrawide screens it is centred, and fixed elements align with it (BR-TOP-08). | CH, CQ2 |
## Reuse via Chakra and the theme (change request)
| ID | Rule | Source |
|---|---|---|
| BR-THEME-01 | A value that exists as a token is never hard-coded. That covers colours, spacing (`gutter`, `header`), durations, easings, letter spacing and z-index. | NFR-02 |
| BR-THEME-02 | Focus ring: one global `:focus-visible` style in `globalCss` (2px outline, 2px offset). Its colour comes from the semantic token `focusRing` (`accent.deep`). On photos, the `iconControl` recipe switches it to white. | CH |
| BR-THEME-03 | A new text style `pageTitle` is used for every page `h1` (PageIntro, StatusPage). `eyebrow` stays the one label style. | NFR-02 |
| BR-THEME-04 | A new size token `content` holds the `Container` max width. `Container` and BackToTop's alignment both use it, so there is only one width. | CQ2, NFR-02 |
| BR-THEME-05 | New z-index tokens `header`, `mobileNav`, `menuToggle` and `backToTop` replace the current `docked`, `calc(docked - 1)` and `modal` values. They make the stacking order (BR-TOP-09) explicit in one place. | CH |
| BR-THEME-06 | A new spacing token `pageTop` holds the header height plus standard spacing. PageIntro and StatusPage use it instead of each computing their own offset. | NFR-02 |
| BR-THEME-07 | Shared component styles are recipes (`linkButton`, `link` variant `subtle`, `iconControl`, `skipNavLink`), not repeated style props. A one-off style stays local; it gets no recipe. | NFR-02 |
## Decision Logic
```mermaid
graph TD
Start["Render footer"] --> Soc{"visibleSocials non-empty?"}
Soc -->|"yes"| ShowSoc["Show Socials column"]
Soc -->|"no"| HideSoc["Omit Socials column"]
ShowSoc --> Mail{"emailAddress valid?"}
HideSoc --> Mail
Mail -->|"yes"| ShowMail["Show Contact column with mailto link"]
Mail -->|"no"| HideMail["Omit Contact column"]
Scroll["Scroll event"] --> Past{"scrollY greater than 0.6 x viewport?"}
Past -->|"yes"| Visible["To-top visible"]
Past -->|"no"| Hidden["To-top hidden, not focusable"]
classDef decision fill:#f6e05e,stroke:#c05621,stroke-width:1px,color:#000;
classDef show fill:#9ae6b4,stroke:#2f855a,stroke-width:1px,color:#000;
classDef hide fill:#e9d5ff,stroke:#6b21a8,stroke-width:1px,color:#000;
classDef start fill:#63b3ed,stroke:#2b6cb0,stroke-width:1px,color:#000;
class Soc,Mail,Past decision;
class ShowSoc,ShowMail,Visible show;
class HideSoc,HideMail,Hidden hide;
class Start,Scroll start;
```
Text alternative: the footer shows the Socials column only when at least one valid social link remains and the Contact column only when the e-mail parts are valid; the to-top button is visible only when scrolled past 60% of the viewport height.
## Testable Properties (PBT-01)
| Function / component | Property | Category |
|---|---|---|
| `backToTopThreshold` | For any finite `h ≥ 0`: `0 ≤ t(h) ≤ h` | Invariant |
| `backToTopThreshold` | For finite `h1 ≤ h2`: `t(h1) ≤ t(h2)` (monotonic; non-finite input is 0 by BR-TOP-01) | Invariant |
| `backToTopThreshold` | Equals the model `0.6 × max(0, h)`; non-finite or negative input gives 0 | Oracle |
| `visibleSocials` | `visibleSocials(visibleSocials(x)) = visibleSocials(x)` | Idempotence |
| `visibleSocials` | Output is an order-preserving subsequence of the input | Invariant |
| `visibleSocials` | Every output `href` has protocol `https:`; every input with an `https:` URL is kept | Easy verification / Oracle |
| `emailAddress` | For valid parts: splitting the result at `@` returns the original `{ user, domain }` | Round-trip |
| `emailAddress` | Result is `null` or contains exactly one `@` and no whitespace | Invariant |
| `copyrightLine` | For any integer year: extracting the number from the line returns the year | Round-trip |
| `copyrightLine` | Always starts with `©` and ends with "Andrea Slop Fotografie" | Invariant |
| `canonicalUrl` | Idempotent: canonicalising the path of a canonical URL yields the same URL. Always starts with `siteUrl`; never ends with `/` except the root; never contains `?` or `#` | Idempotence / Invariant |
| `sitemapXml` | For any page list, the set of `<loc>` values equals the set of canonical URLs of the indexed pages, each exactly once | Oracle / Invariant |
| `sitemapXml` | Output is well-formed XML even for paths with `&`, `<`, `'` or `"`; parsing it back yields the original URLs | Round-trip |
| `jsonLdScript` | `JSON.parse(jsonLdScript(x))` deep-equals `x` for any JSON value with arbitrary strings | Round-trip |
| `jsonLdScript` | Output never contains `<`, so `</script` cannot occur | Invariant |
| `slidesToLoad` | Unique valid indexes, `min(count, 3)` of them, the active one first | Invariant |
| `slidesToLoad` | Every returned slide is at most one step away from the active one, wrapping around | Oracle |
| `sitePages` vs route tree | Same set of paths (BR-SEO-07; static data, example-based) | — |
| `mainNav`, `footerNav` | BR-NAV-01/02 (static data; example-based tests, no generator needed) | — |
**No PBT properties identified** (example-based tests only):
- `AppShell`, `NavigationBar`, `PageIntro`, `StatusPage`, `NotFound`, `ErrorPage`, `Footer`, `BackToTop` components: rendering and interaction with fixed inputs. Their logic lives in the pure functions above.
- Theme recipes: static style data.
@@ -0,0 +1,163 @@
# Domain Entities — frontend-shell
The shell has no back-end data. Its "domain" is the site-wide content that will later come from the CMS API, plus the menus, which are code. Every content type is plain data (strings, objects, arrays), so it can later be replaced 1-on-1 by an API response.
Decisions: [frontend-shell-fd-questions.md](../../plans/frontend-shell-fd-questions.md), [frontend-shell-fd-clarification-questions.md](../../plans/frontend-shell-fd-clarification-questions.md).
## Entity Relationships
```mermaid
graph TD
SiteContent["SiteContent"]
SocialLink["SocialLink"]
EmailAddress["EmailAddress"]
SocialPlatform["SocialPlatform registry"]
HeroContent["HeroContent"]
HeroSlide["HeroSlide"]
HeroCta["HeroCta"]
NavItem["NavItem"]
Routes["Registered routes"]
SiteContent -->|"has 0..n"| SocialLink
SiteContent -->|"has 1"| EmailAddress
SocialLink -->|"refers to"| SocialPlatform
HeroContent -->|"has 1..n"| HeroSlide
HeroContent -->|"has 1"| HeroCta
HeroCta -->|"points to"| Routes
NavItem -->|"points to"| Routes
classDef content fill:#2196F3,stroke:#0d47a1,stroke-width:1px,color:#000;
classDef value fill:#FF9800,stroke:#e65100,stroke-width:1px,color:#000;
classDef code fill:#9ae6b4,stroke:#2f855a,stroke-width:1px,color:#000;
class SiteContent,HeroContent content;
class SocialLink,EmailAddress,HeroSlide,HeroCta value;
class SocialPlatform,NavItem,Routes code;
```
Text alternative: SiteContent holds social links (each referring to a platform in the registry) and one e-mail address; HeroContent holds slides and a CTA pointing to a route; nav items point to routes (blue = CMS content, orange = value objects, green = code).
## Content (later from the CMS) — `content/types.ts`
### SiteContent
| Field | Type | Required | Description |
|---|---|---|---|
| `footerIntro` | `string` | yes | Intro text under the footer logo |
| `socials` | `SocialLink[]` | yes (may be empty) | Social profiles; shown in Hero (icons) and Footer (names) |
| `email` | `EmailAddress` | yes | Contact address, **stored in parts** (anti-spam, clarification Q3 = A) |
Static value until the API exists:
- `footerIntro`: "Lifestyle fotograaf uit Huizen.
Ik leg jouw mooiste momenten vast." (each sentence on its own line; line breaks in the content are kept, so the CMS can use a plain text area)
- `socials`: Facebook and Instagram (the current links from `heroContent.ts`)
- `email`: `{ user: 'info', domain: 'andreaslop.nl' }`
### EmailAddress (new value object)
| Field | Type | Required | Description |
|---|---|---|---|
| `user` | `string` | yes | Part before the `@` |
| `domain` | `string` | yes | Part after the `@` |
**Why parts**: the complete address then appears in neither the HTML nor the JavaScript bundle nor (later) the API response. It is joined only in the browser at render time (BR-EMAIL-01). This **refines FR-04 and the Application Design**, where `email` was a `string`.
### SocialLink (renamed from `HeroSocial`)
| Field | Type | Required | Description |
|---|---|---|---|
| `platform` | `SocialPlatform` | yes | Key into the platform registry |
| `href` | `string` | yes | Profile URL; only shown when it is a valid `https://` URL (BR-SOC-01) |
### HeroContent, HeroSlide, HeroCta (moved from `Hero/types.ts`)
Unchanged, except that `HeroContent.socials` is removed. The Hero receives `SiteContent.socials` as a separate prop.
| Entity | Fields |
|---|---|
| `HeroContent` | `title`, `tagline`, `cta: HeroCta`, `slides: HeroSlide[]` |
| `HeroSlide` | `id`, `src`, `alt` |
| `HeroCta` | `label`, `to` |
## Code (not content)
### SocialPlatform registry — `content/socialPlatforms.ts`
A fixed set of supported platforms: `facebook` and `instagram`, each with a display `name` and bundled `icon`. The CMS supplies only links. A platform outside the registry is a type error.
### NavItem — `navigation.ts`
| Field | Type | Description |
|---|---|---|
| `to` | registered route path | A typo is a type error |
| `label` | `string` | Menu text |
| Menu | Items, in order |
|---|---|
| `mainNav` | Home `/`, Over mij `/over-mij`, Portfolio `/portfolio`, Soorten fotoshoots `/soorten-fotoshoots`, Contact `/contact` |
| `footerNav` | Portfolio, Soorten fotoshoots, Contact, Privacyverklaring `/privacyverklaring` |
### Page copy (code until the real pages exist)
Placeholder, 404 and error page texts are fixed strings in their components. See [frontend-components.md](frontend-components.md).
## SEO entities (change request)
Decisions: [frontend-shell-fd-change-questions.md](../../plans/frontend-shell-fd-change-questions.md) ("CH").
```mermaid
graph TD
SiteConfig["siteUrl and site defaults"]
SitePage["SitePage registry"]
Route["Route file"]
Head["Page head"]
Sitemap["sitemap.xml"]
JsonLd["ProfessionalService JSON-LD"]
Socials["SiteContent.socials"]
Route -->|"looks up its"| SitePage
SitePage -->|"feeds"| Head
SiteConfig -->|"base URL for"| Head
SitePage -->|"indexed pages generate"| Sitemap
SiteConfig -->|"base URL for"| Sitemap
SiteConfig -->|"name, url, logo"| JsonLd
Socials -->|"sameAs"| JsonLd
classDef code fill:#9ae6b4,stroke:#2f855a,stroke-width:1px,color:#000;
classDef output fill:#63b3ed,stroke:#2b6cb0,stroke-width:1px,color:#000;
classDef content fill:#2196F3,stroke:#0d47a1,stroke-width:1px,color:#000;
class SiteConfig,SitePage,Route code;
class Head,Sitemap,JsonLd output;
class Socials content;
```
Text alternative: the page registry is the single source for each route's head and for the generated sitemap; the site configuration supplies the base URL, and the JSON-LD block combines site data with the social links (green = code, blue = generated output, dark blue = content).
### Site configuration — `seo.ts`
| Constant | Value | Use |
|---|---|---|
| `siteUrl` | `https://andreaslop.nl` (no `www`, no trailing slash) | Canonical URLs, `og:url`, `og:image`, sitemap, JSON-LD (CH Q2 = A) |
| `siteName` | `Andrea Slop Fotografie` | `og:site_name`, title suffix, JSON-LD |
| `defaultOgImage` | `/og-image.jpg`, 1200×630, a crop of a hero photo, with alt text | Site-wide preview image; a page may override it (CH Q3 = A) |
### SitePage registry — `sitePages.ts` (new)
The single list of pages. Route heads and the sitemap both read it, so they cannot drift apart.
| Field | Type | Description |
|---|---|---|
| `path` | registered route path | Type-checked against the route tree |
| `title` | `string` | Page title without the site suffix (≤ ~60 chars including suffix) |
| `description` | `string` | Meta description (≤ ~155 chars) |
| `indexed` | `boolean` | `true`: in the sitemap, no robots tag. `false`: `noindex`, not in the sitemap |
| `ogImage?` | `string` | Optional page-specific preview image |
Initial values:
- `/` is indexed.
- `/over-mij`, `/portfolio`, `/soorten-fotoshoots`, `/contact` and `/privacyverklaring` are **not** indexed while they are placeholders.
- Putting a real page live means flipping `indexed` to `true`.
The 404 and error pages are not in the registry. They are not routes, and always set `noindex` themselves.
### Structured data — ProfessionalService (CH Q4 = A)
| Property | Value |
|---|---|
| `@type` | `ProfessionalService` |
| `name`, `url`, `logo`, `image` | `siteName`, `siteUrl`, absolute logo URL, `defaultOgImage` |
| `address` | `PostalAddress` with `addressLocality` Huizen, `addressCountry` NL |
| `areaServed` | `Place` "Huizen" |
| `sameAs` | hrefs of `visibleSocials(siteContent.socials)` |
| e-mail | **Deliberately absent** (BR-EMAIL-01) |
@@ -0,0 +1,188 @@
# Frontend Components — frontend-shell
Paths relative to `web/src/`. Builds on [components.md](../../../inception/application-design/components.md); this file adds behaviour, state and final copy. Rule IDs refer to [business-rules.md](business-rules.md).
## Component Hierarchy
```mermaid
graph TD
root["__root.tsx RootLayout"]
head["HeadContent"]
shell["AppShell"]
skip["SkipNavLink"]
nav["NavigationBar"]
navlink["NavLink"]
mobile["MobileNav"]
main["SkipNavContent as main"]
outlet["Outlet"]
pages["Route pages"]
intro["PageIntro"]
hero["Hero"]
notfound["NotFound"]
errorp["ErrorPage"]
status["StatusPage"]
footer["Footer"]
col["FooterColumn"]
top["BackToTop"]
rlink["RouterLink"]
lbtn["LinkButton"]
scrolled["useScrolledPast"]
root --> head
root --> shell
shell --> skip
shell --> nav
shell --> main
shell --> footer
shell --> top
nav --> navlink
nav --> mobile
main --> outlet
outlet --> pages
outlet --> notfound
outlet --> errorp
pages --> intro
pages --> hero
notfound --> status
errorp --> status
status --> lbtn
footer --> col
navlink --> rlink
mobile --> rlink
lbtn --> rlink
footer --> rlink
nav --> scrolled
top --> scrolled
classDef layout fill:#4CAF50,stroke:#2e7d32,stroke-width:1px,color:#000;
classDef ui fill:#2196F3,stroke:#0d47a1,stroke-width:1px,color:#000;
classDef hook fill:#9C27B0,stroke:#4a148c,stroke-width:1px,color:#000;
classDef chakra fill:#FF9800,stroke:#e65100,stroke-width:1px,color:#000;
class root,shell,main,outlet layout;
class nav,navlink,mobile,pages,intro,hero,notfound,errorp,status,footer,col,top,lbtn ui;
class rlink,scrolled hook;
class head,skip chakra;
```
Text alternative: the root layout renders HeadContent and AppShell; AppShell holds the skip link, NavigationBar, main (with the routed page, NotFound or ErrorPage), Footer and BackToTop; NotFound and ErrorPage share StatusPage; all router links go through RouterLink and both NavigationBar and BackToTop use useScrolledPast (green = layout, blue = UI, purple = shared primitive/hook, orange = built-in).
## Components
### AppShell
- **Props / state**: none
- **Renders**: `SkipNavLink` "Direct naar de inhoud" → `NavigationBar` → `SkipNavContent as="main" id="main"` with `<Outlet />` → `Footer content={siteContent}` → `BackToTop`
- **Hook**: `useRouteFocus()` (new, `hooks/`) subscribes to the router's resolved event and moves focus to `main#main` when the pathname changes, skipping the first load (BR-A11Y-01)
### RootLayout (`__root.tsx`)
- Root `head`: `siteHead` (site-wide Open Graph and `twitter:card` tags, default `og:image`) plus the JSON-LD script from `jsonLdScript(professionalService(siteContent))` (BR-SEO-04, -05)
### Route heads
- Each route calls `pageHead('/portfolio')` etc. `pageHead` looks up the `sitePages` entry and returns title, description, canonical link, `og:url`, `og:title`, `og:description`, `og:image` and, for `indexed: false`, `robots: noindex` (BR-SEO-01 to -04)
### Footer (+ local FooterColumn)
- **Props**: `content: SiteContent`. **State**: none.
- **Derived**: `socials = visibleSocials(content.socials)`, `email = emailAddress(content.email)`, `year = new Date().getFullYear()`
- **Top section** (`SimpleGrid`, 1 / 2 / 3 columns):
- Brand: `logo-dark.png` (alt "Andrea Slop Fotografie") + `footerIntro` with its line breaks kept. Mobile: logo 150px and text centred, stacked. Tablet and desktop: logo 110px with the text beside it, vertically centred (footer review)
- "Socials": text links with the platform name plus visually hidden " (opent in nieuw tabblad)"; omitted when empty (BR-FOOT-01, BR-A11Y-03)
- "Contact": `mailto:` link with the address as text; omitted when `email` is `null`
- Column headings are `h2` with `textStyle="eyebrow"` (BR-SEO-09); the logo has `width`/`height` and `loading="lazy"` (BR-SEO-10)
- **Bottom bar**: `copyrightLine(year)` + `nav aria-label="Footermenu"` with `footerNav`. Stacked and centred on mobile.
- **Links**: `Link variant="subtle"`; internal via `asChild` + `RouterLink` (`aria-current` without visual change, BR-FOOT-03)
### BackToTop
- **Props**: none. **State**: `visible` from `useScrolledPast(threshold)`; `threshold` is a module-level function `() => backToTopThreshold(window.innerHeight)`.
- **Renders**: `chakra.button` with `aria-label="Terug naar boven"` and the `up-outlined` icon (`aria-hidden`)
- **Behaviour**: BR-TOP-01…09. Click handler:
1. `reduced = matchMedia('(prefers-reduced-motion: reduce)').matches`
2. `window.scrollTo({ top: 0, behavior: reduced ? 'instant' : 'smooth' })`
3. `document.getElementById('main')?.focus({ preventScroll: true })`
### PageIntro
- **Props**: `title`, `eyebrow?`, `children?`
- **Renders**: `pt="pageTop"`, `Container`, eyebrow (`textStyle="eyebrow"`), one `h1` (`textStyle="pageTitle"`), children
### StatusPage
- **Props**: `title`, `children` (message), `actions?: ReactNode`. Defaults to one `LinkButton to="/"` "Terug naar home".
- **Refinement of the Application Design**: `action?: { label, to }` becomes `actions?: ReactNode`, because the error page needs a `button` next to a link (BR-ERR-04).
- **Renders**: `pt="pageTop"`, centred `Container`, one `h1` (`textStyle="pageTitle"`), text, action row
### NotFound
- Renders `<title>` + `<meta name="robots" content="noindex">` (BR-404-02) and `StatusPage`
### ErrorPage
- **Props**: `ErrorComponentProps` (`error`, `reset`). `error` is used only for logging.
- `useEffect(() => console.error(error), [error])` (BR-ERR-03)
- Renders `<title>` + `noindex` (BR-ERR-05) and `StatusPage` with two actions:
- "Opnieuw proberen": `chakra.button` with the `linkButton` recipe, variant `accent`. On click: `reset()` and `router.invalidate()`
- "Terug naar home": `LinkButton variant="outline"`
### NavigationBar, NavLink, MobileNav
- Menu from `mainNav`. Logo wrapped in `RouterLink to="/"` with `aria-label="Andrea Slop Fotografie, naar de homepage"`. Otherwise unchanged.
### Hero, HeroSocials, HeroArrows
- `Hero` props `content: HeroContent` and `socials: SocialLink[]`. `HeroSocials` renders `visibleSocials(socials)` with `aria-label` "{name} (opent in nieuw tabblad)". Both icon controls use the `iconControl` recipe, which also turns the focus ring white on photos.
- The first slide loads eagerly with `fetchpriority="high"`, the others lazily (BR-SEO-10).
## Responsive Behaviour (BR-RWD-01 to -05)
| Component | base (< 768) | md (768–1023) | lg (≥ 1024) | Ultrawide |
|---|---|---|---|---|
| NavigationBar | 66px, hamburger + mobile menu, always solid | same as base | 92px → 68px after scrolling, inline menu, transparent over the hero | content width centred |
| Footer top | 1 column | 2 equal columns; the third wraps to a new row | 3 columns, `1.2fr 1fr 1fr` | content width centred |
| Footer bottom bar | stacked, centred | one row: © left, menu right | same as md | content width centred |
| PageIntro / StatusPage | `gutter` side margin, title size `pageTitle` base | larger `pageTitle` | largest `pageTitle` | content width centred |
| BackToTop | 46px, design offset, 44px+ target | same | same | aligned to the content edge (BR-TOP-08) |
| Hero | full-screen photo, controls 44px+ | same | same | photo fills the width, text in the content width |
Every column: no horizontal scroll from 320px; works at 200% zoom.
## Theme Usage (BR-THEME-01 to -07)
| Shared piece | Kind | Status | Used by |
|---|---|---|---|
| `paper`, `ink`, `ink.soft`, `line`, `accent.deep` | colour tokens | existing | all |
| `focusRing` | semantic colour token + global `:focus-visible` | new | every focusable element |
| `gutter`, `header` | spacing tokens | existing | NavigationBar, Footer, PageIntro, StatusPage |
| `pageTop` | spacing token | new | PageIntro, StatusPage |
| `content` | size token | new | `Container` recipe, BackToTop |
| `header`, `mobileNav`, `menuToggle`, `backToTop` | z-index tokens | new | NavigationBar, MobileNav, BackToTop |
| `interaction`, `smooth` | duration/easing | existing | all transitions |
| `eyebrow` | text style | existing | footer headings, PageIntro eyebrow, buttons |
| `pageTitle` | text style | new | PageIntro, StatusPage |
| `linkButton` | recipe | existing | LinkButton, ErrorPage retry button |
| `link` variant `subtle` | recipe variant | new | Footer |
| `iconControl` | recipe | new | HeroArrows, HeroSocials |
| `skipNavLink` | recipe override | new | SkipNavLink |
| `RouterLink` | shared primitive | new | NavLink, MobileNav, LinkButton, logo, Footer |
## Copy
### Placeholder pages (Q8 = A)
Every placeholder uses `PageIntro` with the line **"Deze pagina is nog in de maak. Kom snel terug!"**
| Route | Eyebrow | `h1` |
|---|---|---|
| `/over-mij` | Andrea Slop Fotografie | Over mij |
| `/portfolio` | Werk | Portfolio |
| `/soorten-fotoshoots` | Mogelijkheden | Soorten fotoshoots |
| `/contact` | Neem contact op | Contact |
| `/privacyverklaring` | Privacy | Privacyverklaring |
### Status pages
| Page | `h1` | Text | Actions |
|---|---|---|---|
| 404 (Q9 = A) | Pagina niet gevonden | Deze pagina bestaat niet (meer). Misschien is de link verouderd of zit er een typfout in het adres. | Terug naar home |
| Error (Q10 = B) | Er ging iets mis | Door een fout kan deze pagina nu niet worden getoond. Probeer het opnieuw of ga terug naar de homepage. | Opnieuw proberen, Terug naar home |
## User Interaction Flows
- **Keyboard, first Tab**: skip link appears → Enter → focus in `main#main`
- **Back to top**: scroll down → button appears → click/Enter → page scrolls up, focus in `main`, button hides
- **Page change**: click a menu link → new page at the top, focus in `main`, screen reader reads the new content
- **Unknown URL**: shell + 404 → "Terug naar home"
- **Page error**: shell + error page → "Opnieuw proberen" re-renders the route, or "Terug naar home"
## Forms and API Integration
- **Forms**: none in the shell. The contact form is a later feature (see business-logic-model.md, Recommendations).
- **API**: none yet. `siteContent` and `heroContent` are static modules shaped like the future CMS responses.
@@ -0,0 +1,107 @@
# NFR Requirements — frontend-shell
Refines requirements NFR-01…NFR-06 into measurable criteria. Decisions: [frontend-shell-nfr-requirements-plan.md](../../plans/frontend-shell-nfr-requirements-plan.md) ("Q"), [frontend-shell-nfr-clarification-questions.md](../../plans/frontend-shell-nfr-clarification-questions.md) ("CQ"). Business rules (BR-*) are in [business-rules.md](../functional-design/business-rules.md).
## Quality Gates Overview
```mermaid
graph LR
Code["Code change"] --> Lint["pnpm lint"]
Lint --> Test["pnpm test incl. PBT, axe, coverage"]
Test --> Build["pnpm build incl. type check and sitemap"]
Build --> Audit["pnpm audit:deps"]
Audit --> LH["pnpm lighthouse on preview"]
LH --> Ready["Release ready"]
Check["pnpm check runs all steps"] -.-> Lint
classDef step fill:#9ae6b4,stroke:#2f855a,stroke-width:1px,color:#000;
classDef gate fill:#63b3ed,stroke:#2b6cb0,stroke-width:1px,color:#000;
classDef done fill:#f6e05e,stroke:#c05621,stroke-width:1px,color:#000;
class Code done;
class Lint,Test,Build,Audit,LH step;
class Check gate;
class Ready done;
```
Text alternative: `pnpm check` runs lint, tests (including property-based and accessibility tests), build, dependency audit and Lighthouse in that order; every step must pass before a release.
## NFR-P Performance
| ID | Requirement | Measure | Source |
|---|---|---|---|
| NFR-P-01 | Lighthouse Performance ≥ 90, mobile and desktop, on every route. **Exception (temporary): home page on mobile ≥ 80**, until responsive images come from the API/CMS and prerendering exists (measured 0.81–0.82). | `pnpm lighthouse` against `pnpm preview`. **Blocking locally** (`pnpm check` on a PC). **Report-only in CI**, because the Raspberry Pi runner is too slow for representative performance scores (Lighthouse slows the CPU 4x relative to the host); reports are attached to every run. | Q3 = B; code change Q1 = B; Lighthouse CI question A |
| NFR-P-02 | No layout shift from shell elements: images have `width`/`height`, fonts are self-hosted | Lighthouse CLS ≤ 0.1 | BR-SEO-10 |
| NFR-P-03 | The shell adds no network requests beyond bundled assets | No third-party origins in the network log | NFR-05 |
| NFR-P-04 | Router devtools are not in the production bundle | Build output does not contain the devtools chunk | SECURITY-09 |
| NFR-P-05 | Scroll handling is passive, and NavigationBar and BackToTop share `useScrolledPast` | Code review | NFR-05 |
## NFR-A Accessibility
| ID | Requirement | Measure | Source |
|---|---|---|---|
| NFR-A-01 | Lighthouse Accessibility = 100, mobile and desktop, on every route | `pnpm lighthouse` | Q3 = B |
| NFR-A-02 | No axe-core violations in the component tests of the shell, placeholder, 404 and error pages | `pnpm test` (`vitest-axe`) | Q4 = A |
| NFR-A-03 | `jsx-a11y` lint rules pass | `pnpm lint` | Q5 = A |
| NFR-A-04 | Keyboard and screen-reader behaviour per BR-A11Y-01…07 and BR-TOP-03/06 | Example-based tests + manual check with NVDA or VoiceOver at Build and Test | NFR-01 |
| NFR-A-05 | Colour contrast per NFR-01. axe in `jsdom` cannot measure contrast, so Lighthouse covers it | NFR-A-01 | Q4 note |
## NFR-S SEO
| ID | Requirement | Measure | Source |
|---|---|---|---|
| NFR-S-01 | Lighthouse SEO = 100 on indexed pages (currently `/`) | `pnpm lighthouse` | CQ1 |
| NFR-S-02 | Non-indexed pages are `noindex` on purpose. Lighthouse's "blocked from indexing" audit is the only allowed SEO failure there | Lighthouse assertion per URL | CQ1 |
| NFR-S-03 | `sitemap.xml` contains exactly the indexed pages; registry and route tree are in sync | `pnpm test` (BR-SEO-07, PBT) + build output | BR-SEO-06/07 |
## NFR-SEC Security
| ID | Requirement | Measure | Source |
|---|---|---|---|
| NFR-SEC-01 | Headers on `preview`: <ul><li>CSP (below)</li><li>HSTS `max-age=31536000; includeSubDomains`</li><li>`nosniff`</li><li>`X-Frame-Options: DENY`</li><li>`Referrer-Policy: strict-origin-when-cross-origin`</li></ul> | Test on the header config + response check at Build and Test | SECURITY-04 |
| NFR-SEC-02 | Production CSP: `default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data:; font-src 'self'; connect-src 'self'; object-src 'none'; base-uri 'self'; form-action 'self'; frame-ancestors 'none'`. `style-src 'unsafe-inline'` is justified: Chakra/Emotion inject runtime styles. | Lighthouse Best Practices: no CSP violations in the console | SECURITY-04 |
| NFR-SEC-03 | The dev server uses the same headers. Its CSP adds only Vite's needs: `'unsafe-inline'` in `script-src` for the React Refresh preamble, and `ws:` in `connect-src` for HMR. These dev exceptions never reach `preview` or production. | Header config test | Q1 = A |
| NFR-SEC-04 | The production CSP has no inline scripts. `next-themes` is removed (Q2 = A); JSON-LD is a non-executed data block. | NFR-SEC-02 | Q2 = A |
| NFR-SEC-05 | `pnpm audit:deps` (`--prod --audit-level high`) passes: no high or critical advisories in packages that ship with the site. Advisories in dev-only tools are reported by `pnpm audit:dev` but do not block. | `pnpm check` | Q8 = A, SECURITY-10; code change Q2 = A |
| NFR-SEC-06 | Dependencies are pinned by `pnpm-lock.yaml`; no unused dependencies; build tools in `devDependencies` | Code review | SECURITY-10 |
| NFR-SEC-07 | No secrets in front-end code; the e-mail address is never a literal (BR-EMAIL-01) | Test: bundle does not contain the joined address | NFR-04, BR-EMAIL-01 |
| NFR-SEC-08 | Error and 404 pages expose no internals (BR-ERR-02) | Example-based test | SECURITY-09/15 |
## NFR-R Reliability
| ID | Requirement | Measure | Source |
|---|---|---|---|
| NFR-R-01 | A render error in a page never blanks the site: the shell stays and ErrorPage shows | Test with a throwing route | FR-10 |
| NFR-R-02 | Errors are logged with `console.error` in every environment (BR-ERR-03). Central logging is out of scope (SECURITY-03 N/A until there is a back-end). | Test | Q11 (FD) |
## NFR-M Maintainability and Testing
| ID | Requirement | Measure | Source |
|---|---|---|---|
| NFR-M-01 | Every testable property in business-rules.md has a fast-check property test. Failures print the seed and shrink. | `pnpm test` | PBT-02…08 |
| NFR-M-02 | 100% statement and branch coverage of the pure functions: `backToTopThreshold`, `visibleSocials`, `emailAddress`, `copyrightLine`, `canonicalUrl`, `sitemapXml`, `jsonLdScript`. No global threshold; coverage is reported. | Vitest coverage with per-file thresholds | Q7 = A |
| NFR-M-03 | ESLint (TypeScript, React Hooks, jsx-a11y) and Prettier pass | `pnpm lint`, `pnpm format:check` | Q5 = A |
| NFR-M-04 | `pnpm check` runs lint, format check, tests, build, audit and Lighthouse, in that order, and fails on the first failing step. It runs locally at any time. | Script | Q8 = A, CQ1 = A |
| NFR-M-05 | No duplicate styling: theme usage per BR-THEME-01…07 | Code review | NFR-02 |
## NFR-B Browser Support
| ID | Requirement | Source |
|---|---|---|
| NFR-B-01 | Supported: the last 2 versions of Chrome, Edge, Firefox and Safari, and Safari on iOS 16+. Older browsers get the site without guarantees. | Q6 = A |
| NFR-B-02 | Features used must work in that set: `color-mix()`, `:focus-visible`, `fetchpriority`, `prefers-reduced-motion`, `scrollTo` behaviour `instant`. `fetchpriority` degrades gracefully. | Q6 = A |
## Not Applicable
| Category | Rationale |
|---|---|
| Scalability | Static site without a server; load is the host's concern |
| Availability / DR | Depends on the future host (Operations phase) |
| Data protection / compliance | No personal data processed by the shell; privacy statement is a placeholder page |
## Follow-ups Outside This Unit
1. **CI/CD**: run `pnpm check` (including Lighthouse) automatically as the final step on every push or pull request, so a forgotten local check is caught early (CQ1). Hand-over to Deployment Setup in the Operations phase.
2. **Wider browser support** (Q6 note): reconsider support for older mobile browsers (e.g. iOS 14/15) once real visitor statistics exist.
3. **Responsive images** (code change Q1): the hero (and later portfolio) images should come in several widths from the API/CMS or an image service, used via `srcset`. Restores NFR-P-01 to 0.9 for the home page together with prerendering.
4. **Production headers**: configure the same header set (NFR-SEC-01/02) on the production host (Operations).
@@ -0,0 +1,104 @@
# Tech Stack Decisions — frontend-shell
Existing stack (unchanged): React 19, TypeScript, Vite, TanStack Router, Chakra UI v3, pnpm. See [technology-stack.md](../../../../../_shared/reverse-engineering/technology-stack.md).
All new packages are installed with pnpm at their latest stable version and pinned by `pnpm-lock.yaml` (SECURITY-10).
## Dependency Changes
| Package | Change | Kind | Why |
|---|---|---|---|
| `vitest` | add | dev | Test runner, native to Vite (NFR-03) |
| `@vitest/coverage-v8` | add | dev | Coverage with per-file thresholds (NFR-M-02) |
| `jsdom` | add | dev | DOM environment for component tests |
| `@testing-library/react`, `@testing-library/user-event`, `@testing-library/jest-dom` | add | dev | Component tests from the user's perspective |
| `fast-check` | add | dev | Property-based testing (PBT-09) |
| `vitest-axe` (on `axe-core`) | add | dev | Accessibility assertions in component tests (Q4 = A) |
| `eslint`, `@eslint/js`, `typescript-eslint`, `eslint-plugin-react-hooks`, `eslint-plugin-jsx-a11y`, `globals` | add | dev | Linting (Q5 = A) |
| `@lhci/cli` | add | dev | Lighthouse CI with assertions (Q3 = B) |
| `next-themes` | **remove** | — | The site is fixed to light; it only added an inline script (Q2 = A) |
| `@vitejs/plugin-react` | move to dev | dev | Build tool (FR-11) |
| `@tanstack/react-router-devtools` | move to dev | dev | Loaded only in development (NFR-P-04) |
## Decisions
### TD-01 Property-based testing: fast-check (PBT-09)
- **Generators**: fast-check provides custom arbitraries for the domain types (`SocialLink`, `EmailAddress`, `SitePage`, paths, JSON values).
- **Shrinking and replay**: shrinking is on by default. On failure, fast-check reports the seed and path, and `fc.assert(..., { seed, path })` replays the exact case.
- **Test runner**: runs as normal Vitest tests, so no separate runner is needed.
- **Default runs**: 100 per property. Raise it per property only when needed.
- **Considered**: `@fast-check/vitest` (adds `test.prop`). Not needed: plain `fc.assert` inside `it` is enough and is one dependency less.
### TD-02 Test environment: Vitest + jsdom
- The Vitest config lives in `vite.config.ts` (`test` section), so tests use the same aliases and plugins as the app.
- Setup file: `@testing-library/jest-dom` matchers + `vitest-axe` matchers.
- Router-dependent components are tested inside a memory-history router.
- **Fallback**: if `vitest-axe` turns out to be incompatible with the installed Vitest version, a ~10-line custom `toHaveNoViolations` matcher on `axe-core` replaces it. Same assertion, one dependency less.
### TD-03 Linting: ESLint flat config
- Rule sets: `@eslint/js` recommended, `typescript-eslint` recommended, `react-hooks` recommended, `jsx-a11y` recommended.
- Prettier remains the formatter. No stylistic ESLint rules, to avoid conflicts.
- Excluded: `routeTree.gen.ts` and `dist`.
### TD-04 Lighthouse CI
- **Server**: `@lhci/cli` starts `pnpm preview`, so the real production headers and the SPA fallback apply. It measures every route in `sitePages` plus one unknown URL (the 404), on both mobile and desktop.
- **Assertions**:
- Performance ≥ 0.9
- Accessibility = 1
- Best Practices = 1
- SEO = 1 on indexed URLs. On `noindex` URLs only the `is-crawlable` audit is allowed to fail (NFR-S-02).
- **Requirements**: a local Chrome/Chromium.
- **Results**: written to `.lighthouseci/`, which is git-ignored. No upload to a public server.
- **Scripts**:
- `pnpm lighthouse` runs it on its own.
- It is part of `pnpm check` (CQ1 = A).
### TD-05 Security headers in Vite
- **One source**: `securityHeaders(mode)` in a small config module, used by `server.headers` (dev) and `preview.headers`.
- Production mode returns the strict set (NFR-SEC-01/02).
- Dev mode adds only the Vite exceptions (NFR-SEC-03).
- **Testing**: the function is pure, so a test can check that the production CSP never contains `unsafe-eval`, never contains `unsafe-inline` in `script-src`, and never contains `ws:`.
- **Production**: the same production set is the required configuration for the future host.
### TD-06 Vite config in TypeScript
- `vite.config.js` becomes `vite.config.ts`. It contains:
- the existing plugins
- the local `sitemap` plugin (BR-SEO-06), which reads `sitePages`
- the security headers (TD-05)
- the Vitest `test` section
- **Plugin**: about 30 lines, using Rollup's `generateBundle` hook to emit `sitemap.xml`. The XML itself comes from the pure, tested `sitemapXml`.
### TD-07 Scripts in `package.json`
| Script | Runs |
|---|---|
| `test` | `vitest run --coverage` |
| `test:watch` | `vitest` |
| `lint` | `eslint .` |
| `format:check` | `prettier --check .` |
| `audit:deps` | `pnpm audit --audit-level high` |
| `lighthouse` | `lhci autorun` |
| `check` | lint → format:check → test → build → audit:deps → lighthouse, stopping at the first failure |
### TD-08 Colour mode
- **Without `next-themes`**: the light theme is the default. The `_dark` semantic token values stay in the theme, so a dark mode can be added later without rework.
- **Considered**: keeping `next-themes` and allowing its script via a CSP hash. Rejected: the hash breaks on every library update, and the script has no use while the site is light-only.
## Security Baseline Compliance (NFR Requirements)
| Rule | Status | Rationale |
|---|---|---|
| SECURITY-04 | Compliant | Header set + CSP defined, `unsafe-inline` only for styles with documented justification (NFR-SEC-01…04) |
| SECURITY-09 | Compliant | Devtools dev-only, starter assets removed, generic error pages |
| SECURITY-10 | Compliant | Lock file, `audit:deps` in `check`, unused `next-themes` removed, build tools in dev |
| SECURITY-13 | Compliant | No CDN resources; Lighthouse CI uploads nothing externally |
| SECURITY-15 | Compliant | Root error boundary (NFR-R-01) |
| SECURITY-03, -14 | N/A | No server component; revisit with the .NET API |
| Others | N/A | As in requirements.md |
## PBT Compliance (NFR Requirements)
| Rule | Status | Rationale |
|---|---|---|
| PBT-09 | Compliant | fast-check: custom arbitraries, shrinking, seed replay, runs in Vitest (TD-01) |
| Others | N/A at this stage | Applied in Code Generation |
@@ -0,0 +1,12 @@
# Build and Test Questions — frontend-shell
## Vraag 1: "SOCIALS" wordt door de schermlezer gespeld
De koptekst is in de code "Socials"; het thema maakt hem met CSS hoofdletters. Schermlezers op mobiel (VoiceOver, TalkBack) lezen de tekst zoals hij in beeld staat, zien "SOCIALS" en behandelen het als een afkorting. "CONTACT" herkennen ze wel als woord. Ik kan mobiele schermlezers hier niet zelf testen, dus na de aanpassing vraag ik je het opnieuw te proberen.
A) De kop een `aria-label` geven met het woord in gewone schrijfwijze ("Socials"). In beeld verandert niets. Moderne schermlezers lezen dan het label in plaats van de hoofdletters, maar niet elke combinatie van schermlezer en browser doet dat even goed.
B) De kop veranderen in "Social media". In beeld staat dan "SOCIAL MEDIA"; twee gewone woorden worden vrijwel altijd als woorden voorgelezen. **(aanbevolen)** Het meest betrouwbaar, en ook voor bezoekers duidelijker.
C) De kop veranderen in "Volg mij", passend bij de Nederlandse toon van de site
X) Anders (beschrijf hieronder na de [Answer]:-tag)
[Answer]: A
@@ -0,0 +1,34 @@
# Code Generation Change Questions — frontend-shell
Meting na je nieuwe afbeeldingen: homepage mobiel **0,82** (doel 0,9), totale download **2,6 MB**. Vul per vraag de letter in na `[Answer]:`. Waar ik een voorkeur heb staat **(aanbevolen)**.
## Vraag 1: Hoe halen we de homepage op mobiel naar 0,9?
Wat nu nog vertraagt: de eerste foto (2560 px breed, ook op een telefoon), de JavaScript-bundel (169 KB gzip, vooral Chakra) en de titel die pas verschijnt als de JavaScript binnen is.
A) Nu responsive afbeeldingen toevoegen: bij het bouwen worden van elke hero-foto kleinere varianten gemaakt (bv. 640, 1280 en 2560 px), en de browser kiest de passende (`srcset`). Telefoons downloaden dan een foto van ±50–80 KB in plaats van 325 KB. Kost één extra dev-afhankelijkheid (`vite-imagetools`). Waarschijnlijk genoeg voor 0,9, maar dat meet ik na. **(aanbevolen)**
B) Het doel voor de homepage op mobiel voorlopig op 0,8 zetten. Responsive afbeeldingen en prerendering pakken we op bij de portfolio-feature.
X) Anders (beschrijf hieronder na de [Answer]:-tag)
[Answer]: B, omdat de data later uit een API komt weet ik niet of responseive foto's met een vite-plugin toevoegen verstandig is voor een tijdelijke situatie. Prerendering pakken we sowieso later op.
## Vraag 2: Wanneer moet de controle op kwetsbare pakketten falen?
De gebouwde site heeft geen kwetsbaarheden (`pnpm audit --prod` is schoon). De 5 meldingen zitten in ontwikkeltools die alleen op jouw computer draaien. Voor de meeste bestaat nog geen oplossing.
A) De check faalt alleen op kwetsbaarheden in pakketten die in de site terechtkomen. Meldingen in ontwikkeltools worden wel getoond, maar blokkeren niet. **(aanbevolen)**
B) Zoals A, en daarnaast Lighthouse CI niet meer als vaste ontwikkeltool installeren, maar bij elke run met een vaste versie ophalen (`pnpm dlx @lhci/cli@0.15.1`). Er staan dan minder pakketten in het project; de meldingen blijven bestaan, maar buiten het project.
C) Zoals vastgelegd: de check faalt op elke hoge melding, ook in ontwikkeltools. Dan faalt `pnpm check` tot de makers van die tools een oplossing uitbrengen.
X) Anders (beschrijf hieronder na de [Answer]:-tag)
[Answer]: A
## Vraag 3: Hoe laden de hero-foto's?
Nu laadt de homepage na de eerste foto direct alle andere foto's (8 stuks, ±2,4 MB), ook als de bezoeker na 10 seconden doorklikt.
A) Alleen de huidige en de volgende foto laden. Elke keer dat de slider doorschuift, wordt de foto daarna opgehaald; met de pijlen terug blijft de vorige ook beschikbaar. Het aantal foto's maakt dan voor de snelheid nauwelijks uit. **(aanbevolen)**
B) Zoals nu: na de eerste foto alles laden
X) Anders (beschrijf hieronder na de [Answer]:-tag)
[Answer]: A, maar je kan vanaf de eerste foto ook terug-klikken naar de laatste foto, dus de actieve foto + de volgende en vorige (of laatste in geval van eerste foto) wil je laden.
@@ -0,0 +1,195 @@
# Code Generation Plan — frontend-shell
**This plan is the single source of truth for Code Generation.** Steps are executed in order; each is checked off as soon as it is done.
## Unit Context
- **Unit**: frontend-shell (single unit, brownfield)
- **Application code**: `web/` (paths below are relative to `web/` unless stated otherwise)
- **Documentation**: `aidlc-docs/features/frontend-shell/construction/frontend-shell/code/` (markdown summaries only)
- **Dependencies on other units**: none. No back-end exists, and content is static and shaped like the future CMS API.
- **Inputs**:
- [requirements.md](../../inception/requirements/requirements.md): FR-01…FR-13, NFR-01…NFR-06
- [application design](../../inception/application-design/application-design.md)
- functional design:
- [business-rules.md](../frontend-shell/functional-design/business-rules.md) (BR-*)
- [frontend-components.md](../frontend-shell/functional-design/frontend-components.md)
- [domain-entities.md](../frontend-shell/functional-design/domain-entities.md)
- NFR:
- [nfr-requirements.md](../frontend-shell/nfr-requirements/nfr-requirements.md) (NFR-P/A/S/SEC/R/M/B)
- [tech-stack-decisions.md](../frontend-shell/nfr-requirements/tech-stack-decisions.md) (TD-*)
- **Conventions** (NFR-02a):
- Code comments in Dutch.
- Prettier style: 4 spaces, single quotes.
- One folder per component.
- Chakra tokens/recipes, no hard-coded values (BR-THEME-01).
- **Test conventions**:
- Tests sit next to the code as `*.test.ts(x)`.
- Queries by role/label first (Testing Library).
- Stable `data-testid` on interactive shell elements, named `{component}-{element-role}`.
- **Traceability**: User Stories were skipped. Each step references FR/NFR/BR/TD IDs instead.
## Steps
### Part A — Tooling and configuration
- [x] **Step 1: Dependencies** (TD dependency table, FR-11, Q2)
- Remove `next-themes`.
- Move `@vitejs/plugin-react` and `@tanstack/react-router-devtools` to `devDependencies`.
- Add dev dependencies with pnpm:
- testing: `vitest`, `@vitest/coverage-v8`, `jsdom`, `@testing-library/react`, `@testing-library/user-event`, `@testing-library/jest-dom`, `fast-check`, `vitest-axe`
- linting: `eslint`, `@eslint/js`, `typescript-eslint`, `eslint-plugin-react-hooks`, `eslint-plugin-jsx-a11y`, `globals`
- Lighthouse: `@lhci/cli`
- [x] **Step 2: Scripts** in `package.json` (TD-07): `test`, `test:watch`, `lint`, `format:check`, `audit:deps`, `lighthouse`, `check`.
- [x] **Step 3: Security headers** — create `config/securityHeaders.ts`, with `securityHeaders(mode: 'production' | 'development')` (TD-05, NFR-SEC-01…03).
- [x] **Step 4: Sitemap plugin** — create `config/sitemapPlugin.ts`. The Vite plugin emits `sitemap.xml` via `sitemapXml(sitePages, siteUrl)` (TD-06, BR-SEO-06).
- [x] **Step 5: Vite config** — `vite.config.js` → `vite.config.ts` (TD-06). It holds:
- the existing plugins plus the sitemap plugin
- `server.headers` and `preview.headers` from `securityHeaders`
- the Vitest `test` section: `jsdom`, setup file, coverage with 100% per-file thresholds for the pure functions (NFR-M-02)
- `tsconfig.json` includes `config` and `vite.config.ts`
- [x] **Step 6: Linting and formatting config**
- `eslint.config.js`, flat config (TD-03)
- `.prettierignore` gets `routeTree.gen.ts`, `.lighthouseci`, `coverage`
- `.gitignore` gets `.lighthouseci`, `coverage`
- [x] **Step 7: Lighthouse CI config** — `lighthouserc.cjs` (TD-04):
- starts `pnpm preview`
- URLs: every `sitePages` path plus `/bestaat-niet` (404)
- presets: mobile and desktop
- assertions per NFR-P-01, NFR-A-01, NFR-S-01/02
- [x] **Step 8: Test setup** — `src/test/setup.ts` with jest-dom and vitest-axe matchers, plus `src/test/renderWithProviders.tsx`, which renders inside the Chakra system and a memory-history router (TD-02).
### Part B — Theme (BR-THEME-01…07)
- [x] **Step 9: Tokens and global styles** in `src/theme.ts`
- Remove `body.height: 250vh` (FR-11).
- New tokens:
- semantic colour `focusRing` (`accent.deep`)
- size `content`, used by the `Container` recipe override
- spacing `pageTop`
- z-index tokens `header`, `mobileNav`, `menuToggle`, `backToTop`
- Text style `pageTitle`.
- Global `:focus-visible` ring (BR-THEME-02), with `[tabindex="-1"]:focus` showing no ring (BR-A11Y-06).
- [x] **Step 10: Recipes**
- `link` variant `subtle` (BR-FOOT-04)
- `skipNavLink` override (FR-07)
- new `recipes/iconControl.ts` (AD D9, BR-THEME-02 ring colour on photos)
- register them in `theme.ts`
- run `pnpm typegen`
### Part C — Content, configuration and pure logic (with unit + property tests)
- [x] **Step 11: Content module** (`src/content/`) (AD D2, domain-entities)
- `types.ts`: `SiteContent`, `SocialLink`, `EmailAddress`, the Hero types
- `siteContent.ts`: new `footerIntro` text, socials, `email: { user, domain }`
- move `heroContent.ts` and `socialPlatforms.ts` here; remove `socials` from `HeroContent`
- delete the old files in `components/Hero/`
- [x] **Step 12: Navigation** — `src/navigation.ts` with `mainNav` and `footerNav` (FR-02, FR-05, BR-NAV-*). Delete `NavigationBar/navItems.ts`.
- [x] **Step 13: Pure helpers** (`src/lib/`)
- `backToTopThreshold.ts` (BR-TOP-01)
- `visibleSocials.ts` (BR-SOC-01/02)
- `emailAddress.ts` (BR-EMAIL-01/02)
- `copyrightLine.ts` (BR-FOOT-02)
- [x] **Step 14: SEO module**
- `src/seo.ts` gets:
- `siteUrl`, `siteName`, `defaultOgImage`
- `canonicalUrl` (BR-SEO-02)
- `pageHead(path)` (BR-SEO-01…04)
- `siteHead`
- `jsonLdScript` (BR-SEO-05)
- `professionalService(content)`
- `src/sitePages.ts`: the registry (domain-entities)
- `src/sitemap.ts`: `sitemapXml` (BR-SEO-06)
- [x] **Step 15: Tests for Part C** (PBT-02…08, NFR-M-01/02)
- Property tests (fast-check) for every row in "Testable Properties": threshold, socials, e-mail, copyright, canonicalUrl, sitemapXml, jsonLdScript.
- Example tests for edge cases and the menu invariants (BR-NAV-01/02).
- `securityHeaders` test: the production CSP has no `unsafe-eval`, no `'unsafe-inline'` in `script-src` and no `ws:`.
- Domain generators are shared in `src/test/arbitraries.ts`.
### Part D — Shared primitives and hooks
- [x] **Step 16: RouterLink** — create `components/RouterLink.tsx` (AD D8). Refactor `LinkButton`, `NavLink` and `MobileNav` onto it.
- [x] **Step 17: useRouteFocus** — create `hooks/useRouteFocus.ts` (BR-A11Y-01), plus a test (focus moves on a pathname change, not on first load).
### Part E — Components (with component tests incl. axe)
- [x] **Step 18: PageIntro** — `components/PageIntro/PageIntro.tsx` + test (FR-01, BR-THEME-03/06)
- [x] **Step 19: StatusPage, NotFound, ErrorPage** in `components/StatusPage/` + tests (FR-09, FR-10, BR-404-*, BR-ERR-*). Tests cover:
- no error details are rendered
- `console.error` is called once
- retry calls `reset` and `invalidate`
- title and `noindex` are set
- [x] **Step 20: Footer + FooterColumn** — `components/Footer/` + tests (FR-05, BR-FOOT-*, BR-SOC-*, BR-EMAIL-03, BR-A11Y-03, BR-SEO-09). Delete the old `components/Footer.tsx`. Tests cover:
- columns are omitted when empty
- the mailto link
- the new-tab text
- `aria-current`
- the `h2` headings
- the year
- [x] **Step 21: BackToTop** — `components/BackToTop/BackToTop.tsx` + tests (FR-06, BR-TOP-*). Tests cover:
- hidden/visible around the threshold
- not focusable while hidden
- smooth vs instant scrolling under reduced motion
- focus moves to `main`
- [x] **Step 22: NavigationBar**
- Logo becomes a link home (FR-03).
- Menu from `mainNav`.
- `let` → `const`.
- z-index tokens (BR-THEME-05) + test (menu order, logo link name).
- [x] **Step 23: Hero**
- Separate `socials` prop.
- `HeroSocials` uses `visibleSocials`, the `iconControl` recipe and the new-tab `aria-label`.
- `HeroArrows` uses `iconControl`.
- Type rename `HeroSocial` → `SocialLink` + test.
- [x] **Step 24: AppShell**
- `SkipNavLink` + `SkipNavContent as="main" id="main"`
- `Footer content={siteContent}`
- `BackToTop`
- `useRouteFocus`
- Test (landmarks, skip link target).
### Part F — Routes, app entry and static files
- [x] **Step 25: Root route** — `routes/__root.tsx`:
- head = `siteHead` + JSON-LD
- `notFoundComponent: NotFound` and `errorComponent: ErrorPage`
- devtools lazy and only in DEV (NFR-P-04)
- [x] **Step 26: Page routes**
- `index.tsx`: `pageHead('/')`, Hero with `socials`.
- `over-mij.tsx`: rewritten as a `PageIntro` placeholder in the Prettier style.
- New: `portfolio.tsx`, `soorten-fotoshoots.tsx`, `contact.tsx`, `privacyverklaring.tsx` with the copy from frontend-components.md (FR-01, Q8).
- Regenerate `routeTree.gen.ts` via the router plugin.
- [x] **Step 27: App entry** — `main.tsx`:
- remove `ThemeProvider`
- `createRouter({ routeTree, scrollRestoration: true, defaultErrorComponent: ErrorPage })` (FR-08, FR-10)
- [x] **Step 28: Static files**
- `public/robots.txt` (BR-SEO-08).
- `public/og-image.jpg`: a 1200×630 crop of a hero photo (BR-SEO-04). If no image tool is available locally, I'll ask you to supply the crop.
- `public/logo.png` for JSON-LD.
- `index.html` fallback gets `og:image`, canonical and `twitter:card`.
- Delete `assets/hero.png`, `assets/typescript.svg`, `assets/vite.svg` after checking they are unreferenced (FR-11).
- [x] **Step 29: Integration tests** (`src/app.test.tsx`), with the real route tree in a memory router:
- an unknown URL shows the 404 inside the shell
- a throwing route shows the error page inside the shell (NFR-R-01)
- the `sitePages` registry equals the route tree (BR-SEO-07)
- axe on every page
### Part G — Documentation and verification
- [x] **Step 30: Code summary** — `aidlc-docs/features/frontend-shell/construction/frontend-shell/code/code-summary.md`. It covers:
- files created, modified and deleted
- mapping to FR/BR IDs
- how to run the scripts
- Check LAYOUT.md. No change is expected: the shell blocks (Header / Content / Footer) stay the same.
- [x] **Step 31: Unit verification** (Step 13.5): run `pnpm lint`, `pnpm format:check`, `pnpm test` and `pnpm build`, fixing failures until green. Then:
- check that `dist/sitemap.xml` exists
- check that the bundle does not contain the joined e-mail address (NFR-SEC-07)
- run `pnpm audit:deps`
- try `pnpm lighthouse`. If Chrome is missing, report that and leave it for Build and Test.
## Scope Estimate
- **About 30 files**:
- roughly 18 new source/test files
- about 12 modified
- 7 deleted, of which 3 starter assets
- **New dev dependencies**: 15. **Removed**: 1.
@@ -0,0 +1,95 @@
# Functional Design Change Questions — SEO, schermlezers, responsive, hergebruik
Je vroeg om SEO, schermlezers, responsive design en hergebruik via Chakra/thema meteen mee te nemen. Het grootste deel kan ik op vaste uitgangspunten uitwerken (zie "Wordt uitgewerkt zonder vraag"). Hieronder staan alleen de punten waar een echte keuze in zit. Vul per vraag de letter in na `[Answer]:`. Waar ik een voorkeur heb staat **(aanbevolen)**.
## Wordt uitgewerkt zonder vraag
**SEO**
- Per pagina een unieke titel en beschrijving (bestaat al via `pageHead`). Placeholderpagina's en 404/fout krijgen `noindex`, zodat een lege "in de maak"-pagina niet in Google komt. Zodra de echte inhoud er staat, gaat `noindex` eraf.
- Eén `h1` per pagina, koppen in logische volgorde (geen niveaus overslaan). Footerkoppen zijn `h2`, opgemaakt als eyebrow: het zijn hoofdsecties van de pagina (gecorrigeerd bij het uitwerken, zie BR-SEO-09).
- Interne links zijn echte `<a href>`-links (geen klik-handlers op `div`s), zodat zoekmachines ze kunnen volgen.
- Alle afbeeldingen hebben een betekenisvolle `alt`, decoratieve krijgen `alt=""`.
**Schermlezers**
- `lang="nl"` (staat al), landmarks `header`/`nav`/`main`/`footer` met Nederlandse labels.
- Skip link, zichtbare focusstijl op alles wat focus kan krijgen, en die focusstijl komt **op één plek uit het thema** in plaats van per component.
- Iconen zijn `aria-hidden`; knoppen met alleen een icoon hebben een `aria-label`.
- Externe links die in een nieuw tabblad openen, melden dat aan schermlezers ("opent in nieuw tabblad", visueel verborgen).
- Respecteren van `prefers-reduced-motion`.
**Responsive**
- Mobile-first, met de standaard Chakra-breakpoints (`sm` 480, `md` 768, `lg` 1024, `xl` 1280, `2xl` 1536). Per component een tabel met wat er per breakpoint verandert.
- Werkt van 320px breed tot 32:9 zonder horizontaal scrollen; tekst kan 200% vergroot worden zonder dat er iets wegvalt.
- Klikdoelen minimaal 44×44px op touch (menu, footerlinks, to-top).
**Hergebruik via Chakra en het thema**
- Een overzicht per component van welke tokens, text styles en recipes het gebruikt, en welke nieuwe gedeelde stukken erbij komen (bv. één `pageTitle`-text style voor de `h1` van PageIntro en StatusPage, één `focusRing` voor de hele site, z-index-tokens voor header/menu/to-top in plaats van losse getallen).
- Geen waarden die al als token bestaan, opnieuw hard in een component.
---
## Questions
### Vraag 1: Link-previews en crawlers die geen JavaScript uitvoeren
De site wordt in de browser opgebouwd. Google voert JavaScript uit en ziet dus de juiste titel per pagina. **WhatsApp, Facebook en LinkedIn doen dat niet**: die zien bij elke pagina alleen de vaste fallback uit `index.html` (de homepage-titel). Dat los je alleen op door de pagina's bij het bouwen al als HTML te genereren ("prerendering").
A) Nu nog niet prerenderen, maar alles zo bouwen dat het later zonder ombouw kan: alle head-data via de route-`head`, geen `window`/`document` tijdens het renderen, content via props. Prerendering wordt een vervolgpunt bij hosting/Operations. **(aanbevolen)** Prerendering is pas zinvol als er echte pagina-inhoud is; nu zijn het placeholders.
B) Nu al prerendering toevoegen in deze feature (een build-stap die per route statische HTML maakt). Grotere scope en een extra afhankelijkheid.
X) Anders (beschrijf hieronder na de [Answer]:-tag)
[Answer]: A
### Vraag 2: Domein voor canonical-URL's en `og:url`
Voor canonical-URL's (voorkomt dubbele pagina's in Google) en voor link-previews is het definitieve adres nodig.
A) `https://andreaslop.nl` (zonder www) **(aanbevolen)** Komt overeen met het e-maildomein; `www` stuurt de host dan door.
B) `https://www.andreaslop.nl`
X) Anders (beschrijf hieronder na de [Answer]:-tag)
[Answer]: A
### Vraag 3: Afbeelding voor link-previews (`og:image`)
Zonder `og:image` tonen WhatsApp en Facebook een preview zonder plaatje.
A) Eén vaste site-brede afbeelding (een uitsnede van een hero-foto, 1200×630), die een pagina later kan overschrijven met een eigen beeld **(aanbevolen)**
B) Het logo als preview-afbeelding
C) Nog geen `og:image`
X) Anders (beschrijf hieronder na de [Answer]:-tag)
[Answer]: A
### Vraag 4: Gestructureerde data voor Google (JSON-LD)
Met gestructureerde data begrijpt Google dat dit een lokale fotograaf is (naam, plaats, socials). Dat helpt bij lokaal zoeken ("fotograaf Huizen").
A) Ja, site-breed één `ProfessionalService`-blok met naam, website, regio Huizen, logo en de social-links. **Zonder e-mailadres**, anders staat het adres alsnog leesbaar in de pagina. **(aanbevolen)**
B) Nog niet, later met de echte pagina's
X) Anders (beschrijf hieronder na de [Answer]:-tag)
[Answer]: A
### Vraag 5: `robots.txt` en `sitemap.xml`
A) Beide als statisch bestand in `public/`. De sitemap bevat alleen de geïndexeerde pagina's (nu: home) en wordt bijgewerkt zodra er een pagina live gaat. Een test controleert dat de sitemap en de routes niet uit elkaar lopen. **(aanbevolen)**
B) De sitemap wordt bij elke build automatisch gemaakt uit de routes. Meer werk nu, maar niets handmatig bij te houden.
C) Later, bij hosting/Operations
X) Anders (beschrijf hieronder na de [Answer]:-tag)
[Answer]: B is het makkelijkste. Hoeveel meerwerk is het en hoe wordt het automatisch opgebouwd? Hoe betrouwbaar is het? Bij teveel gedoe of onzekerheden is A het beste. Anders B, met eventueel de test uit optie A
### Vraag 6: Paginawissel aankondigen aan schermlezers
Bij een gewone website leest een schermlezer na een klik de nieuwe pagina voor. In een app als deze gebeurt dat niet vanzelf: de inhoud wisselt, maar de schermlezer merkt het niet.
A) Na elke paginawissel (niet bij de eerste keer laden) gaat de focus naar `main#main`, net als bij de skip link en de to-top-knop. De schermlezer leest dan de nieuwe inhoud vanaf het begin. **(aanbevolen)** Eén consistent gedrag.
B) De focus blijft staan en een onzichtbaar meldingsgebied leest de nieuwe paginatitel voor ("Portfolio, pagina geladen")
X) Anders (beschrijf hieronder na de [Answer]:-tag)
[Answer]: A
@@ -0,0 +1,70 @@
# Functional Design Clarification Questions — frontend-shell
Je antwoorden op vraag 4, 6 en 12 bevatten aanvullende wensen. Die werk ik hieronder uit met aanbevelingen. Vul per vraag de letter in na `[Answer]:`.
---
## Ambiguity 1: Zichtbaarheid en positie van de to-top-knop (vraag 4)
Je koos `accent.deep` als hoverkleur, maar vindt de knop in het design niet duidelijk genoeg en hij staat op een 32:9-scherm ver van de content af.
Wat het design nu doet: lichte achtergrond (`paper`), dunne lijn (`line`) als rand en een donkere pijl. Over een lichte pagina valt die knop bijna weg. De rand zelf haalt geen 3:1 contrast, dus alleen de pijl is echt zichtbaar.
### Clarification Question 1: Uiterlijk van de knop
A) Omgekeerd: donkere achtergrond (`ink`) met witte pijl, zonder rand. Hover: achtergrond `accent.deep`. Valt goed op op lichte en op donkere vlakken, en is dezelfde stijl als de skip link. **(aanbevolen)**
B) Licht zoals het design, maar met een duidelijke rand in `ink.soft` en een lichte schaduw. Hover: rand en pijl `accent.deep`. Dichter bij het design, minder opvallend.
C) Precies zoals het design, alleen de hoverkleur `accent.deep`
X) Anders (beschrijf hieronder na de [Answer]:-tag)
[Answer]: A
### Clarification Question 2: Positie op hele brede schermen
A) De knop lijnt uit met de rechterkant van de content (de maximale breedte van `Container`). Op normale schermen verandert er niets, want daar is de content even breed als het scherm. Op een ultrawide staat hij naast de content in plaats van in de hoek van het scherm. **(aanbevolen)**
B) Altijd rechtsonder in de hoek van het scherm, zoals het design
X) Anders (beschrijf hieronder na de [Answer]:-tag)
[Answer]: A
---
## Ambiguity 2: E-mailadres beschermen tegen spam (vraag 6 en 12)
Eerst de eerlijke basis: **een adres dat een bezoeker kan lezen, kan een bot uiteindelijk ook lezen.** Je kunt het oogsten alleen duur en lastig maken. De meeste spambots zijn eenvoudig: ze lezen de HTML en zoeken naar `iets@iets.nl` of `mailto:`. Daar valt het meeste te winnen.
Hoe het nu zit:
- **De huidige statische site**: het adres staat drie keer letterlijk in de HTML. Dat is precies wat bots oogsten, en verklaart waarschijnlijk de spam die je nu krijgt.
- **De nieuwe React-site**: de pagina wordt in de browser opgebouwd, dus in de HTML staat het adres al niet meer. Wel staat `info@andreaslop.nl` letterlijk in het JavaScript-bestand. Sommige bots doorzoeken dat ook.
De gangbare technieken op een rij:
| Techniek | Bescherming | Nadeel |
| ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- |
| 1. Adres in delen opslaan (`info` + `andreaslop.nl`), pas in de browser samenvoegen | Goed tegen bots die HTML of JS-bestanden doorzoeken | Bots die de pagina echt uitvoeren (headless browser) zien het nog wel; dat zijn er weinig |
| 2. Pas tonen na een klik ("Toon e-mailadres") | Nog beter: zelfs een uitgevoerde pagina bevat het adres pas na een klik | Eén extra klik voor de bezoeker |
| 3. Contactformulier in plaats van een adres | Het sterkst: het adres staat nergens op de site | Heeft een backend nodig (de .NET API, later); hoort bij de Contact-pagina, buiten deze feature |
| 4. Apart adres voor de site (bv. `contact@`) met een goed spamfilter | Beperkt de schade als het toch uitlekt | Is een mailbox-instelling, geen code |
| Afgeraden: adres als afbeelding, of met CSS-trucs achterstevoren | Werkt | Onbruikbaar voor schermlezers, niet te kopiëren of aan te klikken; botst met NFR-01 |
Mijn aanbeveling: **1 nu in de shell**, en 3 en 4 voor later. Optie 2 is de moeite waard als je meer zekerheid wilt en de extra klik acceptabel vindt.
### Clarification Question 3: Hoe toont de footer het e-mailadres?
A) Techniek 1: het adres wordt in delen opgeslagen (ook straks in de CMS-data) en pas in de browser samengevoegd. Daarna staat het als gewone, aanklikbare `mailto:`-link met het adres als tekst, zoals in het design. Toegankelijk en zonder extra klik. **(aanbevolen)**
B) Techniek 1 + 2: de footer toont eerst een knop "Toon e-mailadres". Pas na de klik wordt het adres samengevoegd en verschijnt de `mailto:`-link.
C) Geen e-mailadres in de footer, alleen een link "Neem contact op" naar de Contact-pagina. Daar komt later het contactformulier (techniek 3).
X) Anders (beschrijf hieronder na de [Answer]:-tag)
[Answer]: A, verder ter info: techniek 4 is al toegepast met dit specifieke e-mailadres.
### Clarification Question 4: Vastleggen van de vervolgstappen buiten deze feature
Techniek 3 (contactformulier) en 4 (apart adres + spamfilter) vallen buiten de shell.
A) Opnemen als aanbeveling in de functional design, zodat ze bij de Contact-pagina en de .NET API weer opduiken **(aanbevolen)**
B) Niet vastleggen
X) Anders (beschrijf hieronder na de [Answer]:-tag)
[Answer]: A, maar techniek 4 is al (deels) toegepast. info@andreaslop.nl is al een mailadres specifiek voor de website.
@@ -0,0 +1,127 @@
# Functional Design Questions — frontend-shell
Vul per vraag de letter in na `[Answer]:`. Past geen enkele optie, kies dan de laatste (Anders) en licht toe. Waar ik een voorkeur heb staat **(aanbevolen)**.
## Already decided (no question needed)
- **Drempel to-top**: zichtbaar zodra `scrollY > 0,6 × viewporthoogte` (strikt groter dan, zoals `useScrolledPast` nu werkt voor de header).
- **Jaartal**: `new Date().getFullYear()` op het moment van renderen.
- **Externe links**: altijd `target="_blank"` + `rel="noopener noreferrer"` (NFR-04).
- **Volgorde menu's**: exact zoals FR-02 en FR-05; geen dubbele routes binnen één menu.
---
## Questions
### Vraag 1: Hoe krijgt de 404-pagina haar titel en `noindex`?
Een onbekende URL heeft geen eigen route, dus ook geen eigen `head`. Ik heb React 19 en TanStack Router naast elkaar bekeken.
A) `NotFound` rendert zelf `<title>` en `<meta name="robots" content="noindex">`. React 19 zet die automatisch in `<head>` en haalt ze weg zodra je de pagina verlaat. Bij een not-found matcht alleen de root-route, en die zet geen titel, dus er komt geen dubbele `<title>`. **(aanbevolen)** Simpel en lokaal bij de pagina.
B) De root-route `head` kijkt of de huidige match "not found" is en zet dan titel + `noindex`. Alles loopt via `HeadContent`, maar de root krijgt kennis van de 404-pagina.
X) Anders (beschrijf hieronder na de [Answer]:-tag)
[Answer]: A
### Vraag 2: Waar gaat de toetsenbordfocus heen na een klik op "Terug naar boven"?
Bovenaan verdwijnt de knop, dus als de focus erop blijft, staat hij op een onzichtbaar element.
A) Naar `main#main` (hetzelfde doel als de skip link). Een toetsenbordgebruiker kan daarna direct verder vanaf de inhoud. **(aanbevolen)**
B) Naar het begin van de pagina (`body`), zodat de volgende Tab weer bij de skip link begint
C) Focus niet verplaatsen
X) Anders (beschrijf hieronder na de [Answer]:-tag)
[Answer]: A
### Vraag 3: Animatie van de to-top-knop bij verschijnen en verdwijnen
A) Zoals het design: infaden en 8px omhoog schuiven, met de bestaande tokens voor duur en easing. Bij `prefers-reduced-motion` alleen direct tonen/verbergen, zonder beweging. **(aanbevolen)**
B) Alleen infaden, geen beweging
C) Geen animatie
X) Anders (beschrijf hieronder na de [Answer]:-tag)
[Answer]: A
### Vraag 4: Hoverkleur van de to-top-knop
Het design kleurt rand en pijl bij hover naar `accent` (#7f8b76). Dat haalt op de lichte achtergrond net 3:1, de grens voor iconen. Voor tekstlinks gebruiken we al `accent.deep` (NFR-01).
A) `accent.deep`, gelijk aan de linkhover in de footer. Ruim voldoende contrast en één consistente hoverkleur. **(aanbevolen)**
B) `accent`, precies zoals het design
X) Anders (beschrijf hieronder na de [Answer]:-tag)
[Answer]: A, al vind ik de knop en z'n kleuren nu sowieso niet heel erg duidelijk en vraga me af of die niet wegvalt. Daarbij komt dat op een 32:9 scherm de knop nog steeds helemaal rechtsonderin getoond wordt terwijl de content een max width heeft.
### Vraag 5: Welke social-links worden getoond?
Nu filtert `HeroSocials` alleen lege `href`s weg. Straks komen de links uit het CMS, dus ze zijn invoer van buiten de code.
A) Alleen links met een geldige `https://`-URL tonen. Leeg, `http://`, `javascript:` of iets anders onleesbaars wordt overgeslagen. **(aanbevolen)** Dit voorkomt dat een fout in het CMS een onveilige link oplevert.
B) Alleen lege links overslaan, zoals nu
X) Anders (beschrijf hieronder na de [Answer]:-tag)
[Answer]: A
### Vraag 6: Wat als een footerkolom niets te tonen heeft?
Bijvoorbeeld geen enkele geldige social-link, of een leeg e-mailadres.
A) De kolom (kop + inhoud) helemaal weglaten. Het grid schuift gewoon door. **(aanbevolen)**
B) De kop wel tonen met een lege kolom, zodat de layout altijd drie kolommen heeft
X) Anders (beschrijf hieronder na de [Answer]:-tag)
[Answer]: A, verder wil ik kijken hoe we het e-mailadres zo veilig mogelijk kunnen plaatsen om te beschermen tegen spam. Dat is nu namelijk ook al een probleem.
### Vraag 7: Actieve pagina in het footermenu
In het hoofdmenu krijgt de actieve pagina een streep (`aria-current="page"`).
A) Ook in de footer `aria-current="page"` zetten (gratis via de router) en de actieve link in `accent.deep` tonen
B) Wel `aria-current="page"` voor schermlezers, maar geen visueel verschil **(aanbevolen)** Het design toont geen actieve status in de footer.
C) Geen actieve status in de footer
X) Anders (beschrijf hieronder na de [Answer]:-tag)
[Answer]: B
### Vraag 8: Tekst op de placeholderpagina's (Portfolio, Soorten fotoshoots, Contact, Privacyverklaring, Over mij)
A) Eyebrow en `h1` uit de `page-head` van het design (Portfolio: "Werk" / "Portfolio", Soorten fotoshoots: "Mogelijkheden" / "Soorten fotoshoots", Contact: "Neem contact op" / "Contact", Over mij: "Andrea Slop Fotografie" / "Over mij"; Privacyverklaring heeft geen design en wordt "Privacy" / "Privacyverklaring"), plus de regel "Deze pagina is nog in de maak. Kom snel terug!" **(aanbevolen)**
B) Alleen de paginanaam als `h1`, zonder eyebrow, met de regel "Deze pagina is nog in de maak."
X) Anders (beschrijf hieronder na de [Answer]:-tag)
[Answer]: A
### Vraag 9: Tekst op de 404-pagina
A) Kop "Pagina niet gevonden", tekst "Deze pagina bestaat niet (meer). Misschien is de link verouderd of zit er een typfout in het adres.", knop "Terug naar home". **(aanbevolen)**
B) Kop "Oeps, hier is niets te zien", tekst "Deze pagina kon ik niet vinden.", knop "Terug naar home"
X) Anders (beschrijf hieronder na de [Answer]:-tag)
[Answer]: A
### Vraag 10: Welke acties biedt de foutpagina?
A) Alleen "Terug naar home"
B) "Opnieuw proberen" (laadt de pagina opnieuw via de router) én "Terug naar home" **(aanbevolen)** Een tijdelijke fout is dan met één klik op te lossen.
X) Anders (beschrijf hieronder na de [Answer]:-tag)
[Answer]: B
### Vraag 11: Loggen van fouten in de browserconsole
Er is (nog) geen centrale logging. Bezoekers zien nooit details, maar de console is voor iedereen te openen.
A) Altijd `console.error(error)`, ook in productie. Handig bij het debuggen van meldingen, en een frontend-fout bevat geen geheimen. **(aanbevolen)**
B) Alleen in development (`import.meta.env.DEV`)
X) Anders (beschrijf hieronder na de [Answer]:-tag)
[Answer]: A
### Vraag 12: Hoe staat het e-mailadres in de Contact-kolom?
A) Het adres zelf als linktekst (`info@…` → `mailto:`), zoals het design **(aanbevolen)**
B) Een vaste tekst, bv. "Stuur me een mail", met het adres alleen in de link
X) Anders (beschrijf hieronder na de [Answer]:-tag)
[Answer]: x, bij vraag 6 heb ik ook al een opmerking geplaatst. Wat is de veiligste manier om het e-mailadres te tonen? Geef mij aanbevelingen
@@ -0,0 +1,21 @@
# Functional Design Plan — frontend-shell
Unit: **frontend-shell** (single unit; Units Generation skipped). Builds on the approved Application Design in `inception/application-design/`.
Questions for this stage are in [frontend-shell-fd-questions.md](frontend-shell-fd-questions.md).
## Plan
- [x] 1. Answer the functional design questions
- [x] 2. Analyze answers for ambiguities (follow-up questions if needed)
- [x] 3. Generate `domain-entities.md` — content and navigation data model (`SiteContent`, `SocialLink`, `SocialPlatform`, `NavItem`, `HeroContent`) with relationships and field rules
- [x] 4. Generate `business-rules.md` — behaviour rules and decision logic:
- back-to-top visibility, scroll and focus rules
- social link filtering/validation and empty-content rules
- copyright line, nav invariants
- 404 head (title + `noindex`) mechanism
- error page behaviour and logging
- [x] 5. Generate `business-logic-model.md` — flows: page navigation and scroll restoration, not-found and error rendering inside/outside the shell, back-to-top interaction, content provisioning
- [x] 6. Generate `frontend-components.md` — component hierarchy, props/state per component, interaction flows, final Dutch copy for placeholders, 404 and error page
- [x] 7. Add the "Testable Properties" section (PBT-01) covering `backToTopThreshold`, `visibleSocials`, `copyrightLine`, `mainNav`/`footerNav`, and explicitly mark components without properties
- [x] 8. Validate against FR-01…FR-11, NFR-01…NFR-05, Security Baseline and PBT-01; validate Mermaid diagrams
@@ -0,0 +1,18 @@
# NFR Requirements Clarification Questions — frontend-shell
## Ambiguity 1: Wanneer draait Lighthouse CI? (vraag 3 = B)
Je koos voor automatisch meten met Lighthouse CI. Een run bouwt de site, start een browser (Chrome moet geïnstalleerd zijn) en meet elke pagina een paar keer. Dat kost al snel 30–60 seconden. "Bij elke build" kan twee dingen betekenen.
Twee dingen gelden ongeacht je keuze:
- Lighthouse meet de pagina's mobiel én desktop.
- De placeholderpagina's staan bewust op `noindex`, en Lighthouse rekent dat af in de SEO-score. Het doel "SEO 100" geldt daarom alleen voor geïndexeerde pagina's (nu: home). Voor de andere pagina's geldt alleen de controle dat `noindex` er bewust staat.
### Clarification Question 1
A) Een apart script `pnpm lighthouse`, en het draait mee in `pnpm check` (de controle vóór elke release, zie vraag 8). `pnpm build` blijft snel. Haalt een pagina de doelen niet, dan faalt `check`. **(aanbevolen)**
B) Echt bij elke `pnpm build`. Elke build duurt dan 30–60 seconden langer en faalt als een doel niet gehaald wordt.
X) Anders (beschrijf hieronder na de [Answer]:-tag)
[Answer]: A, er vanuitgaand dat ik lokaal de check kan draaien zodat ik tussendoor ook een check kan doen. Ik vraag me alleen wel af of een automatische check vlak voor release niet te laat is. Stel ik doe onderhoud en vergeet dat ik die check moet doen. Dan zie ik dat pas vlak voor release. Als het standaard in CI/CD workflow wordt meegenomen als bijvoorbeeld de laatste stap, dan hoeft het niks in de weg te zitten.
@@ -0,0 +1,99 @@
# NFR Requirements Plan — frontend-shell
Unit: **frontend-shell**. Builds on requirements NFR-01…NFR-06 and the approved functional design. NFR Design is skipped (execution plan); the patterns are small and go straight into this document and the code generation plan.
## Plan
- [x] 1. Answer the questions below
- [x] 2. Analyze answers for ambiguities (follow-up questions if needed)
- [x] 3. Generate `nfr-requirements.md` — measurable NFRs per category: performance, accessibility, SEO, security, reliability, maintainability/testing, browser support; scalability/availability marked N/A with rationale
- [x] 4. Generate `tech-stack-decisions.md` — test stack (PBT-09), linting, security headers/CSP, build plugins, dependency changes with rationale
- [x] 5. Validate against Security Baseline (SECURITY-04, -09, -10, -13, -15) and PBT-09
## Already decided (no question needed)
- **Scalability and availability**: N/A for the shell. It is a static site without a server; availability depends on the future host (Operations).
- **Test stack** (NFR-03, PBT-09): Vitest + React Testing Library + `@testing-library/user-event` + `jsdom` + fast-check. fast-check covers custom generators, shrinking and seed-based replay, and runs inside Vitest. The seed is printed on failure and can be passed back to replay a run.
- **Security headers** (NFR-04): `X-Content-Type-Options: nosniff`, `X-Frame-Options: DENY`, `Referrer-Policy: strict-origin-when-cross-origin` and HSTS `max-age=31536000; includeSubDomains`. Browsers ignore HSTS over plain `http://localhost`, so locally it has no effect; it matters on the production host.
- **CSP content for the production build**: `default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data:; font-src 'self'; connect-src 'self'; object-src 'none'; base-uri 'self'; form-action 'self'; frame-ancestors 'none'`.
- `style-src 'unsafe-inline'` is needed because Chakra/Emotion inject `<style>` tags at runtime (justified).
- The JSON-LD block is a data block (`application/ld+json`). It is not executed and needs no CSP exception.
- **Router devtools**: only loaded in development (`import.meta.env.DEV`), so they are not in the production bundle (SECURITY-09 hardening). `@tanstack/react-router-devtools` moves to `devDependencies`.
- **Sitemap plugin**: a local plugin in the Vite config; no extra dependency. `vite.config.js` becomes `vite.config.ts`, so it can import the typed `sitePages` registry and get type checking.
---
## Questions
Vul per vraag de letter in na `[Answer]:`. Past geen enkele optie, kies dan de laatste (Anders) en licht toe. Waar ik een voorkeur heb staat **(aanbevolen)**.
### Vraag 1: Content-Security-Policy tijdens het ontwikkelen
De strenge CSP hierboven werkt op de gebouwde site (`pnpm preview`). De dev-server (`pnpm dev`) heeft voor hot reload een inline script en een websocket nodig. Een strenge CSP breekt daar het herladen.
A) Strenge CSP op `preview` (en als voorschrift voor productie). In `dev` dezelfde CSP, maar met alleen de uitzonderingen die Vite nodig heeft (inline script voor React Refresh, websocket voor HMR). De overige headers zijn in beide gelijk. **(aanbevolen)** Je ziet CSP-problemen dan al tijdens het ontwikkelen, behalve die van Vite zelf.
B) Alleen op `preview` een CSP; `dev` zonder CSP
X) Anders (beschrijf hieronder na de [Answer]:-tag)
[Answer]: A
### Vraag 2: `next-themes` (wisselen tussen licht en donker)
De site staat vast op licht (`defaultTheme="light"`, `enableSystem={false}`). `next-themes` doet nu dus niets nuttigs. Wel zet het een inline script in de pagina, en dat botst met een strenge CSP (`script-src 'self'`).
A) `next-themes` verwijderen en de site vast op licht zetten. Het thema houdt zijn `_dark`-waarden, zodat een donkere modus later weer kan. **(aanbevolen)** Eén afhankelijkheid minder, en geen CSP-uitzondering nodig.
B) Houden voor een mogelijke donkere modus later, en het script via een hash in de CSP toestaan
X) Anders (beschrijf hieronder na de [Answer]:-tag)
[Answer]: A
### Vraag 3: Meetbare doelen voor kwaliteit
A) Lighthouse (mobiel) ≥ 90 voor Performance en 100 voor Accessibility, Best Practices en SEO, op de gebouwde site (`pnpm preview`). Handmatig gemeten bij Build and Test. **(aanbevolen)**
B) Hetzelfde, maar automatisch bij elke build (Lighthouse CI). Meer opzetwerk, en zonder CI-server draait het alleen lokaal.
C) Geen harde doelen, alleen de regels uit het functional design
X) Anders (beschrijf hieronder na de [Answer]:-tag)
[Answer]: B
### Vraag 4: Automatisch testen op toegankelijkheid
A) `axe-core` in de componenttests (via `vitest-axe`): elke shell-, placeholder-, 404- en foutpagina-test controleert ook op toegankelijkheidsfouten. Contrast controleert axe in `jsdom` niet; dat dekt Lighthouse (vraag 3) af. **(aanbevolen)**
B) Geen automatische controle, alleen handmatig met Lighthouse en een schermlezer
X) Anders (beschrijf hieronder na de [Answer]:-tag)
[Answer]: A
### Vraag 5: Linting
Er is nu alleen Prettier (opmaak), geen linter die fouten in code vindt.
A) ESLint toevoegen met de aanbevolen regels voor TypeScript, React Hooks en `jsx-a11y` (toegankelijkheid in JSX), plus een `lint`-script **(aanbevolen)** Vangt bv. vergeten `alt`-teksten en fouten met hooks al tijdens het schrijven.
B) Geen linter in deze feature
X) Anders (beschrijf hieronder na de [Answer]:-tag)
[Answer]: A
### Vraag 6: Welke browsers ondersteunen we?
A) De laatste 2 versies van Chrome, Edge, Firefox en Safari, plus Safari op iOS 16 en nieuwer. Dat dekt vrijwel alle bezoekers; oudere browsers krijgen de site zonder garantie. **(aanbevolen)**
B) Ruimer: ook oudere browsers (bv. iOS 14), met extra fallbacks voor nieuwere CSS
X) Anders (beschrijf hieronder na de [Answer]:-tag)
[Answer]: Begin met optie A. B zou later nog kunnen met name voor de mobiele versies.
### Vraag 7: Testdekking
A) Geen harde drempel voor de hele code, wel 100% dekking van de pure functies (`backToTopThreshold`, `visibleSocials`, `emailAddress`, `copyrightLine`, `canonicalUrl`, `sitemapXml`, `jsonLdScript`). De dekking wordt gerapporteerd bij `pnpm test`. **(aanbevolen)**
B) Een drempel voor de hele code (bv. 80% van de regels), die de tests laat falen als hij niet gehaald wordt
X) Anders (beschrijf hieronder na de [Answer]:-tag)
[Answer]: A
### Vraag 8: Controle op kwetsbare afhankelijkheden
A) Een script `pnpm audit:deps` (`pnpm audit --audit-level high`) plus een `check`-script dat lint, tests, build en audit achter elkaar draait. Dit is de controle vóór elke release, en later de basis voor CI. **(aanbevolen)**
B) Alleen documenteren dat `pnpm audit` handmatig gedraaid moet worden
X) Anders (beschrijf hieronder na de [Answer]:-tag)
[Answer]: A
@@ -0,0 +1,78 @@
# Application Design — frontend-shell (consolidated)
Detail documents: [components.md](components.md) · [component-methods.md](component-methods.md) · [services.md](services.md) · [component-dependency.md](component-dependency.md)
## Overview
The shell stays the three-part frame from LAYOUT.md, now with full accessibility plumbing:
- **Header**: `NavigationBar`
- **Page content**: `main#main`
- **Footer**: `Footer`
Around these sit a Chakra skip link and a `BackToTop` button. Pages are routed through TanStack Router. Unknown URLs and page errors render inside the shell. Site-wide content comes from a new `content/` folder and is passed down as props from two provisioning points. Menus are typed route lists in `navigation.ts`. Styling reuses the existing theme and extends Chakra's own recipes where styles repeat.
```mermaid
graph TD
Skip["SkipNavLink"] --> Header["NavigationBar (logo link, mainNav)"]
Header --> Main["main#main: Outlet / NotFound / ErrorPage"]
Main --> Foot["Footer (SiteContent, footerNav)"]
Foot --> Top["BackToTop (fixed)"]
classDef chrome fill:#e76f51,stroke:#ad533d,stroke-width:1px,color:#000;
classDef content fill:#ffffff,stroke:#333333,stroke-width:1px,color:#000;
classDef footer fill:#f4a261,stroke:#b77a49,stroke-width:1px,color:#000;
class Skip,Header chrome;
class Main content;
class Foot,Top footer;
```
Text alternative: top-to-bottom order of the shell: skip link, header, main content (page, 404 or error page), footer, and the fixed back-to-top button.
## Design Decisions
| # | Decision | Source |
|---|---|---|
| D1 | One folder per component (`Footer/`, `BackToTop/`, `PageIntro/`, `StatusPage/`); `AppShell.tsx` stays | AD Q1 = A |
| D2 | New `content/` folder: `siteContent`, `heroContent`, content types, `socialPlatforms` | AD Q2 = A |
| D3 | Content enters via props from `AppShell` and the home route; components never import content | AD Q3 = A |
| D4 | Menus are code: `navigation.ts` with `mainNav` + `footerNav`, typed on routes; FR-04 revised | AD Q4 = A |
| D5 | `PageIntro` as reusable top block for content pages (placeholders now, real pages later) | AD Q5 = A |
| D6 | `StatusPage` shared by `NotFound` and `ErrorPage` | AD Q6 = A |
| D7 | Footer links via Chakra's built-in `Link` with a new `subtle` variant; router links via `asChild` | AD Q7 = A |
| D8 | One shared `RouterLink = chakra(Link)`; `NavLink`, `MobileNav`, `LinkButton` refactored onto it | AD Q8 = A |
| D9 | Hover-opacity pattern centralised as recipe `iconControl`; `HeroArrows` and `HeroSocials` use it | AD Q9 = A |
| D10 | Skip link + main via Chakra `SkipNavLink`/`SkipNavContent`, restyled through the theme | NFR-02 |
| D11 | `BackToTop` reuses `useScrolledPast`; pure helpers (`backToTopThreshold`, `visibleSocials`, `copyrightLine`) for PBT | NFR-02, NFR-03 |
| D12 | Router: `scrollRestoration`, root `notFoundComponent`, `defaultErrorComponent` + root `errorComponent` | FR-08…FR-10 |
## Requirements Traceability
| Requirement | Realised by |
|---|---|
| FR-01 Placeholder routes | `routes/{portfolio,soorten-fotoshoots,contact,privacyverklaring}.tsx` + `PageIntro` |
| FR-02 Navigation items | `navigation.ts` `mainNav` → `NavigationBar`, `MobileNav` |
| FR-03 Logo link | `NavigationBar` logo wrapped in `RouterLink to="/"` |
| FR-04 Site content | `content/siteContent.ts`, `content/types.ts`; menus in `navigation.ts` (D4) |
| FR-05 Footer | `Footer`, `FooterColumn`, `footerNav`, `link` `subtle` variant, `logo-dark.png` |
| FR-06 Back to top | `BackToTop`, `useScrolledPast`, `backToTopThreshold` |
| FR-07 Skip link + main | `SkipNavLink`/`SkipNavContent` in `AppShell`, `skipNavLink` recipe override |
| FR-08 Scroll restoration | `createRouter({ scrollRestoration: true })` |
| FR-09 404 | `NotFound` → `StatusPage`, root `notFoundComponent` |
| FR-10 Error page | `ErrorPage` → `StatusPage`, `defaultErrorComponent` + root `errorComponent` |
| FR-11 Tech debt | `theme.ts` (250vh), `over-mij.tsx`, `NavigationBar` (`const`), assets, `package.json` |
| NFR-01 Accessibility | Landmarks, skip link, `subtle` link contrast (`ink.soft`/`accent.deep`), hidden-state of BackToTop |
| NFR-02 Reuse/Chakra | D7–D11 |
| NFR-03 Testing | Pure helpers (D11) + component tests; toolchain in NFR Requirements |
| NFR-04 Security | `rel="noopener noreferrer"` on external links; generic `ErrorPage`; headers in NFR Requirements |
## Open Points for Functional Design
- **404 title and `noindex`**: a global not-found has no route `head` of its own. Choose between React 19 metadata hoisting (`<title>`/`<meta>` rendered inside `NotFound`) and a root `head` that reacts to the not-found state. Verify there is no duplicate `<title>` with `HeadContent`.
- **BackToTop focus**: after "scroll to top", decide whether focus moves to the skip target (`main`) or stays on the button. The button is hidden at the top, so a focus decision is needed.
- **Behaviour rules and testable properties** (PBT-01) for `backToTopThreshold`, `visibleSocials`, `copyrightLine` and the `mainNav`/`footerNav` invariants.
## Compliance Summary (Application Design)
**Security Baseline**
- SECURITY-09/15: compliant by design (generic `ErrorPage`; root error boundary as global handler).
- SECURITY-13: compliant (no external resources).
- SECURITY-04/10: addressed in NFR Requirements.
- Others: N/A (see requirements.md).
**Property-Based Testing**
- PBT-01: candidate pure functions identified (D11). Property identification is completed in Functional Design.
- Other PBT rules: N/A at this stage.
@@ -0,0 +1,89 @@
# Component Dependencies — frontend-shell
## Dependency Graph
```mermaid
graph TD
main_tsx["main.tsx"] --> router_cfg["createRouter (scrollRestoration, defaultErrorComponent)"]
router_cfg --> root_route["routes/__root.tsx"]
root_route --> AppShell["AppShell"]
root_route --> NotFound["NotFound"]
root_route --> ErrorPage["ErrorPage"]
AppShell --> SkipNav["Chakra SkipNavLink / SkipNavContent"]
AppShell --> NavigationBar["NavigationBar"]
AppShell --> Footer["Footer"]
AppShell --> BackToTop["BackToTop"]
AppShell --> siteContent["content/siteContent"]
NavigationBar --> navigation["navigation.ts"]
Footer --> navigation
NavigationBar --> RouterLink["RouterLink"]
Footer --> RouterLink
Footer --> socialPlatforms["content/socialPlatforms"]
NotFound --> StatusPage["StatusPage"]
ErrorPage --> StatusPage
StatusPage --> LinkButton["LinkButton"]
LinkButton --> RouterLink
BackToTop --> useScrolledPast["useScrolledPast"]
NavigationBar --> useScrolledPast
pages["routes: portfolio, soorten-fotoshoots, contact, privacyverklaring, over-mij"] --> PageIntro["PageIntro"]
index_route["routes/index.tsx"] --> Hero["Hero"]
index_route --> heroContent["content/heroContent"]
index_route --> siteContent
Hero --> socialPlatforms
Hero --> iconControl["recipe iconControl"]
classDef entry fill:#f6e05e,stroke:#c05621,stroke-width:1px,color:#000;
classDef comp fill:#63b3ed,stroke:#2b6cb0,stroke-width:1px,color:#000;
classDef data fill:#9ae6b4,stroke:#2f855a,stroke-width:1px,color:#000;
classDef shared fill:#e2e8f0,stroke:#4a5568,stroke-width:1px,color:#000;
class main_tsx,router_cfg,root_route,index_route,pages entry;
class AppShell,NotFound,ErrorPage,NavigationBar,Footer,BackToTop,StatusPage,PageIntro,Hero comp;
class siteContent,heroContent,navigation,socialPlatforms data;
class SkipNav,RouterLink,LinkButton,useScrolledPast,iconControl shared;
```
Text alternative: main.tsx configures the router, which renders the root route (AppShell, NotFound, ErrorPage). AppShell composes the Chakra skip link, NavigationBar, Footer and BackToTop and feeds siteContent to the Footer. Navigation menus come from navigation.ts, links go through RouterLink, the status pages share StatusPage, and content pages share PageIntro. Colours: yellow = entry/routes, blue = components, green = data modules, grey = shared primitives.
## Dependency Matrix
| Component | Depends on |
|---|---|
| AppShell | NavigationBar, Footer, BackToTop, Chakra SkipNav*, siteContent |
| NavigationBar | navigation (mainNav), RouterLink, NavLink, MobileNav, useScrolledPast, logo assets |
| Footer | SiteContent type, navigation (footerNav), RouterLink, Chakra Link (`subtle`), socialPlatforms, visibleSocials, copyrightLine, logo-dark.png |
| BackToTop | useScrolledPast, backToTopThreshold, Iconify `up-outlined` |
| StatusPage | LinkButton, Container/Heading/Text |
| NotFound / ErrorPage | StatusPage |
| PageIntro | Container, Heading, `header` spacing token |
| Hero | HeroContent, SocialLink, HeroArrows, HeroSocials, LinkButton, useHeroSlider |
| HeroArrows / HeroSocials | `iconControl` recipe; HeroSocials also socialPlatforms, visibleSocials |
| LinkButton / NavLink / MobileNav | RouterLink |
No circular dependencies. Content modules depend only on types and assets; components never import content (except the two provisioning points: `AppShell` and `routes/index.tsx`).
## Data Flow
```mermaid
sequenceDiagram
box rgba(246,224,94,0.4) Data
participant C as content modules
end
box rgba(99,179,237,0.4) Shell
participant S as AppShell
participant F as Footer
end
box rgba(154,230,180,0.4) Page
participant R as Home route
participant H as Hero
end
S->>C: import siteContent
S->>F: props content
R->>C: import heroContent and siteContent
R->>H: props content and socials
```
Text alternative: AppShell reads siteContent and passes it to Footer as props; the home route reads heroContent and siteContent and passes them to Hero as props.
## Communication Patterns
- **Props down only**: no context or global state is added.
- **Routing state**: via TanStack Router hooks (`useRouterState`) inside `NavigationBar` only (existing).
- **Scroll state**: a local hook per consumer (`useScrolledPast`), no shared store.
@@ -0,0 +1,79 @@
# Component Methods and Interfaces — frontend-shell
Signatures are TypeScript sketches; exact typing is settled in Code Generation. Behaviour rules (thresholds, copy, edge cases) are detailed in Functional Design.
## Content types — `content/types.ts`
```ts
import type { SocialPlatform } from './socialPlatforms';
export interface SocialLink {
platform: SocialPlatform;
href: string; // leeg = niet tonen
}
export interface SiteContent {
footerIntro: string;
socials: SocialLink[];
email: string;
}
export interface HeroSlide { id: string; src: string; alt: string }
export interface HeroCta { label: string; to: string }
export interface HeroContent {
title: string;
tagline: string;
cta: HeroCta;
slides: HeroSlide[];
// socials verhuist naar SiteContent
}
```
## Navigation — `navigation.ts`
```ts
// Typed on registered routes, so a typo in `to` is a type error
type NavItem = { to: '/' | '/over-mij' | ...; label: string };
export const mainNav: readonly NavItem[];
export const footerNav: readonly NavItem[];
```
## Components
| Component | Props | Notes |
|---|---|---|
| `AppShell` | none | Composes SkipNavLink, NavigationBar, main, Footer, BackToTop |
| `NavigationBar` | none | Reads `mainNav`; logo `RouterLink to="/"` |
| `NavLink` | `ComponentProps<typeof RouterLink>` | Unchanged API |
| `MobileNav` | `{ id: string; open: boolean; onClose: () => void }` | Unchanged API |
| `Footer` | `{ content: SiteContent }` | |
| `FooterColumn` (local) | `{ title: string; children: ReactNode }` | Eyebrow heading + vertical list |
| `BackToTop` | none | |
| `PageIntro` | `{ title: string; eyebrow?: string; children?: ReactNode }` | Exactly one `h1` |
| `StatusPage` | `{ title: string; children: ReactNode; action?: { label: string; to: string } }` | Default action: "Terug naar home" → `/` |
| `NotFound` | `NotFoundRouteProps` (ignored) | Router `notFoundComponent` |
| `ErrorPage` | `ErrorComponentProps` (`error`, `reset`) | Never renders `error`; logs it |
| `Hero` | `{ content: HeroContent; socials: SocialLink[] }` | `socials` split off |
| `HeroSocials` | `{ socials: SocialLink[] }` | Type renamed from `HeroSocial` |
| `HeroArrows` | `{ onPrev: () => void; onNext: () => void }` | Unchanged API |
| `LinkButton` | `ComponentProps<typeof RouterLink> & RecipeVariantProps<linkButton>` | Unchanged API |
| `RouterLink` | `ComponentProps<typeof chakra(Link)>` | `export const RouterLink = chakra(Link)` |
## Hooks and helpers
| Name | Signature | Purpose |
|---|---|---|
| `useScrolledPast` (existing) | `(getThreshold: () => number) => boolean` | Reused by BackToTop; threshold function defined at module level so it is referentially stable |
| `backToTopThreshold` (new, pure) | `(viewportHeight: number) => number` | 60% of viewport height; pure for property-based testing |
| `visibleSocials` (new, pure) | `(socials: SocialLink[]) => SocialLink[]` | Drops entries with empty `href`; shared by HeroSocials and Footer (today's filter in HeroSocials is lifted out) |
| `copyrightLine` (new, pure) | `(year: number) => string` | `"© {year} Andrea Slop Fotografie"` |
| `pageHead` (existing) | `({ title, description }) => HeadOption` | Used by the new routes |
## Theme additions
| Key | Kind | Definition (summary) |
|---|---|---|
| `link.variants.variant.subtle` | Recipe variant (extends Chakra built-in `link`) | `color: ink.soft`, `textDecoration: none`, `_hover/_focusVisible: { color: accent.deep }`, transition tokens |
| `skipNavLink` | Recipe override (Chakra built-in) | `bg: ink`, `color: white`, `rounded: none`, design padding, `textStyle: eyebrow` |
| `iconControl` | New recipe | `opacity: 0.6`, `_hover/_focusVisible: { opacity: 1 }`, `interaction`/`smooth` transitions |
@@ -0,0 +1,127 @@
# Components — frontend-shell
Paths are relative to `web/src/`. Status: **new**, **changed**, **moved**, **unchanged**.
## Shell
### AppShell — `components/AppShell.tsx` (changed)
- **Purpose**: The frame around every page (LAYOUT.md "Shell": Header / Page content / Footer)
- **Responsibilities**: Renders, in order:
1. `SkipNavLink` "Direct naar de inhoud"
2. `NavigationBar`
3. `SkipNavContent as="main" id="main"` wrapping `<Outlet />`
4. `Footer` (receives `siteContent`)
5. `BackToTop`
- It is the single place where site-wide content enters the component tree (application design Q3 = A); later this becomes a loader or API call.
- **Interface**: no props
### NavigationBar — `components/NavigationBar/` (changed)
- **Purpose**: Fixed header with logo, desktop menu, hamburger and mobile menu
- **Changes**:
- The logo becomes a link home (`RouterLink to="/"`, accessible name "Andrea Slop Fotografie, naar de homepage").
- The menu reads `mainNav` from `navigation.ts`; `navItems.ts` is removed.
- `let` → `const`.
- **Unchanged**: overlay/solid behaviour, shrink on scroll, `MobileNav` (Escape, scroll lock), `NavLink` underline animation
- `NavLink` and `MobileNav` switch from their own `chakra(Link)` to the shared `RouterLink`.
### Footer — `components/Footer/Footer.tsx` (new, replaces `components/Footer.tsx`)
- **Purpose**: Site footer per design (FR-05)
- **Responsibilities**:
- **Top section**, as a `SimpleGrid` (1, 2 or 3 columns) with three columns:
- brand: `Image` of `logo-dark.png` plus the intro text
- "Socials": text links, names from `socialPlatforms`
- "Contact": a `mailto:` link
- **Bottom bar**: © current year plus the `nav aria-label="Footermenu"` with `footerNav`
- **Links**:
- all links are Chakra `Link variant="subtle"`; internal ones use `asChild` around `RouterLink`
- column headings use `eyebrow`
- external links open in a new tab with `rel="noopener noreferrer"`
- **Interface**: `content: SiteContent`
- **Sub-component**: `FooterColumn` (heading + list), local to the Footer folder
### BackToTop — `components/BackToTop/BackToTop.tsx` (new)
- **Purpose**: Fixed button bottom-right to scroll back up (FR-06)
- **Responsibilities**:
- **Visibility**: shown when scrolled past 60% of the viewport height (reuses `useScrolledPast` with a module-level threshold function).
- **Scrolling**: smooth, or instant under reduced motion.
- **Icon**: Ant Design `up-outlined` (offline).
- **While hidden**: not focusable, not announced, not clickable.
- **Interface**: no props
### Skip link and main landmark — Chakra `SkipNavLink` / `SkipNavContent` (built-in, restyled)
- **Purpose**: FR-07
- **Responsibilities**: Chakra provides the behaviour. The theme overrides the `skipNavLink` recipe to the design (ink background, white text, square corners).
- No own component.
## Pages and page building blocks
### PageIntro — `components/PageIntro/PageIntro.tsx` (new)
- **Purpose**: The top "Intro" block of a content page; placeholders use it now, real pages later (application design Q5 = A)
- **Responsibilities**: Offset below the fixed header (`pt="header"` plus spacing), `Container`, optional eyebrow, one `h1` (`Heading`), optional children (intro text)
- **Interface**: `title`, `eyebrow?`, `children?`
### StatusPage — `components/StatusPage/StatusPage.tsx` (new)
- **Purpose**: Shared layout for 404 and error pages (application design Q6 = A)
- **Responsibilities**: Header offset, centred `Container`, `h1`, short text, `LinkButton` to home
- **Interface**: `title`, `children` (message), `action?` (defaults to home)
### NotFound — `components/StatusPage/NotFound.tsx` (new)
- **Purpose**: FR-09. A thin wrapper around `StatusPage` with the Dutch 404 copy.
- **Head handling**: sets its own title and `robots: noindex` (mechanism detailed in Functional Design).
- **Wiring**: registered as the root route's `notFoundComponent`.
### ErrorPage — `components/StatusPage/ErrorPage.tsx` (new)
- **Purpose**: FR-10. A thin wrapper around `StatusPage` with a generic Dutch message.
- **Behaviour**: never renders error details. Logs the error with `console.error`; there is no central logging (SECURITY-03 N/A).
- **Wiring**: registered as the router's `defaultErrorComponent` and the root route's `errorComponent`.
### Routes — `routes/` (new and changed)
- **New**: `portfolio.tsx`, `soorten-fotoshoots.tsx`, `contact.tsx`, `privacyverklaring.tsx`. Each has `head: pageHead(...)` and a `PageIntro` placeholder.
- **Changed**:
- `over-mij.tsx`: `PageIntro` placeholder, Prettier style.
- `index.tsx`: passes `heroContent` and `siteContent.socials` to `Hero`.
- `__root.tsx`: registers `notFoundComponent` and `errorComponent`.
## Shared building blocks
### RouterLink — `components/RouterLink.tsx` (new)
- **Purpose**: The single router-aware Chakra link primitive (application design Q8 = A): `chakra(Link)` from TanStack Router
- **Used by**: `NavLink`, `MobileNav`, `LinkButton`, `NavigationBar` (logo), `Footer` (via `Link asChild`)
### LinkButton — `components/LinkButton.tsx` (changed)
- Uses `RouterLink` instead of its own `chakra(Link)`. Otherwise unchanged.
### Hero — `components/Hero/` (changed)
- **Changes**:
- `Hero` gets a separate `socials` prop; `HeroContent` no longer contains socials.
- `HeroArrows` and `HeroSocials` use the new `iconControl` recipe instead of repeating the opacity/hover styles (application design Q9 = A).
- `heroContent.ts`, `types.ts` and `socialPlatforms.ts` move to `content/`.
## Content and configuration modules
### content/ — `content/` (new folder; application design Q2 = A)
- `types.ts`: `SiteContent`, `SocialLink`, `HeroContent`, `HeroSlide`, `HeroCta` (moved from `Hero/types.ts`, without `socials` in `HeroContent`)
- `siteContent.ts`: static `SiteContent` (footer intro, socials, e-mail). Replaced by API data later.
- `heroContent.ts`: moved from `Hero/`
- `socialPlatforms.ts`: moved from `Hero/`. The platform registry (name + icon) is shared by Hero (icons) and Footer (names).
### navigation.ts — `navigation.ts` (new; replaces `NavigationBar/navItems.ts`; application design Q4 = A)
- **Purpose**: Menu structures that point at routes. They are code, not content.
- **Exports**:
- `mainNav`: Home, Over mij, Portfolio, Soorten fotoshoots, Contact
- `footerNav`: Portfolio, Soorten fotoshoots, Contact, Privacyverklaring
### theme.ts and recipes/ (changed)
- **Remove**: `globalCss.body.height: '250vh'`
- **Recipe overrides**, extending Chakra built-ins:
- `link` gets a new variant `subtle`: `ink.soft`, hover `accent.deep`, no underline, focus ring.
- `skipNavLink` is restyled to the design.
- **New recipe** `recipes/iconControl.ts`: icon-only controls over photos. Opacity 0.6 → 1 on hover/focus-visible, with the `interaction`/`smooth` tokens.
### main.tsx (changed)
- `createRouter({ routeTree, scrollRestoration: true, defaultErrorComponent: ErrorPage })`
### Build and config (changed; detailed in NFR Requirements)
- `vite.config.js`: security headers for `server` and `preview`, plus the Vitest config
- `package.json`: `test` script, new dev dependencies; `@vitejs/plugin-react` moves to dev dependencies
- Assets: delete `hero.png`, `typescript.svg`, `vite.svg`
@@ -0,0 +1,34 @@
# Services — frontend-shell
There is no back-end or service layer in this SPA. The cross-cutting "services" the shell relies on are configuration-level and listed here with how they are orchestrated.
## Routing service (TanStack Router)
- **Configured in**: `main.tsx` (`createRouter`) and `routes/__root.tsx` (`createRootRoute`)
- **Responsibilities**:
- File-based route tree, including the four new placeholder routes.
- **Scroll restoration** (`scrollRestoration: true`): a new navigation starts at the top, and back/forward restores the previous position (FR-08).
- **Not found**: the root route's `notFoundComponent: NotFound`. For an unknown URL, the root component (`AppShell`) keeps rendering and `NotFound` appears in its `<Outlet>`, so the shell stays visible. Verified in `@tanstack/react-router` `Match.js`: a global not-found renders through the root match's `Outlet`.
- **Errors**: `defaultErrorComponent: ErrorPage` on the router, plus `errorComponent: ErrorPage` on the root.
- An error in a page route is caught at that page's match, inside the shell.
- An error in the shell itself falls back to the root's boundary and renders `ErrorPage` without the shell. This is a deliberate fail-safe (SECURITY-15).
## Head management service
- **Configured in**: `seo.ts` and each route's `head`; rendered by `HeadContent` in the root layout
- **Responsibilities**:
- Per-page title and description via `pageHead`; site-wide Open Graph tags via `siteHead`.
- The 404 page sets its own title plus `robots: noindex`. A global not-found has no route of its own whose `head` could do this, so the mechanism is settled in Functional Design.
## Content provisioning
- **Today**: static modules in `content/` (`siteContent`, `heroContent`)
- **Orchestration** (application design Q3 = A):
- `AppShell` imports `siteContent` and passes it to `Footer`.
- The home route passes `heroContent` and `siteContent.socials` to `Hero`.
- Components never import content themselves.
- **Later**: the import points (`AppShell`, the home route) are replaced by route loaders or API calls. The components and types stay the same.
## Scroll state
- `useScrolledPast` is the one scroll-listening primitive (passive listener). It is used by `NavigationBar` (150px threshold) and `BackToTop` (60% of the viewport).
## Theme service (Chakra system)
- `theme.ts` with `createSystem(defaultConfig, config)`
- New and overridden recipes are merged into Chakra's default config. Components consume them through `Link variant="subtle"`, `SkipNavLink`, `useRecipe({ key: 'iconControl' })` and `LinkButton`.
@@ -0,0 +1,110 @@
# Application Design Plan — frontend-shell
Depth: **minimal**. Single front-end package; the design pins down component boundaries, props, shared pieces and what moves into the theme (NFR-02 reuse principle). Detailed behaviour rules follow in Functional Design.
## Plan
- [x] 1. Answer the design questions below
- [x] 2. Analyze answers for ambiguities (follow-up questions if needed)
- [x] 3. Generate `components.md` — component definitions and responsibilities
- [x] 4. Generate `component-methods.md` — props/signatures of components, hooks and helpers
- [x] 5. Generate `services.md` — router configuration, head management, content provisioning
- [x] 6. Generate `component-dependency.md` — dependency matrix, data flow
- [x] 7. Generate `application-design.md` — consolidated design
- [x] 8. Validate completeness and consistency (requirements FR-01…FR-11, NFR-01…NFR-05, Security/PBT applicability)
## Already decided (no question needed)
These follow directly from the requirements and the reuse principle (NFR-02):
- **Skip link**: use Chakra's built-in `SkipNavLink` + `SkipNavContent` (`id="main"`, rendered `as="main"`). Restyle via the theme's `skipNavLink` recipe so it matches the design (ink background, white text).
- **Back-to-top visibility**: reuse the existing `useScrolledPast` hook, with a module-level threshold function (60% of the viewport height).
- **Icons**: `@iconify/react/offline` with the bundled `up-outlined` from `@iconify-icons/ant-design`.
- **404 / error buttons**: the existing `LinkButton` (`linkButton` recipe).
- **Footer column headings**: the existing `eyebrow` text style.
---
## Questions
Vul per vraag de letter in na `[Answer]:`. Past geen enkele optie, kies dan de laatste (Anders) en licht toe. Waar ik een voorkeur heb staat **(aanbevolen)**.
### Vraag 1: Mappenstructuur van de shell-componenten
Nu staat `AppShell.tsx` los in `components/`, met `NavigationBar/` en `Hero/` als eigen mappen.
A) Per component een eigen map, zoals nu: `components/Footer/`, `components/BackToTop/`, `components/StatusPage/`… `AppShell.tsx` blijft waar het is. **(aanbevolen)** Dit sluit aan bij het bestaande patroon.
B) Eén map `components/Shell/` met `AppShell`, `Footer/`, `BackToTop`, `NavigationBar/` erin (NavigationBar verhuist)
C) Een aparte map `layout/` naast `components/` voor alles wat shell is
X) Anders (beschrijf hieronder na de [Answer]:-tag)
[Answer]: A
### Vraag 2: Waar komt de content-module te staan, en verhuist `heroContent` mee?
A) Nieuwe map `src/content/` met `siteContent.ts` en de types. `heroContent.ts` en de types in `Hero/types.ts` verhuizen mee, zodat alle "straks-uit-de-API"-data op één plek staat. **(aanbevolen)**
B) Nieuwe map `src/content/` alleen voor `siteContent`. `heroContent` blijft bij de Hero.
C) `src/siteContent.ts` los naast `seo.ts`
X) Anders (beschrijf hieronder na de [Answer]:-tag)
[Answer]: A
### Vraag 3: Hoe krijgen Footer en Hero de site-content binnen?
A) Via props: `AppShell` geeft `siteContent` door aan `Footer`, en de home-route geeft de socials door aan `Hero`. Dat is hetzelfde patroon als de Hero nu met `content` werkt, en makkelijk te testen. Als de API er is, wordt alleen de bron vervangen (bv. een route-loader). **(aanbevolen)**
B) Componenten importeren `siteContent` direct. Dat is het simpelst, maar later moet elk component aangepast worden.
C) Een React-context (`SiteContentProvider` + `useSiteContent()`) rond de app, klaar om later met data uit de API gevuld te worden
X) Anders (beschrijf hieronder na de [Answer]:-tag)
[Answer]: A
### Vraag 4: Waar staan de menu-items voor het footermenu?
De items van het hoofdmenu (`navItems`) zijn routes, en routes zijn code: het CMS kan geen pagina's toevoegen. In de requirements (FR-04) stond het footermenu in `siteContent`.
A) Het footermenu staat naast `navItems` in de navigatiecode (bijvoorbeeld `navigation.ts` met `mainNav` en `footerNav`), getypeerd op bestaande routes. `siteContent` bevat alleen echte content (tekst, socials, e-mail). Ik pas FR-04 hierop aan. **(aanbevolen)**
B) Het footermenu staat in `siteContent`, zoals in FR-04. De `to`-waarden zijn gewone strings, dus de router controleert de types minder streng.
X) Anders (beschrijf hieronder na de [Answer]:-tag)
[Answer]: A
### Vraag 5: Opbouw van de placeholder-pagina's
Vijf routes krijgen voorlopig placeholder-inhoud: portfolio, soorten-fotoshoots, contact, privacyverklaring en over-mij.
A) Een herbruikbaar `PageIntro`-component: ruimte onder de header, `Container`, eyebrow en `h1`. De placeholders gebruiken het nu, en de echte pagina's straks als bovenste blok (het "Intro"-blok uit LAYOUT.md). **(aanbevolen)**
B) Een apart `PagePlaceholder`-component, alleen voor de placeholders, dat later weer verdwijnt
C) Per route inline, zonder gedeeld component
X) Anders (beschrijf hieronder na de [Answer]:-tag)
[Answer]: A
### Vraag 6: 404- en foutpagina
A) Eén gedeeld `StatusPage`-component (titel, tekst, knop naar home). `NotFound` en `ErrorPage` zijn er dunne wrappers omheen. **(aanbevolen)**
B) Twee losse componenten
X) Anders (beschrijf hieronder na de [Answer]:-tag)
[Answer]: A
### Vraag 7: Stijl van de footerlinks
Footerlinks (socials, e-mail, footermenu) delen één stijl: zachte kleur, accent bij hover, en een zichtbare focusring. Die stijl komt op meer dan twee plekken voor, dus centraliseren is zinvol.
A) Chakra's ingebouwde `Link`-recipe uitbreiden met een variant `subtle` in het thema. Footerlinks worden `<Link variant="subtle">`, en voor router-links gebruiken we `<Link asChild><RouterLink …/></Link>`. Zo benutten we Chakra zelf. **(aanbevolen)**
B) Een eigen nieuwe recipe `subtleLink`, naast `linkButton`
C) Een klein `FooterLink`-component met style props, zonder thema-uitbreiding
X) Anders (beschrijf hieronder na de [Answer]:-tag)
[Answer]: A
### Vraag 8: Gedeelde router-link en bestaande code
`chakra(Link)` wordt nu in drie bestanden apart gedefinieerd: `NavLink`, `MobileNav` en `LinkButton`.
A) Eén gedeelde `RouterLink` (in `components/RouterLink.tsx`) en de drie bestaande bestanden daarop omzetten. Dat is een kleine, veilige refactor. **(aanbevolen)**
B) Alleen de nieuwe code gebruikt de gedeelde `RouterLink`. Bestaande bestanden blijven zoals ze zijn.
X) Anders (beschrijf hieronder na de [Answer]:-tag)
[Answer]: A
### Vraag 9: Het "volledig zichtbaar bij hover"-patroon
`HeroArrows` en `HeroSocials` herhalen allebei hetzelfde patroon: opacity 0.6, bij hover of focus naar 1, met de transitie-tokens. De terug-naar-boven-knop gebruikt dat patroon niet (die heeft een rand en kleur zoals in het design).
A) Centraliseren in het thema, als recipe of als gedeelde style-set, en de twee Hero-componenten erop omzetten. Dat is een kleine, veilige refactor.
B) Laten zoals het is. Het komt maar op twee plekken voor, beide in de Hero, en de shell gebruikt het niet. **(aanbevolen)** Hier doen we "niet forceren".
X) Anders (beschrijf hieronder na de [Answer]:-tag)
[Answer]: A
@@ -0,0 +1,182 @@
# Execution Plan — frontend-shell
## Detailed Analysis Summary
### Transformation Scope (Brownfield)
- **Transformation Type**: Single package (`web/`), application-level changes only — no architectural or infrastructure transformation
- **Primary Changes**: Complete the application shell: footer, back-to-top, skip link + main landmark, 404 and error pages, logo link, full navigation with placeholder routes, scroll restoration, shared site content module, theme additions for reused styling, test toolchain, security headers on dev/preview server, tech-debt clean-up
- **Related Components**: `AppShell`, `NavigationBar` (+ `navItems`), `Footer`, `Hero` (socials source), `theme.ts`, `main.tsx` (router options), `routes/*`, `vite.config.js`, `package.json`
### Change Impact Assessment
- **User-facing changes**: Yes — new footer, to-top button, skip link, 404/error pages, extra menu items and placeholder pages, footer contrast deviates from design (AA)
- **Structural changes**: Yes (minor) — new shell components, shared `siteContent` module, shared router-link primitive; shell stays Header / main / Footer
- **Data model changes**: Yes (minor) — new typed `SiteContent` shape; `HeroContent.socials` moves to it
- **API changes**: No external API. Internal: Hero's content props change (socials no longer in `heroContent`)
- **NFR impact**: Yes — accessibility (WCAG 2.1 AA), new test toolchain incl. PBT, security headers / CSP, supply-chain hygiene
### Component Relationships
```mermaid
graph TD
Root["routes/__root.tsx"] --> AppShell["AppShell"]
Root --> NotFound["NotFound page (new)"]
Root --> ErrorPage["Error page (new)"]
AppShell --> SkipLink["SkipLink (new)"]
AppShell --> Nav["NavigationBar (changed)"]
AppShell --> Main["main#main + Outlet (new)"]
AppShell --> Footer["Footer (rebuilt)"]
AppShell --> ToTop["BackToTop (new)"]
Nav --> NavItems["navItems (changed)"]
Footer --> SiteContent["siteContent (new)"]
Hero["Hero (changed)"] --> SiteContent
Footer --> Theme["theme.ts (changed)"]
ToTop --> Theme
Main --> Pages["placeholder routes (new)"]
classDef existing fill:#63b3ed,stroke:#2b6cb0,stroke-width:1px,color:#000;
classDef changed fill:#f6e05e,stroke:#c05621,stroke-width:1px,color:#000;
classDef added fill:#9ae6b4,stroke:#2f855a,stroke-width:1px,color:#000;
class Root,AppShell existing;
class Nav,NavItems,Hero,Theme,Footer changed;
class NotFound,ErrorPage,SkipLink,Main,ToTop,SiteContent,Pages added;
```
Text alternative: the root route renders AppShell plus new NotFound/Error pages; AppShell gains SkipLink, a main landmark, a rebuilt Footer and a new BackToTop; Footer and Hero both read the new siteContent module; theme.ts is extended (blue = unchanged, yellow = changed, green = new).
- **Primary Component**: `web/` (React SPA) — Change Type: Minor (additive), Priority: Critical
- **Infrastructure Components**: none (only `vite.config.js` dev/preview headers — Configuration-only)
- **Shared Components**: `theme.ts`, `siteContent`, shared router-link primitive — Minor
- **Dependent Components**: `Hero` (socials source) — Minor
- **Supporting Components**: new test setup (Vitest config, test utils, generators) — Minor
### Risk Assessment
- **Risk Level**: Low — isolated front-end, not deployed yet, every change reversible via git
- **Rollback Complexity**: Easy
- **Testing Complexity**: Moderate — new toolchain (Vitest + RTL + fast-check) and jsdom limits around scrolling/media queries
## Workflow Visualization
```mermaid
flowchart TD
Start(["User Request"])
subgraph INCEPTION["🔵 INCEPTION PHASE"]
WD["Workspace Detection<br/><b>COMPLETED</b>"]
RE["Reverse Engineering<br/><b>COMPLETED</b>"]
RA["Requirements Analysis<br/><b>COMPLETED</b>"]
US["User Stories<br/><b>SKIP</b>"]
WP["Workflow Planning<br/><b>IN PROGRESS</b>"]
AD["Application Design<br/><b>EXECUTE</b>"]
UG["Units Generation<br/><b>SKIP</b>"]
end
subgraph CONSTRUCTION["🟢 CONSTRUCTION PHASE"]
FD["Functional Design<br/><b>EXECUTE</b>"]
NFRA["NFR Requirements<br/><b>EXECUTE</b>"]
NFRD["NFR Design<br/><b>SKIP</b>"]
ID["Infrastructure Design<br/><b>SKIP</b>"]
CG["Code Generation<br/>(Planning + Generation)<br/><b>EXECUTE</b>"]
BT["Build and Test<br/><b>EXECUTE</b>"]
end
Start --> WD
WD --> RE
RE --> RA
RA -.-> US
RA --> WP
WP --> AD
AD -.-> UG
AD --> FD
FD --> NFRA
NFRA -.-> NFRD
NFRA -.-> ID
NFRA --> CG
CG --> BT
BT --> End(["Complete<br/>(Operations: ask again)"])
style WD fill:#4CAF50,stroke:#1B5E20,stroke-width:3px,color:#fff
style RE fill:#4CAF50,stroke:#1B5E20,stroke-width:3px,color:#fff
style RA fill:#4CAF50,stroke:#1B5E20,stroke-width:3px,color:#fff
style WP fill:#4CAF50,stroke:#1B5E20,stroke-width:3px,color:#fff
style CG fill:#4CAF50,stroke:#1B5E20,stroke-width:3px,color:#fff
style BT fill:#4CAF50,stroke:#1B5E20,stroke-width:3px,color:#fff
style AD fill:#FFA726,stroke:#E65100,stroke-width:3px,stroke-dasharray: 5 5,color:#000
style FD fill:#FFA726,stroke:#E65100,stroke-width:3px,stroke-dasharray: 5 5,color:#000
style NFRA fill:#FFA726,stroke:#E65100,stroke-width:3px,stroke-dasharray: 5 5,color:#000
style US fill:#BDBDBD,stroke:#424242,stroke-width:2px,stroke-dasharray: 5 5,color:#000
style UG fill:#BDBDBD,stroke:#424242,stroke-width:2px,stroke-dasharray: 5 5,color:#000
style NFRD fill:#BDBDBD,stroke:#424242,stroke-width:2px,stroke-dasharray: 5 5,color:#000
style ID fill:#BDBDBD,stroke:#424242,stroke-width:2px,stroke-dasharray: 5 5,color:#000
style Start fill:#CE93D8,stroke:#6A1B9A,stroke-width:3px,color:#000
style End fill:#CE93D8,stroke:#6A1B9A,stroke-width:3px,color:#000
style INCEPTION fill:#BBDEFB,stroke:#1565C0,stroke-width:3px,color:#000
style CONSTRUCTION fill:#C8E6C9,stroke:#2E7D32,stroke-width:3px,color:#000
linkStyle default stroke:#333,stroke-width:2px
```
Text alternative: completed Inception stages (green) lead to Application Design, Functional Design and NFR Requirements (orange, execute), then Code Generation and Build and Test (green); User Stories, Units Generation, NFR Design and Infrastructure Design are skipped (grey). The Operations phase is undecided and will be asked again after Build and Test.
## Phases to Execute
### 🔵 INCEPTION PHASE
- [x] Workspace Detection (COMPLETED)
- [x] Reverse Engineering (COMPLETED)
- [x] Requirements Analysis (COMPLETED)
- [x] User Stories (SKIPPED)
- **Rationale**: One persona (site visitor), requirements already concrete per shell element with clear acceptance; stories would restate FR-01…FR-11
- [x] Execution Plan (IN PROGRESS)
- [ ] Application Design - EXECUTE (minimal depth)
- **Rationale**: Several new components (Footer, BackToTop, SkipLink, NotFound, ErrorPage, placeholder page layout) and new shared pieces (`siteContent`, shared router-link primitive, theme additions such as a subtle-link style). Their boundaries, props and what gets centralised in the theme (NFR-02 reuse principle) should be decided once, before code
- [ ] Units Generation - SKIP
- **Rationale**: One package, one cohesive unit ("frontend-shell"); no parallel streams or deployment boundaries to split on
### 🟢 CONSTRUCTION PHASE
- [ ] Functional Design - EXECUTE (minimal depth)
- **Rationale**: Required by PBT-01 — identify testable properties of the shell's logic (to-top visibility threshold, footer/nav item derivation, current-year copyright, content shape). Also pins down the `SiteContent` data model and to-top / skip-link behaviour rules
- [ ] NFR Requirements - EXECUTE (minimal depth)
- **Rationale**: Tech stack decisions for the new test toolchain (Vitest, RTL, jsdom, fast-check — PBT-09), accessibility acceptance criteria, exact security header set and CSP (SECURITY-04), supply-chain checks (SECURITY-10)
- [ ] NFR Design - SKIP
- **Rationale**: The NFR patterns are small and concrete (one header config in `vite.config.js`, one Vitest setup, one generators file); they are specified directly in NFR Requirements and the code generation plan without a separate design document
- [ ] Infrastructure Design - SKIP
- **Rationale**: No infrastructure; hosting is out of scope (Operations undecided). Production header requirements are documented, not provisioned
- [ ] Code Generation - EXECUTE (ALWAYS)
- **Rationale**: Implementation planning and code generation needed
- [ ] Build and Test - EXECUTE (ALWAYS)
- **Rationale**: Build, test (incl. PBT with seed logging) and verification needed
### 🟡 OPERATIONS PHASE
- [ ] Deployment Setup, Monitoring Setup, Production Readiness Validation - UNDECIDED
- **Rationale**: Operations Configuration = Undecided (Q14 = C); asked again at Build and Test
## Package Change Sequence
Single package (`web/`). Suggested order inside the unit (detailed in the code generation plan):
1. Test toolchain + tech-debt clean-up (safe base, `pnpm build` green)
2. Theme additions + shared primitives (`siteContent`, shared router link)
3. Routes + `navItems` (placeholder pages, privacy page)
4. Shell components (SkipLink + main, Footer, BackToTop, logo link)
5. 404 + error pages, scroll restoration
6. Security headers on dev/preview server
7. Tests (example-based + property-based) per step, final full run
## Estimated Timeline
- **Total Stages Remaining**: 5 (Application Design, Functional Design, NFR Requirements, Code Generation, Build and Test)
- **Estimated Duration**: a few working sessions; each design stage is short (minimal depth), Code Generation is the bulk
## Success Criteria
- **Primary Goal**: Every page renders inside a complete shell matching LAYOUT.md and the static design (minus the side area and mobile e-mail), with the agreed accessibility and contrast adjustments
- **Key Deliverables**:
- Footer, BackToTop, SkipLink + main landmark, logo link, full navigation
- Placeholder routes `/portfolio`, `/soorten-fotoshoots`, `/contact`, `/privacyverklaring`
- 404 and generic error pages inside the shell; scroll restoration
- `siteContent` module used by Hero and Footer; reused/centralised styling per NFR-02
- Vitest + RTL + fast-check setup with example-based and property-based tests
- Security headers on dev/preview server + documented production header set
- Tech-debt items from FR-11 resolved
- **Quality Gates**:
- `pnpm build` succeeds (type-check + bundle)
- `pnpm test` passes, PBT seed logged on failure
- `pnpm audit` reviewed, no unaddressed high/critical issues
- Security Baseline and PBT compliance summaries have no blocking findings
- Manual keyboard/screen check of the shell (skip link, focus styles, to-top, menus)
- **Integration Testing**: Shell + routes together (navigation, 404, error boundary, scroll restoration)
- **Operational Readiness**: Out of scope unless Operations is chosen at Build and Test
@@ -0,0 +1,39 @@
# Verduidelijkingsvragen — Front-end shell
Twee antwoorden zijn nog niet eenduidig genoeg om de requirements op vast te leggen.
---
## Ambiguïteit 1: Logo in de footer (Vraag 4)
Je antwoord: "Als je de achtergrond doorzichtig kan maken, dan kan hij erbij. Als dat niet lukt, dan kan dat deel uit de footer. Het lijkt mij sowieso onnodige vulling?"
Wat ik heb uitgezocht:
- **Het lukt.** Het beeldmerk is zwart lijnwerk op wit. Ik heb de witte achtergrond omgezet naar transparantie en het lijnwerk in de ink-kleur van het thema gezet, met zachte randen. Proefversie op de footerachtergrond: `scratchpad/footer-mark-preview.png` (ik kan hem tonen).
- **Het is hetzelfde beeldmerk als het logo in de header.** `web/src/assets/logo-dark.png` is al transparant en toont dezelfde cirkel met "AS" en "Andrea Slop Fotografie". Het verschil: de footerversie heeft dunnere lijnen en veel lege ruimte eromheen.
- **Mijn mening over "onnodige vulling":** de eerste footerkolom bestaat in het design uit het beeldmerk met één zin eronder ("Lifestyle fotograaf uit Huizen…"). Zonder beeldmerk wordt die kolom een losse zin naast twee kolommen met een kopje, en dat oogt wat kaal. Een merkteken onderaan is gangbaar en sluit de pagina rustig af. Het is wel een herhaling van de header, dus weglaten is verdedigbaar. Mijn advies is A.
### Verduidelijkingsvraag 1
Wat doen we met het beeldmerk in de footer?
A) Het bestaande `logo-dark.png` hergebruiken. Er komt geen extra bestand bij en het is al transparant.
B) De omgezette footerversie gebruiken (dunnere lijnen, zoals op de live site), bijgesneden zonder lege rand, als `web/src/assets/footer-mark.png`
C) Geen beeldmerk in de footer. De eerste kolom krijgt alleen de korte tekst.
X) Anders (beschrijf hieronder na de [Answer]:-tag)
[Answer]: A
---
## Ambiguïteit 2: Link naar de privacyverklaring (Vraag 5 en Vraag 1)
Je koos bij Vraag 5 voor het footermenu mét een link naar een privacyverklaring "die later komt". Bij Vraag 1 koos je voor placeholder-routes voor pagina's die nog niet af zijn. Het is nog niet duidelijk wat de privacylink nu moet doen.
### Verduidelijkingsvraag 2
Wat doet de privacylink zolang de privacyverklaring er nog niet is?
A) Nu ook een placeholder-route `/privacyverklaring` aanmaken (net als bij Vraag 1). De link werkt meteen en de tekst komt later.
B) De link pas tonen als de pagina bestaat. Tot die tijd is het footermenu zoals in het design (Portfolio, Soorten fotoshoots, Contact).
X) Anders (beschrijf hieronder na de [Answer]:-tag)
[Answer]: A
@@ -0,0 +1,148 @@
# Verificatievragen — Front-end shell
Al vastgelegd (geen vraag nodig):
- Het **info-menu (side area)** en het **e-mailadres in het mobiele menu** blijven weg (jouw keuze).
- Het **logo in de header** wordt een link naar de homepage, zoals in het design.
- Het **jaartal** in de footer is altijd het huidige jaar.
Vul per vraag de letter in na `[Answer]:`. Past geen enkele optie, kies dan de laatste (Anders) en licht toe.
---
## Vraag 1: Menu-items voor pagina's die nog niet bestaan
Het design heeft vijf menu-items (Home, Over mij, Portfolio, Soorten fotoshoots, Contact). Alleen voor Home en Over mij bestaat al een route. Wat doen we met de andere drie?
A) Nu lege placeholder-routes aanmaken (`/portfolio`, `/soorten-fotoshoots`, `/contact`) met eigen titel en beschrijving, en ze in het menu en de footer zetten. De shell is dan compleet en de pagina's worden later gevuld.
B) Alleen menu-items tonen voor pagina's die af zijn. De andere komen erbij als die pagina's gebouwd worden.
X) Anders (beschrijf hieronder na de [Answer]:-tag)
[Answer]: A
## Vraag 2: Waar komt de footer-content vandaan?
De footer bevat een korte tekst, sociale links, een e-mailadres en een footermenu. De sociale links staan nu ook al in `heroContent.ts`.
A) Eén gedeeld, API-vormig contentbestand voor sitebrede gegevens (bv. `siteContent.ts`: socials, e-mail, footertekst). Hero en footer lezen daaruit, en later komt het uit de CMS-API.
B) Direct in de Footer-component zetten. De hero houdt zijn eigen socials.
X) Anders (beschrijf hieronder na de [Answer]:-tag)
[Answer]: A
## Vraag 3: Sociale links in de footer
Hoe tonen we Facebook en Instagram in de footer?
A) Als tekstlinks ("Facebook", "Instagram"), precies zoals in het design
B) Als iconen, net als in de hero
C) Icoon met tekst ernaast
X) Anders (beschrijf hieronder na de [Answer]:-tag)
[Answer]: A
## Vraag 4: Logo in de footer
Het design gebruikt een apart beeldmerk (`footer-mark.png`, op de live site `wp-content/uploads/2025/08/4.png`). Dat staat nog niet in `web/src/assets`.
A) Ik download het van de live site naar `web/src/assets/footer-mark.png`
B) Het bestaande donkere logo (`logo-dark.png`) gebruiken
C) Ik lever het bestand zelf aan
X) Anders (beschrijf hieronder na de [Answer]:-tag)
[Answer]: X, het huidige bestand heeft een witte achtergrond. Als je die wat kan aanpassen zodat de achtergrodnd doorichtig is dan kan hij in de footer erbij. Als dat niet lukt dan zou dat dele uit de footer kunnen. Het lijkt mij sowieso onnodige vulling?
## Vraag 5: Footermenu (onderste balk)
In het design staan in de onderste balk naast "© jaar Andrea Slop Fotografie" de links Portfolio, Soorten fotoshoots en Contact.
A) Zoals in het design: Portfolio, Soorten fotoshoots, Contact
B) Het volledige hoofdmenu (alle items uit `navItems`)
C) Zoals in het design, plus een link naar een privacyverklaring (die pagina komt later)
D) Geen footermenu, alleen de copyright-regel
X) Anders (beschrijf hieronder na de [Answer]:-tag)
[Answer]: C
## Vraag 6: Terug-naar-boven-knop
Het design heeft een vierkante knop rechtsonder (↑). Die verschijnt na 60% van een schermhoogte scrollen en scrollt soepel terug, of direct als iemand minder beweging wil (reduced motion).
A) Bouwen zoals in het design
B) Bouwen, maar met een icoon (bijv. Ant Design `up-outlined`) in plaats van de ↑-pijl
C) Niet bouwen
X) Anders (beschrijf hieronder na de [Answer]:-tag)
[Answer]: B
## Vraag 7: Toegankelijkheid van de shell
A) Skip-link "Direct naar de inhoud", een `<main id="main">`-landmark, zichtbare focusstijlen op alle shell-links en -knoppen, en de shell volledig met het toetsenbord te bedienen (WCAG 2.1 AA als richtlijn)
B) Alleen skip-link en `<main>`-landmark, zoals in het design
C) Niets extra's
X) Anders (beschrijf hieronder na de [Answer]:-tag)
[Answer]: A
## Vraag 8: Scrollpositie bij navigeren
Wat gebeurt er met de scrollpositie als je van pagina wisselt?
A) Nieuwe pagina begint bovenaan. Met de terug-/vooruitknop van de browser kom je terug op de plek waar je was (scroll restoration).
B) Altijd bovenaan beginnen, ook bij terug/vooruit (het huidige standaardgedrag)
X) Anders (beschrijf hieronder na de [Answer]:-tag)
[Answer]: A
## Vraag 9: Pagina niet gevonden (404)
Een onbekende URL toont nu de standaardmelding van TanStack Router.
A) Een eenvoudige 404-pagina binnen de shell (header en footer blijven staan), met een knop terug naar home
B) Nu niet, later apart oppakken
X) Anders (beschrijf hieronder na de [Answer]:-tag)
[Answer]: A
## Vraag 10: Technische schuld rond de shell opruimen
Uit de analyse kwamen een paar punten naar voren:
- `body { height: 250vh }` in `theme.ts` (tijdelijke scroll-test)
- Tailwind-classes die niets doen in `Footer.tsx` en `over-mij.tsx`
- `let` in plaats van `const` in `NavigationBar.tsx`
- Ongebruikte Vite-startbestanden (`hero.png`, `typescript.svg`, `vite.svg`)
A) Alles meenemen in deze feature
B) Alleen wat de shell direct raakt (de 250vh-hack en de Footer-classes)
C) Niets, dat doe ik apart
X) Anders (beschrijf hieronder na de [Answer]:-tag)
[Answer]: A
## Vraag 11: Testen
Het project heeft nog geen testframework.
A) Vitest + React Testing Library toevoegen en de shell-componenten unit-testen (footer-inhoud, to-top-zichtbaarheid, skip-link, 404)
B) Geen testframework. Verificatie via `pnpm build` (type-check) en een handmatige checklist in de browser.
C) Playwright toevoegen voor end-to-end tests van de shell
X) Anders (beschrijf hieronder na de [Answer]:-tag)
[Answer]: A
## Vraag 12: Beveiligingsextensies
Moeten de beveiligingsregels als harde vereisten worden afgedwongen voor dit project?
A) Ja — dwing alle BEVEILIGINGSREGELS af als blokkerende vereisten (aanbevolen voor productietoepassingen)
B) Nee — sla alle BEVEILIGINGSREGELS over (geschikt voor PoC's, prototypes en experimentele projecten)
X) Anders (beschrijf hieronder na de [Answer]:-tag)
[Answer]: A
## Vraag 13: Property-Based Testing Extensie
Moeten de property-based testing (PBT) regels worden afgedwongen voor dit project?
A) Ja — dwing alle PBT-regels af als blokkerende vereisten (aanbevolen voor projecten met bedrijfslogica, datatransformaties, serialisatie of stateful componenten)
B) Gedeeltelijk — dwing PBT-regels alleen af voor pure functies en serialisatie round-trips (geschikt voor projecten met beperkte algoritmische complexiteit)
C) Nee — sla alle PBT-regels over (geschikt voor eenvoudige CRUD-applicaties, UI-only projecten of dunne integratielagen zonder significante bedrijfslogica)
X) Anders (beschrijf hieronder na de [Answer]:-tag)
[Answer]: A
## Vraag 14: Operations-fase
Moet deze feature na de Construction-fase door de Operations-fase (deployment en monitoring inrichten)?
A) Ja — de Operations-fase doorlopen na Construction (deployment + monitoring)
B) Nee — stoppen na Build and Test (deployment/monitoring vallen buiten deze feature)
C) Weet ik nog niet — vraag het opnieuw na de Construction-fase
X) Anders (beschrijf hieronder na de [Answer]:-tag)
[Answer]: C
@@ -0,0 +1,246 @@
# Requirements — Front-end Application Shell
## Intent Analysis
- **User Request**: "ik wil met aidlc de shell voor de front-end afmaken" (finish the front-end shell with AI-DLC)
- **Request Type**: Enhancement (completing an existing, partially built feature) with some new capability (routes, footer, to-top, 404, error page)
- **Scope Estimate**: Multiple components within one package (`web/`): shell components, routes, theme, content module, test setup
- **Complexity Estimate**: Moderate — mostly UI work against an existing design, plus a new test toolchain and security/PBT constraints
- **Requirements Depth**: Standard
## Source of Truth
- Shell structure: [LAYOUT.md](../../../../../LAYOUT.md) — Header / Page content / Footer
- Visual and markup reference: `design/andreaslop-static/` (header, footer, to-top, skip link in `index.html`; styles in `assets/css/style.css`)
- Decisions: [requirement-verification-questions.md](requirement-verification-questions.md), [requirement-clarification-questions.md](requirement-clarification-questions.md)
## Out of Scope
- **Side area / "Info menu"** panel from the design (owner decision)
- **E-mail address in the mobile menu** (owner decision)
- Real content for Portfolio, Soorten fotoshoots, Contact, Privacyverklaring and Over mij (placeholders only)
- Contact form, Instagram feed, CMS/.NET API
- Hosting/deployment (Operations phase undecided)
---
## Functional Requirements
### FR-01 Placeholder routes
- Create routes `/portfolio`, `/soorten-fotoshoots`, `/contact` and `/privacyverklaring`.
- Each has its own `head` via `pageHead()` with a title (≤ ~60 chars) and description (≤ ~155 chars), in the existing style (`"<Page> | Andrea Slop Fotografie"`).
- Each renders a simple placeholder (page heading plus a short line) that sits below the fixed header, so no content is hidden behind it.
- *Source: Q1 = A, Clarification 2 = A*
### FR-02 Main navigation items
- `navItems` contains, in this order: Home, Over mij, Portfolio, Soorten fotoshoots, Contact.
- Used by both the desktop navigation and the mobile menu (existing behaviour retained).
- Privacyverklaring is **not** in the main navigation.
- *Source: Q1 = A, design*
### FR-03 Header logo links home
- The header logo is a link to `/` with accessible name "Andrea Slop Fotografie, naar de homepage" (as in the design).
- The existing dark/light logo swap and shrink behaviour are unchanged.
- *Source: design*
### FR-04 Shared site content module
- Introduce one API-shaped, typed content module for site-wide data (working name `siteContent`). It holds:
- the footer intro text
- social links (`platform` + `href`, reusing `SocialPlatform`)
- the contact e-mail address, stored as separate `user` and `domain` parts and joined only in the browser (anti-spam; revised in Functional Design, BR-EMAIL-01)
- The Hero's social links come from this module instead of `heroContent.ts`, so both Hero and Footer read one source.
- Plain data (strings and arrays), so it can later be replaced 1-on-1 by a CMS API response.
- **Menu items are not content.** The main menu and footer menu items are routes, which are code (the CMS cannot add pages). They live together in a typed navigation module (`mainNav`, `footerNav`), not in `siteContent`.
- *Source: Q2 = A; revised by Application Design Q4 = A*
### FR-05 Footer
The top section has three columns:
1. **Brand**: the monogram, reusing `web/src/assets/logo-dark.png` (~150px wide), with the intro text "Lifestyle fotograaf uit Huizen. Ik leg jouw mooiste momenten vast." below it.
2. **Socials**: an eyebrow heading "Socials", then **text links** "Facebook" and "Instagram". They open in a new tab with `rel="noopener noreferrer"`.
3. **Contact**: an eyebrow heading "Contact", then a `mailto:` link to the e-mail address.
The bottom bar holds:
- "© {current year} Andrea Slop Fotografie"
- a footer navigation (`aria-label="Footermenu"`) with Portfolio, Soorten fotoshoots, Contact and Privacyverklaring
Layout and styling:
- **Responsive**: three columns on desktop, two on tablet and one on mobile, as in the design breakpoints.
- On mobile the bottom bar stacks and is centred.
- **Styling** uses the theme tokens: `paper.alt` background, a `line` top border, link hover in the accent colour, with the contrast exceptions in NFR-01.
- The year is always the current year.
- *Source: Q3 = A, Q5 = C, Clarification 1 = A, Clarification 2 = A, design*
### FR-06 Back-to-top button
- A fixed square button at the bottom right, with an Ant Design `up-outlined` icon instead of the ↑ character. It deviates from the design (`.to-top`): dark `ink` background with a white icon so it stands out, and on very wide screens it aligns with the content edge (revised in Functional Design, BR-TOP-07/08).
- It becomes visible when the page is scrolled more than 60% of the viewport height, and is hidden again otherwise.
- **Click**: scrolls to the top, smoothly, or instantly when `prefers-reduced-motion: reduce` is set.
- **Accessibility**:
- accessible name "Terug naar boven"
- while hidden it is not focusable, not announced and not clickable
- It sits below the header and mobile menu in stacking order.
- *Source: Q6 = B*
### FR-07 Skip link and main landmark
- The first focusable element on every page is a skip link "Direct naar de inhoud", visually hidden until it receives focus.
- It targets `<main id="main">`, which wraps the routed page content (`Outlet`). `main` can receive focus programmatically, so keyboard and screen-reader users land in the content.
- *Source: Q7 = A*
### FR-08 Scroll position on navigation
- Navigating to a new page starts at the top.
- Browser back/forward restores the previous scroll position (router scroll restoration).
- *Source: Q8 = A*
### FR-09 Not-found (404) page
- An unknown URL renders a "Pagina niet gevonden" page **inside the shell**: header and footer stay.
- The page shows a heading, a short explanation and a `LinkButton` back to home.
- Head: title "Pagina niet gevonden | Andrea Slop Fotografie" plus `robots: noindex`.
- *Source: Q9 = A*
### FR-10 Generic error page
- Unexpected render or route errors show a generic error page inside the shell: a short Dutch message and a link home.
- It shows no error message, stack trace or internal details to the visitor.
- *Source: SECURITY-09, SECURITY-15*
### FR-11 Technical debt clean-up
- Remove `globalCss.body.height: '250vh'` from `theme.ts`.
- Remove the non-functional Tailwind-style `className`s (`Footer.tsx` is replaced; `over-mij.tsx` gets a placeholder in the same style as FR-01).
- Make `over-mij.tsx` follow the project Prettier style.
- `let [open, setOpen]` → `const` in `NavigationBar.tsx`.
- Delete unused starter assets `assets/hero.png`, `assets/typescript.svg`, `assets/vite.svg`, after verifying they are unreferenced.
- Move `@vitejs/plugin-react` from `dependencies` to `devDependencies`. It is a build tool (SECURITY-10 hygiene).
- *Source: Q10 = A*
### FR-12 SEO foundation (added at Functional Design)
- One page registry (`sitePages`) is the single source for per-page title, description, `indexed` flag and preview image.
- Every page has a canonical URL and `og:url` on `https://andreaslop.nl`, plus `og:image` and `twitter:card`. Placeholder, 404 and error pages are `noindex`.
- Site-wide `ProfessionalService` JSON-LD, without the e-mail address.
- `sitemap.xml` is generated at build time from the registry; `robots.txt` is static. A test keeps the registry and the routes in sync.
- The code stays prerender-ready (no browser APIs during render); prerendering itself is a follow-up.
- *Source: functional design change request, [frontend-shell-fd-change-questions.md](../../construction/plans/frontend-shell-fd-change-questions.md); rules BR-SEO-01…11*
### FR-13 Page change for screen readers (added at Functional Design)
- After every client-side page change, focus moves to `main#main`, so screen readers announce the new content.
- *Source: change request Q6 = A; rule BR-A11Y-01*
---
## Non-Functional Requirements
### NFR-01 Accessibility (WCAG 2.1 AA as guideline for the shell)
- All shell links and buttons are keyboard operable and have a visible focus style.
- Landmarks:
- `header` contains `nav aria-label="Hoofdmenu"`
- `main#main`
- `footer` contains `nav aria-label="Footermenu"`
- Placeholder, 404 and error pages each have exactly one `h1`.
- **Text contrast ≥ 4.5:1** for small text. The design's colours do not all meet this. Measured on `paper.alt`:
| Token | Contrast on `paper.alt` | AA for small text |
|---|---|---|
| `ink.muted` (#8a827a) | 3.19:1 | fails |
| `accent` (#7f8b76) | 3.03:1 | fails |
| `ink.soft` | 6.72:1 | passes |
| `accent.deep` | 4.80:1 | passes |
The shell therefore uses `ink.soft` instead of `ink.muted` for the footer headings and the bottom bar, and `accent.deep` instead of `accent` for link hover on light backgrounds. **This is a deliberate deviation from the design.**
- `prefers-reduced-motion` is respected by every new animation or transition (to-top reveal, smooth scrolling).
- *Source: Q7 = A*
### NFR-02 Styling: reuse first, use Chakra where it helps
Principle: **reuse as much as possible and make good use of Chakra UI v3, where it is a natural fit — do not force it.** *Source: user feedback at Requirements review*
- **Reuse before adding.** Prefer what already exists over new styling:
- **Theme tokens**: colours, spacing (`gutter`), `header` sizes, durations, easings
- **Text styles**: `eyebrow` for the footer column headings and footer labels
- **Recipes**: `linkButton` for the 404 and error page buttons
- **Components**: `LinkButton`, `NavLink` and `navItems`
- **Use Chakra's built-in components and layout primitives** where they fit, for example:
- `Container`, `SimpleGrid`/`Grid`, `Stack`/`HStack`, `Heading`, `Text`, `Link`, `Image`, `VisuallyHidden`
- responsive style props instead of custom media queries
- `_hover`, `_focusVisible` and `_currentPage` pseudo props
- **Centralise repeated styling.** When the same styling appears in two or more places, lift it into the theme rather than copy it:
- Examples: the subtle-link style shared by footer links, or the "hover to full opacity" icon pattern already in `HeroArrows` and `HeroSocials`.
- Lift it into a token, text style or recipe, or into a small shared component (e.g. one shared `chakra(Link)` instead of one per file).
- Existing code is refactored to use it only where that is a small, safe change.
- **Do not force it.** Use the `chakra.*` factory or plain style props when no built-in component fits. Do not add a recipe or token for a one-off style. Do not bend a Chakra component into something it is not meant for.
- **No other styling approaches**: no hard-coded colours, no CSS files, no Tailwind.
### NFR-02a Consistency with the existing codebase
- **Files and naming**:
- Components follow the existing folder pattern, e.g. `components/Footer/`.
- Code comments are in Dutch, matching the existing code.
- Prettier style: 4 spaces, single quotes.
- Icons use `@iconify/react/offline` with bundled `@iconify-icons/ant-design` data, so there are no runtime icon requests.
### NFR-03 Testing
- Add **Vitest**, **React Testing Library** (with `jsdom` and `@testing-library/user-event`) and **fast-check** as dev dependencies. Add a `test` script to `package.json`.
- **Example-based unit tests** cover:
- footer content, links and current year
- to-top visibility, click behaviour and reduced motion
- skip link target
- 404 and error pages rendering inside the shell
- nav items order
- external link attributes
- **Property-based tests** (fast-check) cover the pure logic identified in Functional Design, e.g. the to-top visibility threshold and the derivation of footer and nav items. They log the seed on failure and keep shrinking enabled.
- **`pnpm build`** (type-check and bundle) still succeeds.
- *Source: Q11 = A, Q13 = A (PBT-01…PBT-10)*
### NFR-04 Security (Security Baseline extension enabled)
- **External links**: every external link uses `target="_blank"` with `rel="noopener noreferrer"`.
- **No visitor-facing internals**: 404 and error pages show no internal details (SECURITY-09, SECURITY-15).
- **No remote scripts or fonts**: no scripts, fonts or styles from external CDNs. Fonts and icons stay self-hosted or bundled (SECURITY-13).
- **Dependencies (SECURITY-10)**:
- New dependencies are added via pnpm, so they are pinned by the committed `pnpm-lock.yaml`.
- No unused dependencies remain.
- `pnpm audit` is documented as the vulnerability scan in the build-and-test instructions.
- **HTTP security headers (SECURITY-04)**:
- A header set is defined and applied to the Vite dev and preview servers: `Content-Security-Policy`, `Strict-Transport-Security`, `X-Content-Type-Options: nosniff`, `X-Frame-Options: DENY` and `Referrer-Policy: strict-origin-when-cross-origin`.
- The same set is documented as the required configuration for the future production host.
- The CSP needs `style-src 'unsafe-inline'`, because Chakra/Emotion inject runtime `<style>` tags. This exception is documented with that justification.
- **No secrets**: no secrets or credentials in front-end code. The site has no authentication.
### NFR-05 Performance
- The shell adds no network requests beyond its bundled assets. The footer logo reuses the already-bundled `logo-dark.png`.
- Scroll listeners are passive. The to-top button and the header share the existing scroll-hook approach; no layout thrashing.
### NFR-06 Responsive design (added at Functional Design)
- Mobile-first with Chakra's default breakpoints; works from 320px wide up to 32:9 without horizontal scrolling.
- Works at 200% zoom; touch targets at least 44×44px below `lg`.
- Content is limited to one shared content width; fixed elements align with it on ultrawide screens.
- *Source: functional design change request; rules BR-RWD-01…05*
---
## Security Baseline — Applicability at Requirements Level
| Rule | Status | Rationale |
|---|---|---|
| SECURITY-01 Encryption at rest/in transit | N/A | No data stores |
| SECURITY-02 Access logging on intermediaries | N/A | No load balancer/CDN/API gateway defined (hosting not in scope) |
| SECURITY-03 Application-level logging | N/A | No server-side component; static SPA. Client error reporting to be revisited when the API/hosting exists |
| SECURITY-04 HTTP security headers | Compliant (planned) | NFR-04 header set for dev/preview + documented for production |
| SECURITY-05 Input validation | N/A | No API endpoints or user input in the shell |
| SECURITY-06 Least privilege | N/A | No IAM |
| SECURITY-07 Network configuration | N/A | No network infrastructure |
| SECURITY-08 Application access control | N/A | Public site, no authentication or protected resources |
| SECURITY-09 Hardening | Compliant (planned) | FR-10 generic error page; FR-11 removes starter assets |
| SECURITY-10 Supply chain | Compliant (planned) | Lock file, `pnpm audit`, no unused deps (NFR-04, FR-11) |
| SECURITY-11 Secure design | N/A | No security-critical logic or public endpoints in the shell |
| SECURITY-12 Authentication | N/A | No authentication |
| SECURITY-13 Integrity | Compliant (planned) | No CDN-loaded resources |
| SECURITY-14 Alerting and monitoring | N/A | No server-side component; Operations phase undecided |
| SECURITY-15 Exception handling | Compliant (planned) | FR-10 root error boundary as global handler; generic user-facing message |
## Summary of Key Decisions
| # | Decision |
|---|---|
| Q1 | Placeholder routes for Portfolio, Soorten fotoshoots, Contact; full menu now |
| Q2 | Shared API-shaped `siteContent` module (Hero + Footer) |
| Q3 | Footer socials as text links |
| Q4 / C1 | Footer monogram reuses `logo-dark.png` |
| Q5 / C2 | Footer menu = design links + Privacyverklaring (placeholder route) |
| Q6 | To-top with Ant Design `up-outlined` icon |
| Q7 | WCAG 2.1 AA guideline for the shell (incl. contrast deviation from design) |
| Q8 | Scroll restoration on back/forward |
| Q9 | 404 page inside the shell |
| Q10 | All listed tech debt cleaned up |
| Q11 | Vitest + React Testing Library |
| Q12 | Security Baseline enforced |
| Q13 | Property-Based Testing enforced (full) |
| Q14 | Operations phase undecided — ask again after Build and Test |
@@ -0,0 +1,124 @@
# Deployment Instructions — frontend-shell
Pipeline: [`.gitea/workflows/continuous_integration.yaml`](../../../../../.gitea/workflows/continuous_integration.yaml).
## 1. One-time setup
### 1.1 Gitea repository settings
In Gitea, under **Repository → Settings → Actions**:
**Secrets** (encrypted):
| Name | Value |
|---|---|
| `PI_MAIN_ADDRESS` | Address of the Pi as reachable from the runner (same as in your other projects) |
| `PI_MAIN_PORT` | SSH port |
| `PI_MAIN_USERNAME` | SSH user |
| `PI_MAIN_PASSWORD` | SSH password (see 1.4 for switching to a key) |
| `FTP_HOST` | Domain or A-record IP of the hosting space (control panel) |
| `FTP_USERNAME` | FTP account **including** the FTP prefix |
| `FTP_PASSWORD` | Password of that FTP account |
**Variables** (not secret):
| Name | Example | Required |
|---|---|---|
| `DEPLOY_PATH_TEST` | `/var/www/html/andreaslop-test` | yes |
| `HEALTH_CHECK_URL_TEST` | `https://test.andreaslop.nl/` | no; without it the post-deploy check is skipped |
| `HEALTH_CHECK_URL_PRODUCTION` | `https://andreaslop.nl/` | no; set it only once the DNS points to the new host |
| `FTP_REMOTE_DIR` | `wwwroot` | no; default `wwwroot` |
Check that Actions is enabled for the repository. The global runner `raspberry-pi-arm64` picks up `runs-on: ubuntu-latest`.
### 1.2 Test server (Raspberry Pi with nginx)
The current WordPress site runs on the same Pi. The test site gets its **own folder** and its **own nginx block**, and touches nothing of WordPress.
1. Create a separate folder, **not** inside the WordPress folder:
```bash
sudo mkdir -p /var/www/html/andreaslop-test
sudo chown <ssh-user> /var/www/html/andreaslop-test
```
Every deploy empties this folder first. The pipeline refuses a folder with `wp-config.php` or `wp-content` in it.
2. Copy [`web/deploy/nginx/andreaslop-test.conf`](../../../../../web/deploy/nginx/andreaslop-test.conf) to `/etc/nginx/conf.d/andreaslop-test.conf`. nginx loads everything in `conf.d/` automatically, so no symlink is needed. Adjust `server_name` and `root` if needed.
```bash
sudo cp web/deploy/nginx/andreaslop-test.conf /etc/nginx/conf.d/andreaslop-test.conf
```
After `pnpm server-config` changes the file, copy it again (manual step; see "Test vs Production" in the deployment plan).
- The block answers only the test hostname, and never acts as `default_server`, so WordPress keeps getting its own requests.
- Do not change the WordPress server block.
3. Run `sudo nginx -t && sudo systemctl reload nginx`.
4. On the reverse-proxy Pi, install the HTTP-only proxy config [`web/deploy/nginx/test.andreaslop.nl.proxy.conf`](../../../../../web/deploy/nginx/test.andreaslop.nl.proxy.conf). It forwards the test hostname to the hosting Pi.
- The **`Host` header is required**, and the file sets it. The hosting Pi uses it to choose between the WordPress block and the test block; without it the request lands on the default block (WordPress).
- The hosting Pi's address (`192.168.1.103`) is set in `config/serverConfig.ts`. Change it there and run `pnpm server-config`, never in the generated file.
```bash
sudo cp test.andreaslop.nl.proxy.conf /etc/nginx/conf.d/test.andreaslop.nl.conf
sudo nginx -t && sudo systemctl reload nginx
```
Then let certbot add TLS and the HTTP→HTTPS redirect. certbot edits this file on the proxy:
```bash
sudo certbot --nginx -d test.andreaslop.nl
```
- **Only copy the file once.** Copying it again overwrites certbot's HTTPS changes. If the repository version ever changes, copy it and run `certbot --nginx -d test.andreaslop.nl` again.
Do **not** add the security headers or `X-Robots-Tag` on the proxy too. The hosting Pi already sets them, and setting them twice makes browsers see duplicate headers.
5. Create a DNS record for the test hostname that points to your proxy.
The folder is empty until the first deploy. Run a deploy before testing.
### 1.3 Production (MijnHostingPartner)
1. In the control panel, create an FTP account for the website. Use its full username, prefix included, in `FTP_USERNAME`.
2. Check that TLS is available for FTP. If it isn't, open a ticket (per the hoster's knowledge base); the pipeline refuses plain FTP.
3. Set up the domain `andreaslop.nl` in the package, but **do not change the DNS yet** (D12).
### 1.4 Later: SSH key instead of a password (recommended)
Create a deploy key, put the public key in `~/.ssh/authorized_keys` on the Pi, and store the private key as the secret `PI_MAIN_SSH_KEY`. In the `deploy-test` job, replace `sshpass -e` with `ssh -i`. This is the same change as in your other projects.
### 1.5 Line endings (once, after pulling this change)
`.gitattributes` makes Git use LF. Refresh your working copy once:
```bash
git rm --cached -r -q . && git reset --hard
```
**Warning**: this throws away uncommitted changes. Commit or stash first.
## 2. Day to day
### Feature work
1. `git switch -c feature/<name>` from `master`, work, push.
2. Open a pull request. CI runs: lint, format, tests, build, audit and Lighthouse.
3. Want to see it on test before merging? Go to **Actions → Continuous Integration → Run workflow**, pick your branch, tick **Deploy to Test**.
4. Merge the PR. `master` is deployed to test automatically.
### Release to production
1. Cut a release branch from `master`: `git switch -c release/1.0 master`, then `git push -u origin release/1.0`.
2. Check it on test: run the workflow on `release/1.0` with **Deploy to Test**.
3. Deploy: run the workflow on `release/1.0` with **Deploy to Production**. The job only runs on `release/*` branches.
4. Afterwards, merge `release/1.0` back into `master` (PR) and tag the merge commit:
```bash
git switch master && git pull
git tag -a v1.0.0 -m "Release 1.0.0" && git push origin v1.0.0
```
5. A fix on a release goes to the release branch first, and is deployed and merged back the same way (tag `v1.0.1`).
### Go-live (once)
1. **Dress rehearsal on the production host.** This is the only place IIS and FTPS are tested; test runs nginx (see "Test vs Production" in the deployment plan).
- Run a production deploy.
- Without changing DNS, open the new host via a temporary `hosts` entry (`<A-record IP> andreaslop.nl`) or the hoster's preview URL.
- Check:
- the home page and a deep link (`/portfolio`)
- an unknown URL (the 404 page)
- the five security headers (`curl -sI`)
- that HTTP redirects to HTTPS
- Remove the `hosts` entry afterwards.
2. Switch the DNS of `andreaslop.nl` (and `www`) to the new host, and make sure HTTPS is active.
3. Set `HEALTH_CHECK_URL_PRODUCTION` so every deploy is checked from then on.
4. Verify the live headers: `curl -sI https://andreaslop.nl/` must show all five security headers.
## 3. If something fails
| Symptom | Likely cause | Fix |
|---|---|---|
| `Install Chromium` fails | Playwright cannot install its dependencies in the runner image | Look at the log for the missing package. As a fallback, run Lighthouse locally (`pnpm lighthouse`) and make the CI job optional; report it so we can fix it properly. |
| Lighthouse: "Chrome could not be started" | Sandbox | `LIGHTHOUSE_CHROME_FLAGS` must contain `--no-sandbox` (already set). |
| `Format` fails only in CI | Line endings | See 1.5. |
| `sshpass`: Permission denied | Wrong secret, or special characters | Secrets go via `env:` (already so); check the values. |
| `lftp`: certificate verification failed | Hostname does not match the hoster's certificate | Use the hostname from the control panel in `FTP_HOST`, not the IP. |
| Health check fails, page is 404 on deep links | SPA fallback missing | Production: `web.config` not uploaded or URL Rewrite off. Test: nginx config not active. |
@@ -0,0 +1,87 @@
# Deployment Plan — frontend-shell
Decisions: [deployment-setup-plan.md](../plans/deployment-setup-plan.md) ("Q"), [deployment-clarification-questions.md](../plans/deployment-clarification-questions.md) ("CQ").
## Overview
```mermaid
graph LR
Feature["feature/* branch"] -->|"pull request"| CI1["CI: check + Lighthouse"]
Feature -->|"manual, Deploy to Test"| Test["Test: Raspberry Pi nginx"]
CI1 -->|"merge"| Master["master"]
Master -->|"automatic"| Test
Master -->|"branch off"| Release["release/x.y"]
Release -->|"manual, Deploy to Production"| Prod["Production: IIS webhost via FTPS"]
Release -->|"merge back + tag vX.Y.Z"| Master
classDef branch fill:#f6e05e,stroke:#c05621,stroke-width:1px,color:#000;
classDef ci fill:#63b3ed,stroke:#2b6cb0,stroke-width:1px,color:#000;
classDef env fill:#9ae6b4,stroke:#2f855a,stroke-width:1px,color:#000;
class Feature,Master,Release branch;
class CI1 ci;
class Test,Prod env;
```
Text alternative: feature branches go through a pull request with CI into master; master deploys to test automatically and any branch can be deployed to test manually; release branches are cut from master, deployed to production manually, then merged back into master and tagged.
## Decisions
| # | Decision | Source |
|---|---|---|
| D1 | **CI**: Gitea Actions on the existing global runner `raspberry-pi-arm64` (labels `linux-arm64`, `ubuntu-latest`; Podman). | Q2 = A, Q3 = A, CQ5 |
| D2 | **Branching**: `master` + short-lived `feature/*` + `release/*`, no `develop` (trunk-based with release branches). Releases are merged back into `master` and tagged `vX.Y.Z` there. | CQ1 |
| D3 | **Environments**: test and production. | Q5 = B |
| D4 | **Test deploy**: automatically on every push to `master` (incl. a merged PR), and manually from any branch with "Deploy to Test", for example to try a branch before merging. | Q6 = B, CQ1 |
| D5 | **Production deploy**: manual only ("Deploy to Production"), and only from a `release/*` branch; the workflow refuses other branches. | Q6 = B, CQ1 |
| D6 | **Quality gate**: every run does lint, format, tests, build, audit and Lighthouse (mobile + desktop) before any deploy job can start. In CI, Lighthouse **Performance is report-only** (the Pi runner gives scores 30-40 points too low); accessibility, best practices and SEO block. Performance blocks in `pnpm check` on a PC. HTML reports are attached to every run as the `lighthouse-reports` artifact. | Q7 = A; Lighthouse CI question A |
| D7 | **Chrome for Lighthouse**: Playwright's Chromium (supports linux-arm64), installed in the job with a pinned Playwright version. Not the browser on the host: jobs run in containers and cannot see it. | CQ5 |
| D8 | **Test target**: Raspberry Pi with nginx behind the reverse-proxy Pi, **next to the current WordPress site**. Deploy over SSH (`sshpass` + `scp`, same secrets as your other projects). Simple: empty the test folder, then copy the new build in; no old versions are kept. The step refuses an empty path, `/`, or a folder containing WordPress (`wp-config.php` / `wp-content`). The nginx block has its own `server_name` and never `default_server`. | CQ4 = B; owner: simpler than other apps, must not conflict with WordPress |
| D9 | **Test is never indexed**: `X-Robots-Tag: noindex, nofollow` and a `robots.txt` that disallows everything. | Derived |
| D10 | **Production target**: MijnHostingPartner ASP.NET Core 10 package (Windows/IIS). Upload with `lftp` over FTP with TLS (forced) to `wwwroot`. Order: all files except `index.html`, then `index.html`, then delete stale files. | Q4, CQ3 = B |
| D11 | **Server config from one source**: generated with `pnpm server-config`, and a test fails if the files drift from the generator. <ul><li>`web/deploy/iis/web.config` (production) and `web/deploy/nginx/andreaslop-test.conf` (test hosting Pi) carry the headers from `config/securityHeaders.ts`.</li><li>`web/deploy/nginx/test.andreaslop.nl.proxy.conf` (reverse-proxy Pi) is HTTP only, sets no headers, and certbot adds HTTPS to it.</li></ul> | NFR-SEC-01/02 |
| D12 | **Go-live**: the production pipeline is ready, but the DNS of `andreaslop.nl` keeps pointing to the current host until the pages have content. Deploying to the new host does not affect the live site until the DNS switch. | CQ2 = A |
| D13 | **Rollback**: redeploy a previous version through the pipeline, the same way on test and production. See [rollback-plan.md](rollback-plan.md). | Q8 = B |
| D14 | **Line endings**: `.gitattributes` with `eol=lf`, so the runner and every machine see the same files and Prettier passes. | Derived |
| D15 | **Versions pinned**: Node 24 in CI; pnpm via `packageManager` (`pnpm@12.11.2`, also pinned in the lockfile); Playwright 1.55.0. | SECURITY-10 |
## Test vs Production
A subdomain counts as an extra website in the hosting package (only one is included), so test stays on the Raspberry Pi. The goal of test is that **the site can be tested**. Deployment may differ because the environments differ. The rule:
- Nothing happens on test that cannot happen on production, unless it is listed here.
- For every difference it is stated whether it is automatic or manual.
### Identical on both
- **Build**: one artifact per run, deployed unchanged to both environments.
- **Security headers and SPA fallback**: generated from the same source (`config/securityHeaders.ts`) into the nginx and IIS config; a test fails if they drift.
- **Unknown URLs**: return the app (HTTP 200), which shows the 404 page.
- **Quality gate**: lint, format, tests, build, audit and Lighthouse before every deploy.
- **Caching**: `index.html` is never cached; files in `/assets` (hashed names) are cached for a year.
### Differences
| Aspect | Test (Raspberry Pi, nginx) | Production (webhost, IIS) | Automatic / manual |
|---|---|---|---|
| Deploy trigger | Automatic on push to `master`; manual from any branch | Manual only, from `release/*` | By design |
| Transport | SSH/scp | FTP with TLS (`lftp`) | Both automatic in the pipeline |
| Upload method | Empty the test folder, then copy the build (a few seconds offline; fine for test) | Upload over the existing files: first all files except `index.html`, then `index.html`, then delete stale files (no offline moment) | Both automatic |
| Rollback | Redeploy a previous version through the pipeline (manual start) | Same: redeploy a previous version through the pipeline (manual start) | Identical route; see [rollback-plan.md](rollback-plan.md) |
| Neighbours on the server | The current WordPress site (andreaslop.nl) runs on the same Pi; the test site has its own folder and nginx block | The hosting package has only this site | Guard in the deploy step (automatic); nginx block installed by hand once |
| Server config | `deploy/nginx/andreaslop-test.conf` on the hosting Pi and `deploy/nginx/test.andreaslop.nl.proxy.conf` on the proxy Pi (then certbot), each installed **once by hand** | `deploy/iis/web.config`, uploaded **automatically** with every deploy | Re-install the nginx config by hand after `pnpm server-config` changes it |
| Indexing | `noindex` header + `robots.txt` that blocks everything (test only) | Normal: `robots.txt` and `sitemap.xml` from the build | Automatic |
| HTTPS | Terminated on the reverse-proxy Pi; redirect is the proxy's job | `web.config` redirects HTTP to HTTPS; certificate from the hoster | Test: proxy config, manual |
| Compression | nginx gzip settings of the Pi | Whatever IIS at the hoster does | Not managed by this project; may make Lighthouse scores differ slightly |
| Post-deploy check | `HEALTH_CHECK_URL_TEST` | `HEALTH_CHECK_URL_PRODUCTION` (set after go-live) | Automatic once the variable is set |
### Covering the IIS-specific risk
Only production runs IIS and FTPS. A mistake in `web.config` or in the upload would therefore first show up there. Until go-live the DNS still points to the old host, so production can serve as a **dress rehearsal**: deploy, then test the new host before switching DNS (deployment-instructions.md, Go-live step 1). After go-live, every release follows the same route, and the post-deploy check verifies reachability and headers.
## Later: when the .NET API arrives
- The hosting package has one website. The API (from its own project) will then serve this site as static files. That replaces `web.config`: the API sets the same headers (from the same list) and the SPA fallback in ASP.NET Core.
- **Database migrations**: run them in the pipeline before the new API goes live. Keep them backward compatible (expand/contract) and fix problems by rolling forward. Take a backup before each production migration. See the rollback plan.
## Not verified yet (needs the first real runs)
These depend on the runner and the hoster and could not be tested from this machine:
1. Playwright's Chromium installs and starts in the runner container (`linux-arm64`).
2. `lftp` with forced TLS is accepted by the hoster's certificate. If the certificate does not match the hostname, the fix is to connect with the hostname from the hoster's control panel, not to turn verification off.
3. The SSH user on the Pi may write to and empty `DEPLOY_PATH_TEST`.
@@ -0,0 +1,31 @@
# Rollback Plan — frontend-shell
Principle (Q8 = B): roll back by **deploying a previous version through the pipeline**. The site is static: there is no state or database to undo.
## Test environment
Old versions are not kept on test (keeping it simple). To go back, run the workflow on the branch, commit or tag you want, with **Deploy to Test**. This is the same route as production, so a rollback on test is also a rehearsal for production.
## Production
1. **Choose the version.** That is the previous tag (for example `v1.0.0`) or the release branch from before the faulty change.
2. **Deploy it.** If the release branch still exists at that version, run the workflow on it with **Deploy to Production**. Otherwise create a branch from the tag first:
```bash
git switch -c release/1.0-rollback v1.0.0 && git push -u origin release/1.0-rollback
```
Then deploy that branch. Production deploys are only allowed from `release/*`, which is why the branch is needed.
3. **Check the result.** The pipeline's post-deploy check verifies reachability and the CSP header. Also open a deep link (for example `/portfolio`) and the home page.
4. **Fix forward.** Fix the problem on the release branch and deploy again as a new patch version.
**Emergency (pipeline unavailable):** run `pnpm build` locally from the tag, copy `web/deploy/iis/web.config` into `dist/`, and upload `dist/` with FileZilla to `wwwroot`. Use "FTP over explicit TLS", and upload `index.html` last.
## Before go-live
As long as the DNS points to the current host (D12), a broken production deploy affects no visitors. Fix it and deploy again.
## Later: with the .NET API and a database
- **Code**: roll back the same way, by deploying the previous version.
- **Database**: do **not** roll back with "down" migrations, because they can destroy data. Instead:
- Make migrations backward compatible (expand/contract), so the previous API version still works on the new schema.
- Back up the database (or export it; the package allows 50 MB) before every production migration. The pipeline can do this as a step.
- Fix errors in data or schema with a new migration (roll forward).
- **Restore from backup** only as a last resort, when data was damaged.
@@ -0,0 +1,89 @@
# Deployment Clarification Questions — frontend-shell
Je antwoorden in [deployment-setup-plan.md](deployment-setup-plan.md) brengen een paar keuzes boven die ik niet zelf kan maken. Vul per vraag de letter in na `[Answer]:`.
Wat ik van de hoster weet ([pakketpagina](https://www.mijnhostingpartner.nl/pg/info/aspnet-core-hosting/)): Windows-hosting met **URL Rewrite**, dus IIS. Security headers en de SPA-fallback gaan daar via een `web.config` naast `index.html`. Over FTP/SFTP/SSH staat niets op de pagina.
---
## Vraag 1: Branchstrategie
Je vroeg om advies over gitflow tegenover trunk-based.
**Gitflow**: `develop` voor lopend werk, `release/x.y`-branches voor een release, en daarna terugmergen naar `develop` én `master`, met een tag. Bedacht voor teams die meerdere versies tegelijk onderhouden of op vaste momenten releasen. Voor één ontwikkelaar levert het vooral extra merges op, en kans op merge-conflicten tussen `develop` en `master`.
**Trunk-based (lichte variant)**: `master` is altijd releasebaar. Werk gebeurt in korte feature-branches die via een pull request naar `master` gaan, zoals je nu al doet. Een release is een **tag** op `master` (bv. `v1.2.0`).
Mijn advies voor jouw situatie (één ontwikkelaar, een test- en een productieomgeving) is **trunk-based met release-tags**. Het past bij hoe je nu werkt, en alles wat je met gitflow wilde blijft mogelijk:
| Jouw wens | Trunk-based met tags |
| --------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- |
| Altijd en snel naar test, ook een specifieke versie | Handmatige "Deploy naar test" in Gitea met keuze van branch, commit of tag. Daarnaast automatisch bij elke merge naar `master`. |
| Productie alleen vanuit een release | Productie alleen vanaf een tag `v*`, handmatig gestart in Gitea |
| Een vaste versie kunnen terugzetten | Elke tag is een vaste versie; terugzetten is die tag opnieuw deployen |
A) Trunk-based met release-tags **(aanbevolen)**
B) Gitflow zoals je beschreef: `develop`, `release/*`, `master` met tags. Productie alleen vanaf `release/*`.
X) Anders (beschrijf hieronder na de [Answer]:-tag)
[Answer]: x, ik wil een mix welke volgens mij nog steeds dichter bij trunk-based ligt. Ik wil release en feature branches om het werk nog wel geisoleerd te houden. Mocht het helemaal kapot gaan kan je de branch weggooien en zo kan ik nog steeds PR's gebruiken als jij dingen oppakt. Dan kan ik makkelijker de PR checken voor de veranderingen en bij mergen van de PR kan een test-release gedaan worden. Maar ik wil dan de develop branch er tussenuit halen. Ik ben volgens mij vergeten aan te geven dat na het succesvol mergen van een PR een workflow moet worden gestart met een deploy naar test als automatische deploy. Een deploy naar test moet ook handmatig kunnen om op test te kunnen deployen om iets te testen voordat de PR wordt gemerged.
## Vraag 2: Wanneer gaat de nieuwe site live?
De eerste deployment naar productie vervangt wat er nu op `andreaslop.nl` staat. De nieuwe site heeft nog alleen placeholderpagina's ("in de maak").
A) De productie-pipeline nu bouwen en testen, maar de eerste echte productie-deployment pas starten als de pagina's inhoud hebben. Tot die tijd alleen de testomgeving. **(aanbevolen)** Door de handmatige start kan het niet per ongeluk gebeuren.
B) Zodra de pipeline werkt live gaan, ook met placeholders
C) De huidige site staat ergens anders; productie op deze hoster is nog leeg
X) Anders (beschrijf hieronder na de [Answer]:-tag)
[Answer]: A, mogelijk kan het eerder worden gedeployed, maar dat kan ook handmatig gestart worden. De huidige site staat op een andere host dus als ik de DNS daar nog naar toe verwijs zou het geen impact moeten hebben.
## Vraag 3: Hoe komen de bestanden bij de productiehoster?
Kijk in het hostingpaneel welke toegang je hebt.
A) SFTP **(aanbevolen als beschikbaar)** Versleuteld en eenvoudig vanuit de pipeline.
B) Alleen FTP met TLS (FTPS)
C) Alleen gewone FTP (onversleuteld). Werkt, maar dan gaat het wachtwoord onversleuteld over het internet; liever niet.
D) Web Deploy (msdeploy), als de hoster dat aanbiedt
X) Anders (beschrijf hieronder na de [Answer]:-tag)
[Answer]: B, Meer info op: https://www.mijnhostingpartner.nl/client/knowledgebase/ftp/ftp-verbinding-opzetten/
## Vraag 4: Wat draait er op je testserver?
De testomgeving moet zich zoveel mogelijk als productie gedragen (headers, SPA-fallback).
A) Windows met IIS, net als productie. Dan gebruik ik dezelfde `web.config` en dezelfde deploymethode.
B) Linux met een webserver (nginx, Apache of Caddy), bereikbaar via SSH. Dan stel ik een gelijkwaardige config op, en deploy ik via SSH/rsync.
C) Linux, maar alleen via SFTP bereikbaar
X) Anders (beschrijf hieronder na de [Answer]:-tag)
[Answer]: B, maar dan een raspberry pi server met Nginx die weer achter een andere Raspberry pi zit die als reverse proxy is ingesteld.
## Vraag 5: Chrome voor Lighthouse in de pipeline
Je runner draait de jobs waarschijnlijk in **Docker-containers**; dat is de standaard bij `act_runner`. Een Chrome die op de server zelf staat, is dan in de container niet zichtbaar.
A) De pipeline installeert zelf Chromium in de job (één regel, vaste versie uit de Debian-repository). Werkt ongeacht wat er op de server staat. **(aanbevolen)**
B) De runner draait jobs direct op de server (host-modus), en dan gebruik ik de Chrome die daar staat
C) Weet ik niet. Ik zoek de runner-labels op in Gitea (Site Administration of Settings → Actions → Runners) en vul ze hieronder in.
X) Anders (beschrijf hieronder na de [Answer]:-tag)
[Answer]: Ik denk B, De runner is `raspberry-pi-arm64` met versie v2.1.0, is een Global runner met de labels linux-arm64 en ubuntu-latest. Kijk in `K:\Development\SlpSoftware\Projects\SlpSoftware` en `K:\Development\Projects\SlpModularCms` hoe het dara gedaan is. Dat draait er nu ook, maar bedenk dat die wel volledig op de eigen server draaien dus nmiet alles klakkeloos overnemen.
---
## Ter info: databasemigraties en terugdraaien (je vraag bij Vraag 8)
Dit speelt pas als de API er is, maar het antwoord bepaalt nu al de aanpak:
- **Migraties via de pipeline kunnen.** Met Entity Framework Core maak je bij het bouwen een migratiescript of "migration bundle". De pipeline voert dat uit vóór de nieuwe API live gaat.
- **Databasemigraties terugdraaien is riskant.** Een "down"-migratie kan data weggooien, bijvoorbeeld bij een verwijderde kolom. Gangbaar is daarom:
- **Achterwaarts compatibele migraties** (expand/contract). Een kolom hernoemen gaat in twee releases: eerst de nieuwe kolom erbij, en pas later de oude weg. De vorige versie van de API werkt dan nog met de nieuwe database.
- **Terugdraaien** = de vorige versie van de code deployen, met de database zoals die is (jouw keuze B).
- **Echte fouten in data of schema** los je op met een nieuwe migratie vooruit ("roll forward"), niet door terug te draaien.
- **Kleine database (50 MB)**: maak vóór elke productiemigratie een back-up of export; de pipeline kan dat aanroepen.
Dit neem ik op in het rollback-plan als richtlijn voor de API-feature. Voor de huidige statische site is terugdraaien simpelweg de vorige tag opnieuw deployen.
@@ -0,0 +1,108 @@
# Deployment Setup Plan — frontend-shell
## Context
- **Code**: `web/` (static SPA). `pnpm build` produces `dist/`. `pnpm check` runs lint, format, tests, build, audit and Lighthouse.
- **Git hosting**: self-hosted Gitea at `gitea.slpsoftware.nl`. There is no CI configuration yet (`.gitea/workflows` and `.github` do not exist).
- **Back-end**: `api/` exists but is empty; the .NET API comes later.
- **Carried-forward requirements**:
- `pnpm check` runs on every push (NFR follow-up 1).
- The production host sends the security headers (NFR-SEC-01/02).
- The SPA fallback: every unknown path serves `index.html`, so deep links like `/portfolio` work.
## Plan
- [x] 1. Answer the questions below
- [x] 2. Analyze answers (follow-up questions if needed)
- [x] 3. Generate `operations/deployment/deployment-plan.md`
- [x] 4. Generate the pipeline definition(s) in the repository, plus `operations/deployment/deployment-instructions.md`
- [x] 5. Generate `operations/deployment/rollback-plan.md`
- [x] 6. Fix line endings (see below) and verify the pipeline steps locally
## Already decided (no question needed)
- **Line endings**: a `.gitattributes` with `* text=auto eol=lf` (binary files excepted).
- Today Git converts files to Windows line endings (CRLF) on checkout, while Prettier requires LF. A fresh checkout on Windows can therefore fail `pnpm check`, and the CI runner and your machine would see different files.
- Your editor keeps working as before; files are simply stored and checked out with LF everywhere.
- **Pipeline order**: install with the lockfile, then `pnpm check`. Deployment only happens when that passes.
- **Secrets**: deployment credentials go in Gitea's encrypted Actions secrets, never in the repository.
---
## Questions
Vul per vraag de letter in na `[Answer]:`. Past geen enkele optie, kies dan de laatste (Anders) en licht toe. Waar ik een voorkeur heb staat **(aanbevolen)**.
### Vraag 1: Deployment opzetten voor deze feature?
A) Ja, help me deployment op te zetten
B) Nee, deployment gebeurt elders of is niet nodig
C) Weet ik niet, stel een aanpak voor en ik beslis
X) Anders (beschrijf hieronder na de [Answer]:-tag)
[Answer]: A
### Vraag 2: Welk CI-systeem?
Gitea heeft een ingebouwd CI-systeem, **Gitea Actions**, met dezelfde workflow-syntax als GitHub Actions. Het heeft wel een **runner** nodig: een klein programma (`act_runner`) op een server, dat de jobs uitvoert.
A) Gitea Actions **(aanbevolen)** Zit in je Gitea, geen extra dienst, en de workflows zijn later eenvoudig naar GitHub over te zetten.
B) Een aparte CI-dienst (bv. Woodpecker, Jenkins)
X) Anders (beschrijf hieronder na de [Answer]:-tag)
[Answer]: A
### Vraag 3: Is er al een runner voor Gitea Actions?
A) Ja, er draait al een runner die ik voor dit project kan gebruiken
B) Nee. Neem in de instructies op hoe ik er een opzet (met Docker op een eigen server of pc) **(aanbevolen als er nog geen is)**
C) Weet ik niet, ik controleer het
X) Anders (beschrijf hieronder na de [Answer]:-tag)
[Answer]: A
### Vraag 4: Waar wordt de website gehost?
A) Op een eigen server (bv. dezelfde als Gitea), met een webserver zoals Caddy of nginx. De pipeline zet de bestanden er via SSH/rsync neer. Volledige controle over security headers en de SPA-fallback. **(aanbevolen als je een eigen server hebt)**
B) Bij een webhoster met FTP/SFTP-toegang, bijvoorbeeld waar de huidige statische site staat. Headers en fallback dan via `.htaccess` (Apache), als de hoster dat toestaat.
C) Een static-hostingdienst (bv. Cloudflare Pages, Netlify, of een Europese variant). Weinig beheer, headers via een configbestand.
D) Nog niet bekend: zet nu alleen de CI op (bouwen en testen bij elke push) en de deployment later
X) Anders (beschrijf hieronder na de [Answer]:-tag)
[Answer]: X, voor productie wordt dat een webhoster met ftp/sftp toegang. Voor de testomgeving heb ik een eigen server, maar heb ik eventueel ook toegang met ftp/sftp. Ik heb alleen maar 1 website die ik kan hosten dus zodra ik de API ga bouwen die uit een ander project gaat komen moet de website als static files worden geserveerd door de API. Dit is een pagina met meer info over de webhost: https://www.mijnhostingpartner.nl/pg/info/aspnet-core-hosting/ en het gaat dan om het ASP.NET Core 10 Hosting pakket
### Vraag 5: Welke omgevingen?
A) Alleen productie
B) Test/staging (bv. `test.andreaslop.nl`) en productie. Je ziet een wijziging eerst op test voordat hij live gaat. **(aanbevolen)**
C) Ook een preview per pull request
X) Anders (beschrijf hieronder na de [Answer]:-tag)
[Answer]: B
### Vraag 6: Wanneer wordt er gedeployd?
A) Automatisch: elke merge naar `master` gaat live (en, bij een testomgeving, elke push naar een feature-branch naar test)
B) Automatisch naar test; naar productie pas na een handmatige goedkeuring of start in Gitea **(aanbevolen)**
C) Altijd handmatig starten
X) Anders (beschrijf hieronder na de [Answer]:-tag)
[Answer]: B, ik wil de gitflow gaan toepassen. Naar test moet altijd kunnen. Zodat er makkelijk en snel een specifieke versie op de test-omgeving gedeployed of geredeployed kan worden. Naar productie mag alleen vanaf een release-branch. DIe branch wordt daarna teruggemerged naar develop en master en op master wordt dan een tag gezet. Ik heb ook van trunk-based gehoord. het zou kunnen dat dat praktischer is. Ik laat mij graag aanbevelen wat handiger is voor mij.
### Vraag 7: Lighthouse in de pipeline
`pnpm check` draait ook Lighthouse, en daarvoor moet er Chrome in de runner zitten. Dat maakt de pipeline een paar minuten langer.
A) Ja, de volledige `pnpm check`, inclusief Lighthouse, in de pipeline. De runner gebruikt een image met Chrome. **(aanbevolen)** Dit was jouw wens: een vergeten lokale check wordt dan alsnog opgevangen.
B) In de pipeline alles behalve Lighthouse; Lighthouse alleen lokaal
X) Anders (beschrijf hieronder na de [Answer]:-tag)
[Answer]: ik heb een headless browser op de gitea/buildserver staan. Als het goed is is dat chrome, maar niet meer helemaal zeker.
### Vraag 8: Terugdraaien bij een mislukte release
A) De server bewaart de laatste paar releases. Terugdraaien is één commando of één klik in Gitea, die terugwisselt naar de vorige release. **(aanbevolen bij een eigen server)**
B) Terugdraaien door de vorige commit opnieuw door de pipeline te laten deployen
X) Anders (beschrijf hieronder na de [Answer]:-tag)
[Answer]: B als dat kan en ook gezien de database. Ik weet niet of er via de pipeline een migratie kan worden gedaan en ook terug worden gedraaid zodra we een API hebben?
@@ -0,0 +1,14 @@
# Lighthouse in CI — vraag
## Situatie (run 529)
- Lighthouse draait nu op alle 7 pagina's op de runner. **Toegankelijkheid, Best Practices en SEO halen hun doelen** (100).
- **Performance faalt overal**: 0,49–0,66 op de Raspberry Pi, tegen 0,82–0,95 op een pc. Het is dezelfde build.
- **Oorzaak**: Lighthouse simuleert een middelmatige telefoon door de CPU **4× te vertragen ten opzichte van de meetmachine**, en gaat ervan uit dat die meetmachine een snelle desktop is (pc: benchmarkIndex ≈ 4200). Een Pi is zelf al veel trager, en daar komt die 4× bovenop. Lighthouse waarschuwt zelf dat performance op zwakke hardware niet representatief is.
## Vraag 1: Wat doet Performance in de pipeline?
A) In CI **Performance alleen melden** (waarschuwing in de log, met de rapporten als download bij de run). Toegankelijkheid, Best Practices en SEO blijven **blokkerend**. De blokkerende Performance-controle blijft in `pnpm check` op je pc, waar de meting wel klopt. **(aanbevolen)** De CI blijft betrouwbaar en vangt toegankelijkheid en SEO toch op.
B) Performance in CI blijft blokkerend, maar de CPU-vertraging wordt aangepast aan de snelheid van de Pi (minder dan 4×), zodat de meting dichter bij een pc komt. Nauwkeuriger te maken, maar de juiste vertraging moet ik met een paar runs afstemmen, en een Pi onder wisselende belasting (andere builds) geeft wisselende scores. Kans op af en toe een onterecht rode pipeline.
C) Lighthouse helemaal uit de pipeline, alleen lokaal in `pnpm check`
X) Anders (beschrijf hieronder na de [Answer]:-tag)
[Answer]: A
+12
View File
@@ -0,0 +1,12 @@
## Taalvoorkeur
Alle documentatie (requirements, ontwerpen, plannen, codecommentaar in de AIDLC-documenten, enz.) wordt standaard in het **Engels** geschreven. Vragen, prompts en antwoorden in de chat zijn in jouw taal (Nederlands).
Wil je dit aanpassen?
A) Engels voor documentatie, Nederlands voor de chat (standaard)
B) Engels voor alles (documentatie en chat)
C) Nederlands voor alles (documentatie en chat)
X) Anders (beschrijf hieronder na de [Answer]:-tag)
[Answer]: A
+5
View File
@@ -22,3 +22,8 @@ dist-ssr
*.njsproj
*.sln
*.sw?
# Testdekking en Lighthouse CI
coverage
.lighthouseci
lighthouse-reports
+11 -1
View File
@@ -1,3 +1,13 @@
**/.ai
**/routeTree.gen.ts
**/routeTree.gen.ts
.lighthouseci
lighthouse-reports
coverage
dist
pnpm-lock.yaml
.agents
.claude
.junie
.tanstack
skills-lock.json
+35
View File
@@ -0,0 +1,35 @@
import { describe, expect, it } from 'vitest';
import { contentSecurityPolicy, securityHeaders } from './securityHeaders';
const directive = (csp: string, name: string) =>
csp.split('; ').find((d) => d.startsWith(name + ' ')) ?? '';
describe('securityHeaders', () => {
it('productie-CSP heeft geen onveilige uitzonderingen voor scripts', () => {
const csp = contentSecurityPolicy('production');
expect(csp).not.toContain('unsafe-eval');
expect(directive(csp, 'script-src')).toBe("script-src 'self'");
expect(csp).not.toContain('ws:');
expect(directive(csp, 'frame-ancestors')).toBe(
"frame-ancestors 'none'",
);
});
it('dev-CSP voegt alleen toe wat Vite nodig heeft', () => {
const csp = contentSecurityPolicy('development');
expect(directive(csp, 'script-src')).toBe(
"script-src 'self' 'unsafe-inline'",
);
expect(directive(csp, 'connect-src')).toBe("connect-src 'self' ws:");
expect(csp).not.toContain('unsafe-eval');
});
it('zet alle verplichte headers', () => {
expect(securityHeaders('production')).toMatchObject({
'Strict-Transport-Security': 'max-age=31536000; includeSubDomains',
'X-Content-Type-Options': 'nosniff',
'X-Frame-Options': 'DENY',
'Referrer-Policy': 'strict-origin-when-cross-origin',
});
});
});
+49
View File
@@ -0,0 +1,49 @@
// HTTP-securityheaders voor de Vite dev- en preview-server. De productieset is
// ook het voorschrift voor de toekomstige host (zie NFR-SEC-01/02).
type Mode = 'production' | 'development';
// Chakra/Emotion zetten tijdens runtime <style>-tags in de pagina, daarom
// staat style-src 'unsafe-inline' toe. Scripts komen alleen van de eigen site.
const productionCsp: Record<string, string[]> = {
'default-src': ["'self'"],
'script-src': ["'self'"],
'style-src': ["'self'", "'unsafe-inline'"],
'img-src': ["'self'", 'data:'],
'font-src': ["'self'"],
'connect-src': ["'self'"],
'object-src': ["'none'"],
'base-uri': ["'self'"],
'form-action': ["'self'"],
'frame-ancestors': ["'none'"],
};
// Alleen wat de Vite dev-server zelf nodig heeft: een inline script voor
// React Refresh en een websocket voor hot reload.
const developmentExtras: Record<string, string[]> = {
'script-src': ["'unsafe-inline'"],
'connect-src': ['ws:'],
};
export function contentSecurityPolicy(mode: Mode): string {
return Object.entries(productionCsp)
.map(([directive, sources]) => {
const extra =
mode === 'development'
? (developmentExtras[directive] ?? [])
: [];
return [directive, ...sources, ...extra].join(' ');
})
.join('; ');
}
export function securityHeaders(mode: Mode): Record<string, string> {
return {
'Content-Security-Policy': contentSecurityPolicy(mode),
// Browsers negeren HSTS over http://localhost; telt pas op de echte host
'Strict-Transport-Security': 'max-age=31536000; includeSubDomains',
'X-Content-Type-Options': 'nosniff',
'X-Frame-Options': 'DENY',
'Referrer-Policy': 'strict-origin-when-cross-origin',
};
}
+76
View File
@@ -0,0 +1,76 @@
import { readFileSync } from 'node:fs';
import { describe, expect, it } from 'vitest';
import { securityHeaders } from './securityHeaders';
import {
iisWebConfig,
nginxProxyConf,
nginxTestConf,
serverConfigFiles,
} from './serverConfig';
describe('serverconfiguratie', () => {
it.each(Object.entries(serverConfigFiles))(
'%s is gelijk aan de generator (draai anders pnpm server-config)',
(path, generate) => {
expect(readFileSync(path, 'utf8')).toBe(generate());
},
);
it('IIS en nginx zetten elke productieheader', () => {
const iis = iisWebConfig();
const nginx = nginxTestConf();
for (const [name, value] of Object.entries(
securityHeaders('production'),
)) {
expect(iis).toContain(
`<add name="${name}" value="${value.replace(/&/g, '&amp;')}" />`,
);
expect(nginx).toContain(`add_header ${name} "${value}" always;`);
}
});
it('IIS heeft een SPA-fallback en een HTTPS-redirect', () => {
const iis = iisWebConfig();
expect(iis).toContain('<action type="Rewrite" url="/index.html" />');
expect(iis).toContain('<add input="{HTTPS}" pattern="^OFF$" />');
});
it('de testsite wordt nooit geindexeerd', () => {
const nginx = nginxTestConf();
expect(nginx).toContain('X-Robots-Tag "noindex, nofollow"');
expect(nginx).toContain('Disallow: /');
expect(nginx).toContain('try_files $uri $uri/ /index.html =404;');
});
it('het testblok claimt nooit de standaardserver (WordPress op dezelfde Pi)', () => {
expect(nginxTestConf()).not.toMatch(/listen[^;]*default_server/);
});
it('houdt doorverwijzingen relatief achter de reverse proxy', () => {
expect(nginxTestConf()).toContain('absolute_redirect off;');
});
it('de proxy geeft de Host-header door en zet zelf geen security headers', () => {
const proxy = nginxProxyConf();
expect(proxy).toContain('proxy_set_header Host $host;');
expect(proxy).toContain('server_name test.andreaslop.nl;');
expect(proxy).not.toContain('add_header');
});
it('proxy en testblok gebruiken dezelfde hostname', () => {
// Alleen echte config-regels, geen commentaar
const name = /^\s*server_name ([^;]+);/m;
const proxyHost = nginxProxyConf().match(name)?.[1];
expect(proxyHost).toBe('test.andreaslop.nl');
expect(nginxTestConf().match(name)?.[1]).toBe(proxyHost);
});
it('elk nginx location-blok herhaalt de security headers', () => {
// nginx erft add_header niet als een location er zelf een zet
const blocks = nginxTestConf().split('location ').slice(1);
expect(blocks).toHaveLength(3);
for (const block of blocks) {
expect(block).toContain('Content-Security-Policy');
}
});
});
+163
View File
@@ -0,0 +1,163 @@
// Genereert de webserverconfiguratie voor test (nginx op de Raspberry Pi) en
// productie (IIS bij de webhoster) uit dezelfde securityheaders als de Vite
// dev- en preview-server. Zo bestaat de headerset maar op één plek.
// Schrijven: `pnpm server-config`. Een test controleert dat de bestanden in
// deploy/ gelijk zijn aan wat deze functies opleveren.
import { securityHeaders } from './securityHeaders.ts';
const generatedNotice =
'Gegenereerd door web/config/serverConfig.ts (pnpm server-config). Niet handmatig aanpassen.';
const xmlAttribute = (value: string) =>
value
.replace(/&/g, '&amp;')
.replace(/"/g, '&quot;')
.replace(/</g, '&lt;')
.replace(/>/g, '&gt;');
// IIS (productie): security headers, HTTPS-redirect, SPA-fallback en caching.
// Bestanden in /assets hebben een hash in de naam en mogen lang gecachet
// worden; index.html nooit, zodat een nieuwe release direct zichtbaar is.
export function iisWebConfig(): string {
const headers = Object.entries(securityHeaders('production'))
.map(
([name, value]) =>
` <add name="${name}" value="${xmlAttribute(value)}" />`,
)
.join('\n');
return `<?xml version="1.0" encoding="utf-8"?>
<!-- ${generatedNotice} -->
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="HTTPS" stopProcessing="true">
<match url="(.*)" />
<conditions>
<add input="{HTTPS}" pattern="^OFF$" />
</conditions>
<action type="Redirect" url="https://{HTTP_HOST}/{R:1}" redirectType="Permanent" />
</rule>
<rule name="SPA fallback" stopProcessing="true">
<match url=".*" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
<action type="Rewrite" url="/index.html" />
</rule>
</rules>
</rewrite>
<httpProtocol>
<customHeaders>
<remove name="X-Powered-By" />
${headers}
</customHeaders>
</httpProtocol>
<staticContent>
<remove fileExtension=".woff2" />
<mimeMap fileExtension=".woff2" mimeType="font/woff2" />
<clientCache cacheControlMode="DisableCache" />
</staticContent>
</system.webServer>
<location path="assets">
<system.webServer>
<staticContent>
<clientCache cacheControlMode="UseMaxAge" cacheControlMaxAge="365.00:00:00" />
</staticContent>
</system.webServer>
</location>
</configuration>
`;
}
// nginx (test): dezelfde headers, plus noindex zodat de testsite nooit in
// zoekmachines komt. nginx erft add_header niet als een location er zelf een
// zet, daarom staan de headers in elk location-blok.
export function nginxTestConf(): string {
const headers = [
...Object.entries(securityHeaders('production')).map(
([name, value]) => `add_header ${name} "${value}" always;`,
),
'add_header X-Robots-Tag "noindex, nofollow" always;',
];
const block = (indent: string, extra: string[] = []) =>
[...headers, ...extra].map((line) => indent + line).join('\n');
return `# ${generatedNotice}
# Test-omgeving op de Raspberry Pi, achter de reverse-proxy-Pi (die TLS afhandelt
# met certbot). De proxy moet de Host-header doorgeven (proxy_set_header Host
# $host), anders kiest nginx hier het standaardblok (WordPress).
# Eigen server-blok naast de WordPress-site: bewust geen default_server, zodat
# dit blok alleen de testhostname beantwoordt.
# Pas server_name en root aan aan de server; de rest komt uit de generator.
server {
listen 80;
server_name test.andreaslop.nl;
root /var/www/html/andreaslop-test;
index index.html;
# Achter de reverse proxy: doorverwijzingen relatief houden, anders stuurt
# nginx naar zijn eigen http://-adres in plaats van de https-hostname
absolute_redirect off;
${block(' ', ['add_header Cache-Control "no-cache" always;'])}
# Testsite nooit indexeren
location = /robots.txt {
${block(' ')}
default_type text/plain;
return 200 "User-agent: *\\nDisallow: /\\n";
}
# Bestanden met een hash in de naam: lang cachen
location /assets/ {
${block(' ', ['add_header Cache-Control "public, max-age=31536000, immutable" always;'])}
try_files $uri =404;
}
# SPA-fallback: onbekende paden krijgen index.html (de router toont de 404).
# =404 aan het eind: zonder index.html (lege map) een 404 in plaats van een
# doorverwijzingslus die nginx als 500 afbreekt
location / {
${block(' ', ['add_header Cache-Control "no-cache" always;'])}
try_files $uri $uri/ /index.html =404;
}
}
`;
}
// nginx op de reverse-proxy-Pi (test): alleen HTTP. certbot voegt daarna
// HTTPS en de redirect toe (certbot --nginx -d test.andreaslop.nl). Geen
// security headers hier: die zet de hosting-Pi al, dubbel geeft dubbele headers.
// Intern adres van de hosting-Pi (waar het testblok en WordPress draaien)
const hostingPiAddress = '192.168.1.103';
export function nginxProxyConf(): string {
return `# ${generatedNotice}
# Reverse proxy voor de testsite naar de hosting-Pi. certbot past dit bestand
# aan voor HTTPS; kopieer het daarna dus niet opnieuw zonder certbot opnieuw te
# draaien.
server {
listen 80;
server_name test.andreaslop.nl;
location / {
proxy_pass http://${hostingPiAddress};
# Verplicht: de hosting-Pi kiest op basis van de hostname tussen het
# testblok en WordPress
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
}
}
`;
}
export const serverConfigFiles = {
'deploy/iis/web.config': iisWebConfig,
'deploy/nginx/andreaslop-test.conf': nginxTestConf,
'deploy/nginx/test.andreaslop.nl.proxy.conf': nginxProxyConf,
} as const;
+20
View File
@@ -0,0 +1,20 @@
import type { Plugin } from 'vite';
import { siteUrl } from '../src/seo.ts';
import sitePages, { pageList } from '../src/sitePages.ts';
import { sitemapXml } from '../src/sitemap.ts';
// Maakt bij elke build dist/sitemap.xml uit het pagina-register. Route-heads
// lezen hetzelfde register, dus sitemap en noindex lopen nooit uit elkaar.
export default function sitemapPlugin(): Plugin {
return {
name: 'slp-sitemap',
apply: 'build',
generateBundle() {
this.emitFile({
type: 'asset',
fileName: 'sitemap.xml',
source: sitemapXml(pageList(sitePages), siteUrl),
});
},
};
}
+20
View File
@@ -0,0 +1,20 @@
import type { TestProject } from 'vitest/node';
// Kiest één seed voor alle property-tests van een run en logt die altijd,
// ook als alles slaagt (PBT-08). Opnieuw afspelen: FC_SEED=<seed> pnpm test
export default function setup(project: TestProject) {
const env = (
globalThis as { process?: { env: Record<string, string | undefined> } }
).process?.env;
const seed = Number(env?.FC_SEED ?? Math.floor(Math.random() * 2 ** 31));
console.log(
`\nfast-check seed: ${seed} (opnieuw: FC_SEED=${seed} pnpm test)\n`,
);
project.provide('fcSeed', seed);
}
declare module 'vitest' {
export interface ProvidedContext {
fcSeed: number;
}
}
+11
View File
@@ -0,0 +1,11 @@
// Schrijft de webserverconfiguratie naar deploy/ (pnpm server-config).
// Draait direct met Node (type stripping), zonder extra tooling.
import { mkdirSync, writeFileSync } from 'node:fs';
import { dirname } from 'node:path';
import { serverConfigFiles } from './serverConfig.ts';
for (const [path, generate] of Object.entries(serverConfigFiles)) {
mkdirSync(dirname(path), { recursive: true });
writeFileSync(path, generate());
console.log(`Geschreven: ${path}`);
}
+47
View File
@@ -0,0 +1,47 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Gegenereerd door web/config/serverConfig.ts (pnpm server-config). Niet handmatig aanpassen. -->
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="HTTPS" stopProcessing="true">
<match url="(.*)" />
<conditions>
<add input="{HTTPS}" pattern="^OFF$" />
</conditions>
<action type="Redirect" url="https://{HTTP_HOST}/{R:1}" redirectType="Permanent" />
</rule>
<rule name="SPA fallback" stopProcessing="true">
<match url=".*" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
<action type="Rewrite" url="/index.html" />
</rule>
</rules>
</rewrite>
<httpProtocol>
<customHeaders>
<remove name="X-Powered-By" />
<add name="Content-Security-Policy" value="default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data:; font-src 'self'; connect-src 'self'; object-src 'none'; base-uri 'self'; form-action 'self'; frame-ancestors 'none'" />
<add name="Strict-Transport-Security" value="max-age=31536000; includeSubDomains" />
<add name="X-Content-Type-Options" value="nosniff" />
<add name="X-Frame-Options" value="DENY" />
<add name="Referrer-Policy" value="strict-origin-when-cross-origin" />
</customHeaders>
</httpProtocol>
<staticContent>
<remove fileExtension=".woff2" />
<mimeMap fileExtension=".woff2" mimeType="font/woff2" />
<clientCache cacheControlMode="DisableCache" />
</staticContent>
</system.webServer>
<location path="assets">
<system.webServer>
<staticContent>
<clientCache cacheControlMode="UseMaxAge" cacheControlMaxAge="365.00:00:00" />
</staticContent>
</system.webServer>
</location>
</configuration>
+63
View File
@@ -0,0 +1,63 @@
# Gegenereerd door web/config/serverConfig.ts (pnpm server-config). Niet handmatig aanpassen.
# Test-omgeving op de Raspberry Pi, achter de reverse-proxy-Pi (die TLS afhandelt
# met certbot). De proxy moet de Host-header doorgeven (proxy_set_header Host
# $host), anders kiest nginx hier het standaardblok (WordPress).
# Eigen server-blok naast de WordPress-site: bewust geen default_server, zodat
# dit blok alleen de testhostname beantwoordt.
# Pas server_name en root aan aan de server; de rest komt uit de generator.
server {
listen 80;
server_name test.andreaslop.nl;
root /var/www/html/andreaslop-test;
index index.html;
# Achter de reverse proxy: doorverwijzingen relatief houden, anders stuurt
# nginx naar zijn eigen http://-adres in plaats van de https-hostname
absolute_redirect off;
add_header Content-Security-Policy "default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data:; font-src 'self'; connect-src 'self'; object-src 'none'; base-uri 'self'; form-action 'self'; frame-ancestors 'none'" always;
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
add_header X-Content-Type-Options "nosniff" always;
add_header X-Frame-Options "DENY" always;
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
add_header X-Robots-Tag "noindex, nofollow" always;
add_header Cache-Control "no-cache" always;
# Testsite nooit indexeren
location = /robots.txt {
add_header Content-Security-Policy "default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data:; font-src 'self'; connect-src 'self'; object-src 'none'; base-uri 'self'; form-action 'self'; frame-ancestors 'none'" always;
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
add_header X-Content-Type-Options "nosniff" always;
add_header X-Frame-Options "DENY" always;
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
add_header X-Robots-Tag "noindex, nofollow" always;
default_type text/plain;
return 200 "User-agent: *\nDisallow: /\n";
}
# Bestanden met een hash in de naam: lang cachen
location /assets/ {
add_header Content-Security-Policy "default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data:; font-src 'self'; connect-src 'self'; object-src 'none'; base-uri 'self'; form-action 'self'; frame-ancestors 'none'" always;
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
add_header X-Content-Type-Options "nosniff" always;
add_header X-Frame-Options "DENY" always;
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
add_header X-Robots-Tag "noindex, nofollow" always;
add_header Cache-Control "public, max-age=31536000, immutable" always;
try_files $uri =404;
}
# SPA-fallback: onbekende paden krijgen index.html (de router toont de 404).
# =404 aan het eind: zonder index.html (lege map) een 404 in plaats van een
# doorverwijzingslus die nginx als 500 afbreekt
location / {
add_header Content-Security-Policy "default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data:; font-src 'self'; connect-src 'self'; object-src 'none'; base-uri 'self'; form-action 'self'; frame-ancestors 'none'" always;
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
add_header X-Content-Type-Options "nosniff" always;
add_header X-Frame-Options "DENY" always;
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
add_header X-Robots-Tag "noindex, nofollow" always;
add_header Cache-Control "no-cache" always;
try_files $uri $uri/ /index.html =404;
}
}
@@ -0,0 +1,18 @@
# Gegenereerd door web/config/serverConfig.ts (pnpm server-config). Niet handmatig aanpassen.
# Reverse proxy voor de testsite naar de hosting-Pi. certbot past dit bestand
# aan voor HTTPS; kopieer het daarna dus niet opnieuw zonder certbot opnieuw te
# draaien.
server {
listen 80;
server_name test.andreaslop.nl;
location / {
proxy_pass http://192.168.1.103;
# Verplicht: de hosting-Pi kiest op basis van de hostname tussen het
# testblok en WordPress
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
}
}
+41
View File
@@ -0,0 +1,41 @@
import js from '@eslint/js';
import globals from 'globals';
import tseslint from 'typescript-eslint';
import reactHooks from 'eslint-plugin-react-hooks';
import jsxA11y from 'eslint-plugin-jsx-a11y';
// Alleen regels die fouten vinden; opmaak is aan Prettier
export default tseslint.config(
{
ignores: [
'dist',
'coverage',
'.lighthouseci',
'lighthouse-reports',
'.agents',
'.claude',
'.junie',
'.tanstack',
'src/routeTree.gen.ts',
],
},
{
files: ['**/*.{ts,tsx}'],
extends: [
js.configs.recommended,
...tseslint.configs.recommended,
reactHooks.configs.flat.recommended,
jsxA11y.flatConfigs.recommended,
],
languageOptions: {
globals: globals.browser,
},
},
{
files: ['*.{js,cjs}'],
extends: [js.configs.recommended],
languageOptions: {
globals: globals.node,
},
},
);
+55 -18
View File
@@ -1,25 +1,62 @@
<!doctype html>
<html lang="nl">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/png" href="/favicon.png" />
<link rel="apple-touch-icon" href="/favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<!--
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/png" href="/favicon.png" />
<link rel="apple-touch-icon" href="/favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<!--
Fallback voor crawlers en link-previews die geen JavaScript uitvoeren.
Zodra de app start, worden deze tags verwijderd (zie main.tsx) en zet
elke route zijn eigen titel en beschrijving (zie src/seo.ts).
-->
<title data-fallback>Lifestyle fotograaf in Huizen | Andrea Slop Fotografie</title>
<meta data-fallback name="description" content="Lifestyle fotograaf in Huizen en omgeving. Ik leg je mooiste momenten vast in spontane, kleurrijke foto's. Voor loveshoots, gezins- en zwangerschapsshoots." />
<meta data-fallback property="og:site_name" content="Andrea Slop Fotografie" />
<meta data-fallback property="og:locale" content="nl_NL" />
<meta data-fallback property="og:type" content="website" />
<meta data-fallback property="og:title" content="Lifestyle fotograaf in Huizen | Andrea Slop Fotografie" />
<meta data-fallback property="og:description" content="Lifestyle fotograaf in Huizen en omgeving. Ik leg je mooiste momenten vast in spontane, kleurrijke foto's. Voor loveshoots, gezins- en zwangerschapsshoots." />
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
<title data-fallback>
Lifestyle fotograaf in Huizen | Andrea Slop Fotografie
</title>
<meta
data-fallback
name="description"
content="Lifestyle fotograaf in Huizen en omgeving. Ik leg je mooiste momenten vast in spontane, kleurrijke foto's. Voor loveshoots, gezins- en zwangerschapsshoots."
/>
<meta
data-fallback
property="og:site_name"
content="Andrea Slop Fotografie"
/>
<meta data-fallback property="og:locale" content="nl_NL" />
<meta data-fallback property="og:type" content="website" />
<meta
data-fallback
property="og:title"
content="Lifestyle fotograaf in Huizen | Andrea Slop Fotografie"
/>
<meta
data-fallback
property="og:description"
content="Lifestyle fotograaf in Huizen en omgeving. Ik leg je mooiste momenten vast in spontane, kleurrijke foto's. Voor loveshoots, gezins- en zwangerschapsshoots."
/>
<meta
data-fallback
property="og:url"
content="https://andreaslop.nl/"
/>
<meta
data-fallback
property="og:image"
content="https://andreaslop.nl/og-image.jpg"
/>
<meta
data-fallback
property="og:image:alt"
content="Takjes paarse heide op een arm met een bloementattoo"
/>
<meta data-fallback property="og:image:width" content="1200" />
<meta data-fallback property="og:image:height" content="630" />
<meta data-fallback name="twitter:card" content="summary_large_image" />
<link data-fallback rel="canonical" href="https://andreaslop.nl/" />
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
+104
View File
@@ -0,0 +1,104 @@
// Lighthouse CI tegen de gebouwde site (`pnpm preview`), zodat de echte
// securityheaders en de SPA-fallback meetellen. Doelen: NFR-P-01, NFR-A-01,
// NFR-S-01/02. Dit is de mobiele meting; lighthouserc.desktop.cjs bouwt hierop
// voort voor desktop. `pnpm lighthouse` draait beide.
const origin = 'http://localhost:4173';
// Moet gelijk lopen met src/sitePages.ts (een test bewaakt dat)
const indexedPaths = ['/'];
const noindexPaths = [
'/over-mij',
'/portfolio',
'/soorten-fotoshoots',
'/contact',
'/privacyverklaring',
];
const notFoundPath = '/bestaat-niet';
// Homepage mobiel voorlopig 0,8: de foto's zijn nog niet responsive en de
// titel verschijnt pas na de JavaScript. Komt terug op 0,9 met responsive
// afbeeldingen uit de API/CMS en prerendering (NFR-P-01).
const homeMobilePerformance = 0.8;
// Performance hangt af van de snelheid van de meetmachine: Lighthouse vertraagt
// de CPU 4x ten opzichte van een snelle desktop. Op de CI-runner (Raspberry Pi)
// valt de score daardoor 30-40 punten lager uit dan op een pc. In CI daarom
// alleen melden (LIGHTHOUSE_PERFORMANCE=warn); lokaal in `pnpm check` blokkerend.
const performanceLevel =
process.env.LIGHTHOUSE_PERFORMANCE === 'warn' ? 'warn' : 'error';
const quality = {
'categories:performance': [performanceLevel, { minScore: 0.9 }],
'categories:accessibility': ['error', { minScore: 1 }],
'categories:best-practices': ['error', { minScore: 1 }],
};
// SEO-audits die ook voor noindex-pagina's moeten slagen. Alleen
// `is-crawlable` mag falen: die pagina's staan bewust op noindex.
const seoBasics = {
'document-title': 'error',
'link-text': 'error',
'crawlable-anchors': 'error',
'image-alt': 'error',
};
const escape = (path) => path.replace(/[.*+?^${}()|[\]\\/]/g, '\\$&');
const exact = (paths) => `^${origin}(${paths.map(escape).join('|')})$`;
module.exports = {
performanceLevel,
indexedPaths,
noindexPaths,
notFoundPath,
ci: {
collect: {
startServerCommand: 'pnpm preview --port 4173 --strictPort',
startServerReadyPattern: 'Local',
url: [...indexedPaths, ...noindexPaths, notFoundPath].map(
(path) => origin + path,
),
numberOfRuns: 1,
// In de CI-container draait Chrome als root en heeft het
// --no-sandbox nodig (LIGHTHOUSE_CHROME_FLAGS in de workflow).
// Niet via LHCI_COLLECT__SETTINGS__*: dat vervangt alle settings,
// ook de desktop-preset.
settings: {
chromeFlags: process.env.LIGHTHOUSE_CHROME_FLAGS ?? '',
},
},
assert: {
assertMatrix: [
{
matchingUrlPattern: exact(indexedPaths),
assertions: {
...quality,
'categories:performance': [
performanceLevel,
{ minScore: homeMobilePerformance },
],
'categories:seo': ['error', { minScore: 1 }],
},
},
{
matchingUrlPattern: exact(noindexPaths),
assertions: {
...quality,
...seoBasics,
'meta-description': 'error',
canonical: 'error',
},
},
{
matchingUrlPattern: exact([notFoundPath]),
assertions: { ...quality, ...seoBasics },
},
],
},
upload: {
// HTML- en JSON-rapporten per meting; in CI als download bij de run
target: 'filesystem',
outputDir: 'lighthouse-reports/mobile',
},
},
};
+10
View File
@@ -0,0 +1,10 @@
// Types voor lighthouserc.cjs, zodat een test de URL-lijsten kan vergelijken
// met het pagina-register
declare const config: {
indexedPaths: string[];
noindexPaths: string[];
notFoundPath: string;
ci: unknown;
};
export = config;
+34
View File
@@ -0,0 +1,34 @@
// Desktopmeting: zelfde pagina's en doelen als mobiel, maar ook de homepage
// moet hier Performance 0,9 halen.
const base = require('./lighthouserc.cjs');
const [home, ...rest] = base.ci.assert.assertMatrix;
module.exports = {
ci: {
...base.ci,
collect: {
...base.ci.collect,
settings: { ...base.ci.collect.settings, preset: 'desktop' },
},
assert: {
assertMatrix: [
{
...home,
assertions: {
...home.assertions,
'categories:performance': [
base.performanceLevel,
{ minScore: 0.9 },
],
},
},
...rest,
],
},
upload: {
...base.ci.upload,
outputDir: 'lighthouse-reports/desktop',
},
},
};
+31 -5
View File
@@ -3,23 +3,52 @@
"private": true,
"version": "0.0.0",
"type": "module",
"packageManager": "pnpm@12.11.2",
"scripts": {
"dev": "vite",
"build": "tsc && vite build",
"preview": "vite preview",
"postinstall": "chakra typegen ./src/theme.ts",
"typegen": "chakra typegen ./src/theme.ts",
"typegen:watch": "chakra typegen ./src/theme.ts --watch"
"typegen:watch": "chakra typegen ./src/theme.ts --watch",
"test": "vitest run --coverage",
"test:watch": "vitest",
"lint": "eslint .",
"format:check": "prettier --check .",
"audit:deps": "pnpm audit --prod --audit-level high",
"audit:dev": "pnpm audit || echo Meldingen in ontwikkeltools blokkeren niet, zie NFR-SEC-05",
"lighthouse": "lhci autorun && lhci autorun --config=lighthouserc.desktop.cjs",
"server-config": "node config/writeServerConfig.ts",
"check": "pnpm lint && pnpm format:check && pnpm test && pnpm build && pnpm audit:deps && pnpm audit:dev && pnpm lighthouse"
},
"devDependencies": {
"@chakra-ui/cli": "^3.37.0",
"@eslint/js": "^9.39.5",
"@iconify-icons/ant-design": "2.0.1",
"@iconify/react": "^6.0.2",
"@lhci/cli": "^0.15.1",
"@tanstack/react-router-devtools": "^1.167.2",
"@tanstack/router-plugin": "^1.168.40",
"@testing-library/dom": "^10.4.2",
"@testing-library/jest-dom": "^7.0.1",
"@testing-library/react": "^16.3.3",
"@testing-library/user-event": "^14.6.8",
"@types/react": "^19.3.0",
"@types/react-dom": "^19.3.0",
"@vitejs/plugin-react": "^6.1.2",
"@vitest/coverage-v8": "^5.0.5",
"axe-core": "^4.14.0",
"eslint": "^9.39.5",
"eslint-plugin-jsx-a11y": "^6.10.2",
"eslint-plugin-react-hooks": "^7.1.1",
"fast-check": "^4.10.2",
"globals": "^17.13.0",
"jsdom": "^30.1.3",
"prettier": "^3.9.9",
"typescript": "~6.0.2",
"vite": "^8.3.0"
"typescript-eslint": "^8.71.2",
"vite": "^8.3.0",
"vitest": "^5.0.5"
},
"dependencies": {
"@chakra-ui/react": "^3.37.0",
@@ -27,9 +56,6 @@
"@fontsource/jost": "^5.3.0",
"@fontsource/marcellus": "^5.3.0",
"@tanstack/react-router": "^1.170.39",
"@tanstack/react-router-devtools": "^1.167.2",
"@vitejs/plugin-react": "^6.1.1",
"next-themes": "^0.4.6",
"react": "^19.3.0",
"react-dom": "^19.3.0"
}
+5031 -91
View File
File diff suppressed because it is too large Load Diff
+5 -1
View File
@@ -1,2 +1,6 @@
allowBuilds:
esbuild: true
esbuild: true
# Veiligheidspatch (GHSA-68fv-2mgg-jv7q) voor de Vite/Vitest-keten
overrides:
source-map-js: ^1.2.2
Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 92 KiB

+4
View File
@@ -0,0 +1,4 @@
User-agent: *
Allow: /
Sitemap: https://andreaslop.nl/sitemap.xml
+141
View File
@@ -0,0 +1,141 @@
import { ChakraProvider } from '@chakra-ui/react';
import {
createMemoryHistory,
createRouter,
RouterProvider,
} from '@tanstack/react-router';
import { render, screen } from '@testing-library/react';
import { afterEach, describe, expect, it, vi } from 'vitest';
import lighthouseConfig from '../lighthouserc.cjs';
import ErrorPage from './components/StatusPage/ErrorPage';
import { routeTree } from './routeTree.gen';
import sitePages from './sitePages';
import { axeResults } from './test/axe';
import system from './theme';
// Laat PageIntro op verzoek crashen, om de foutpagina binnen de shell te testen
const crash = vi.hoisted(() => ({ enabled: false }));
vi.mock('./components/PageIntro/PageIntro', async (importOriginal) => {
const original =
await importOriginal<
typeof import('./components/PageIntro/PageIntro')
>();
return {
default: (props: Parameters<typeof original.default>[0]) => {
if (crash.enabled) throw new Error('kapot');
return original.default(props);
},
};
});
afterEach(() => {
crash.enabled = false;
});
// De echte app: route tree, router-opties en thema zoals in main.tsx
async function renderApp(path: string) {
const router = createRouter({
routeTree,
history: createMemoryHistory({ initialEntries: [path] }),
scrollRestoration: true,
defaultErrorComponent: ErrorPage,
});
await router.load();
const result = render(
<ChakraProvider value={system}>
<RouterProvider router={router} />
</ChakraProvider>,
);
return { ...result, router };
}
const expectShell = () => {
expect(screen.getByRole('banner')).toBeInTheDocument();
expect(screen.getByRole('contentinfo')).toBeInTheDocument();
};
describe('app', () => {
it.each(Object.keys(sitePages))(
'%s rendert binnen de shell met een h1 en zonder axe-fouten',
async (path) => {
const { container } = await renderApp(path);
expectShell();
expect(
await screen.findAllByRole('heading', { level: 1 }),
).toHaveLength(1);
expect(await axeResults(container)).toHaveNoViolations();
},
);
it('zet titel en noindex van een placeholder in de head', async () => {
await renderApp('/portfolio');
await screen.findByRole('heading', { level: 1, name: 'Portfolio' });
expect(document.title).toBe('Portfolio | Andrea Slop Fotografie');
expect(
document.head.querySelector('link[rel="canonical"]'),
).toHaveAttribute('href', 'https://andreaslop.nl/portfolio');
expect(
document.head.querySelector('meta[name="robots"]'),
).toHaveAttribute('content', 'noindex');
});
// Een data-script blijft staan waar HeadContent rendert (in de body);
// React verplaatst alleen title, meta en link. Google leest JSON-LD overal.
it('zet precies een blok gestructureerde data in de pagina', async () => {
await renderApp('/');
const scripts = document.querySelectorAll(
'script[type="application/ld+json"]',
);
expect(scripts).toHaveLength(1);
expect(JSON.parse(scripts[0].textContent!)['@type']).toBe(
'ProfessionalService',
);
});
it('toont een onbekende URL als 404 binnen de shell', async () => {
const { container } = await renderApp('/bestaat-niet');
expect(
await screen.findByRole('heading', {
level: 1,
name: 'Pagina niet gevonden',
}),
).toBeInTheDocument();
expectShell();
expect(await axeResults(container)).toHaveNoViolations();
});
it('toont een fout in een pagina als foutpagina binnen de shell', async () => {
crash.enabled = true;
vi.spyOn(console, 'error').mockImplementation(() => {});
// De router meldt de bewust gegooide fout ook als waarschuwing
vi.spyOn(console, 'warn').mockImplementation(() => {});
await renderApp('/portfolio');
expect(
await screen.findByRole('heading', {
level: 1,
name: 'Er ging iets mis',
}),
).toBeInTheDocument();
expectShell();
expect(document.body).not.toHaveTextContent('kapot');
});
});
describe('pagina-register', () => {
it('bevat precies de routes van de route tree', async () => {
const { router } = await renderApp('/');
const routePaths = Object.keys(router.routesByPath).sort();
expect(Object.keys(sitePages).sort()).toEqual(routePaths);
});
it('loopt gelijk met de URLs van Lighthouse CI', () => {
const indexed = Object.entries(sitePages)
.filter(([, page]) => page.indexed)
.map(([path]) => path);
const noindex = Object.entries(sitePages)
.filter(([, page]) => !page.indexed)
.map(([path]) => path);
expect(lighthouseConfig.indexedPaths).toEqual(indexed);
expect(lighthouseConfig.noindexPaths).toEqual(noindex);
});
});

Before

Width:  |  Height:  |  Size: 257 KiB

After

Width:  |  Height:  |  Size: 257 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 MiB

After

Width:  |  Height:  |  Size: 433 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 218 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 223 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

-1
View File
@@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" width="32" height="32" viewBox="0 0 256 256"><path fill="#007ACC" d="M0 128v128h256V0H0z"/><path fill="#FFF" d="m56.612 128.85l-.081 10.483h33.32v94.68h23.568v-94.68h33.321v-10.28c0-5.69-.122-10.444-.284-10.566c-.122-.162-20.4-.244-44.983-.203l-44.74.122l-.121 10.443Zm149.955-10.742c6.501 1.625 11.459 4.51 16.01 9.224c2.357 2.52 5.851 7.111 6.136 8.208c.08.325-11.053 7.802-17.798 11.988c-.244.162-1.22-.894-2.317-2.52c-3.291-4.795-6.745-6.867-12.028-7.233c-7.76-.528-12.759 3.535-12.718 10.321c0 1.992.284 3.17 1.097 4.795c1.707 3.536 4.876 5.649 14.832 9.956c18.326 7.883 26.168 13.084 31.045 20.48c5.445 8.249 6.664 21.415 2.966 31.208c-4.063 10.646-14.14 17.879-28.323 20.276c-4.388.772-14.79.65-19.504-.203c-10.28-1.828-20.033-6.908-26.047-13.572c-2.357-2.6-6.949-9.387-6.664-9.874c.122-.163 1.178-.813 2.356-1.504c1.138-.65 5.446-3.129 9.509-5.485l7.355-4.267l1.544 2.276c2.154 3.29 6.867 7.801 9.712 9.305c8.167 4.307 19.383 3.698 24.909-1.26c2.357-2.153 3.332-4.388 3.332-7.68c0-2.966-.366-4.266-1.91-6.501c-1.99-2.845-6.054-5.242-17.595-10.24c-13.206-5.69-18.895-9.224-24.096-14.832c-3.007-3.25-5.852-8.452-7.03-12.8c-.975-3.617-1.22-12.678-.447-16.335c2.723-12.76 12.353-21.659 26.25-24.3c4.51-.853 14.994-.528 19.424.569Z"/></svg>

Before

Width:  |  Height:  |  Size: 1.3 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 8.5 KiB

+32
View File
@@ -0,0 +1,32 @@
import { screen } from '@testing-library/react';
import { describe, expect, it } from 'vitest';
import { axeResults } from '@/test/axe';
import { renderWithProviders } from '@/test/renderWithProviders';
import AppShell from './AppShell';
describe('AppShell', () => {
it('heeft de landmarks van de shell', async () => {
const { container } = await renderWithProviders(<AppShell />);
expect(screen.getByRole('banner')).toBeInTheDocument();
expect(screen.getByRole('main')).toHaveAttribute('id', 'main');
expect(screen.getByRole('contentinfo')).toBeInTheDocument();
expect(
screen.getByRole('navigation', { name: 'Hoofdmenu' }),
).toBeInTheDocument();
expect(
screen.getByRole('navigation', { name: 'Footermenu' }),
).toBeInTheDocument();
expect(await axeResults(container)).toHaveNoViolations();
});
it('begint met een skip link naar de inhoud', async () => {
const { container } = await renderWithProviders(<AppShell />);
const skip = screen.getByRole('link', {
name: 'Direct naar de inhoud',
});
expect(skip).toHaveAttribute('href', '#main');
// Eerste focusbare element van de pagina
expect(container.querySelector('a, button')).toBe(skip);
expect(screen.getByRole('main')).toHaveAttribute('tabindex', '-1');
});
});
+17 -3
View File
@@ -1,13 +1,27 @@
import { SkipNavContent, SkipNavLink } from '@chakra-ui/react';
import { Outlet } from '@tanstack/react-router';
import siteContent from '@/content/siteContent';
import useRouteFocus from '@/hooks/useRouteFocus';
import BackToTop from './BackToTop/BackToTop';
import Footer from './Footer/Footer';
import NavigationBar from './NavigationBar/NavigationBar';
import Footer from './Footer';
// Het frame om elke pagina (LAYOUT.md "Shell"): header, inhoud en footer.
// Hier komt de site-brede content binnen; straks uit een loader of de API.
export default function AppShell() {
useRouteFocus();
return (
<>
<SkipNavLink id="main" data-testid="skip-link">
Direct naar de inhoud
</SkipNavLink>
<NavigationBar />
<Outlet />
<Footer />
<SkipNavContent as="main" id="main">
<Outlet />
</SkipNavContent>
<Footer content={siteContent} />
<BackToTop />
</>
);
}
@@ -0,0 +1,87 @@
import { act, screen } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import { afterEach, describe, expect, it, vi } from 'vitest';
import { axeResults } from '@/test/axe';
import { renderWithProviders } from '@/test/renderWithProviders';
import BackToTop from './BackToTop';
const scrollTo = (y: number) =>
act(() => {
Object.defineProperty(window, 'scrollY', {
value: y,
configurable: true,
});
window.dispatchEvent(new Event('scroll'));
});
const reducedMotion = (matches: boolean) =>
vi.spyOn(window, 'matchMedia').mockImplementation(
(query: string) =>
({
matches: matches && query.includes('reduce'),
media: query,
addEventListener: () => {},
removeEventListener: () => {},
}) as unknown as MediaQueryList,
);
const renderButton = () =>
renderWithProviders(
<>
<main id="main" tabIndex={-1}>
inhoud
</main>
<BackToTop />
</>,
);
const button = () => screen.getByTestId('back-to-top-button');
afterEach(() => {
Object.defineProperty(window, 'scrollY', { value: 0, configurable: true });
});
describe('BackToTop', () => {
it('is bovenaan inert: niet focusbaar en niet voorgelezen', async () => {
await renderButton();
expect(button()).toHaveAttribute('inert');
expect(
screen.queryByRole('button', { name: 'Terug naar boven' }),
).toBeNull();
});
it('verschijnt pas voorbij 60% van de viewporthoogte', async () => {
await renderButton();
const threshold = 0.6 * window.innerHeight;
await scrollTo(threshold);
expect(button()).toHaveAttribute('inert');
await scrollTo(threshold + 1);
expect(button()).not.toHaveAttribute('inert');
expect(screen.getByRole('button', { name: 'Terug naar boven' })).toBe(
button(),
);
});
it('scrolt soepel naar boven en zet de focus op de inhoud', async () => {
const scroll = vi
.spyOn(window, 'scrollTo')
.mockImplementation(() => {});
const { container } = await renderButton();
await scrollTo(2000);
await userEvent.click(button());
expect(scroll).toHaveBeenCalledWith({ top: 0, behavior: 'smooth' });
expect(document.activeElement).toBe(document.getElementById('main'));
expect(await axeResults(container)).toHaveNoViolations();
});
it('springt direct naar boven bij reduced motion', async () => {
reducedMotion(true);
const scroll = vi
.spyOn(window, 'scrollTo')
.mockImplementation(() => {});
await renderButton();
await scrollTo(2000);
await userEvent.click(button());
expect(scroll).toHaveBeenCalledWith({ top: 0, behavior: 'instant' });
});
});
@@ -0,0 +1,62 @@
import { chakra } from '@chakra-ui/react';
import { Icon } from '@iconify/react/offline';
import upOutlined from '@iconify-icons/ant-design/up-outlined';
import useScrolledPast from '@/hooks/useScrolledPast';
import { backToTopThreshold } from '@/lib/backToTopThreshold';
// Buiten het component, zodat de functie stabiel is voor useScrolledPast
const threshold = () => backToTopThreshold(window.innerHeight);
// Afstand tot de rand zoals in het design. Op hele brede schermen lijnt de
// knop uit met de rand van de content in plaats van de hoek van het scherm.
const EDGE = 'clamp(1rem, 3vw, 2rem)';
// Vaste knop rechtsonder om terug naar boven te gaan (FR-06, BR-TOP-*)
export default function BackToTop() {
const visible = useScrolledPast(threshold);
const scrollToTop = () => {
const reduced = window.matchMedia(
'(prefers-reduced-motion: reduce)',
).matches;
window.scrollTo({ top: 0, behavior: reduced ? 'instant' : 'smooth' });
// De knop verdwijnt bovenaan; de focus gaat naar de inhoud
document.getElementById('main')?.focus({ preventScroll: true });
};
return (
<chakra.button
type="button"
onClick={scrollToTop}
aria-label="Terug naar boven"
data-testid="back-to-top-button"
position="fixed"
bottom={EDGE}
right={`max(${EDGE}, calc((100vw - {sizes.content}) / 2 + {spacing.8}))`}
zIndex="backToTop"
display="inline-flex"
alignItems="center"
justifyContent="center"
w="46px"
h="46px"
bg="ink"
color="white"
fontSize="1.1rem"
cursor="pointer"
// Verborgen = niet zichtbaar, niet focusbaar, niet klikbaar en
// niet voorgelezen (BR-TOP-03); inert dekt dat ook zonder CSS af
inert={!visible}
visibility={visible ? 'visible' : 'hidden'}
opacity={visible ? 1 : 0}
transform={visible ? 'none' : 'translateY(8px)'}
transitionProperty="opacity, transform, visibility, background-color"
transitionDuration="interaction"
transitionTimingFunction="smooth"
_hover={{ bg: 'accent.deep' }}
_focusVisible={{ bg: 'accent.deep' }}
_motionReduce={{ transitionDuration: '0s', transform: 'none' }}
>
<Icon icon={upOutlined} aria-hidden />
</chakra.button>
);
}
-10
View File
@@ -1,10 +0,0 @@
export default function Footer() {
return (
<footer className="p-2 text-center">
<p className="text-sm text-gray-500">
&copy; {new Date().getFullYear()} Andrea Slop Fotografie. All
rights reserved.
</p>
</footer>
);
}
+87
View File
@@ -0,0 +1,87 @@
import { screen, within } from '@testing-library/react';
import { describe, expect, it } from 'vitest';
import siteContent from '@/content/siteContent';
import type { SiteContent } from '@/content/types';
import { axeResults } from '@/test/axe';
import { renderWithProviders } from '@/test/renderWithProviders';
import Footer from './Footer';
const renderFooter = (content: SiteContent = siteContent, path = '/') =>
renderWithProviders(<Footer content={content} />, { path });
describe('Footer', () => {
it('toont merk, socials en contact met h2-koppen', async () => {
const { container } = await renderFooter();
expect(
screen.getByRole('img', { name: 'Andrea Slop Fotografie' }),
).toBeInTheDocument();
// Regelafbreking uit de content blijft in de tekst staan
expect(
screen.getByText(siteContent.footerIntro, {
normalizer: (text) => text,
}),
).toHaveStyle({ whiteSpace: 'pre-line' });
const headings = screen.getAllByRole('heading', { level: 2 });
// Naam in gewone schrijfwijze, los van de CSS-hoofdletters
expect(headings.map((h) => h.getAttribute('aria-label'))).toEqual([
'Socials',
'Contact',
]);
expect(headings.map((h) => h.textContent)).toEqual([
'Socials',
'Contact',
]);
expect(await axeResults(container)).toHaveNoViolations();
});
it('opent socials veilig in een nieuw tabblad en meldt dat', async () => {
await renderFooter();
const link = screen.getByRole('link', {
name: 'Facebook (opent in nieuw tabblad)',
});
expect(link).toHaveAttribute('target', '_blank');
expect(link).toHaveAttribute('rel', 'noopener noreferrer');
expect(link).toHaveAttribute('href', siteContent.socials[0].href);
});
it('voegt het e-mailadres pas bij het tonen samen', async () => {
await renderFooter();
const link = screen.getByTestId('footer-email-link');
expect(link).toHaveAttribute('href', 'mailto:info@andreaslop.nl');
expect(link).toHaveTextContent('info@andreaslop.nl');
});
it('toont het huidige jaar', async () => {
await renderFooter();
expect(
screen.getByText(
`© ${new Date().getFullYear()} Andrea Slop Fotografie`,
),
).toBeInTheDocument();
});
it('heeft een footermenu dat de actieve pagina markeert', async () => {
await renderFooter(siteContent, '/portfolio');
const nav = screen.getByRole('navigation', { name: 'Footermenu' });
const links = within(nav).getAllByRole('link');
expect(links.map((l) => l.textContent)).toEqual([
'Portfolio',
'Soorten fotoshoots',
'Contact',
'Privacyverklaring',
]);
expect(links[0]).toHaveAttribute('aria-current', 'page');
expect(links[1]).not.toHaveAttribute('aria-current');
});
it('laat lege kolommen weg', async () => {
await renderFooter({
...siteContent,
socials: [{ platform: 'facebook', href: '' }],
email: { user: '', domain: 'andreaslop.nl' },
});
expect(screen.queryByRole('heading', { name: 'Socials' })).toBeNull();
expect(screen.queryByRole('heading', { name: 'Contact' })).toBeNull();
expect(screen.queryByTestId('footer-email-link')).toBeNull();
});
});
+154
View File
@@ -0,0 +1,154 @@
import {
Box,
chakra,
Container,
Flex,
Grid,
Image,
Text,
VisuallyHidden,
} from '@chakra-ui/react';
import socialPlatforms from '@/content/socialPlatforms';
import type { SiteContent } from '@/content/types';
import { copyrightLine } from '@/lib/copyrightLine';
import { emailAddress } from '@/lib/emailAddress';
import { visibleSocials } from '@/lib/visibleSocials';
import { footerNav } from '@/navigation';
import RouterLink from '../RouterLink';
import FooterColumn from './FooterColumn';
import FooterLink from './FooterLink';
// Images
import logoDark from '../../assets/logo-dark.png';
type FooterProps = {
content: SiteContent;
};
// Footer uit het design (FR-05): merk, socials en contact, met daaronder de
// copyright en het footermenu. Een lege kolom valt weg (BR-FOOT-01).
export default function Footer({ content }: FooterProps) {
const socials = visibleSocials(content.socials);
// Pas hier samengevoegd, zodat het adres nergens letterlijk staat
const email = emailAddress(content.email);
const year = new Date().getFullYear();
return (
<Box
as="footer"
bg="paper.alt"
borderTopWidth="1px"
borderTopColor="line"
pt="clamp(3.5rem, 7vw, 6rem)"
>
<Container>
<Grid
templateColumns={{
base: '1fr',
md: 'repeat(2, 1fr)',
lg: '1.2fr 1fr 1fr',
}}
gap="clamp(2rem, 5vw, 4rem)"
pb="clamp(2.5rem, 5vw, 4rem)"
>
{/* Merk: op mobiel gecentreerd onder elkaar, vanaf tablet
het logo met de tekst ernaast */}
<Flex
direction={{ base: 'column', md: 'row' }}
alignItems="center"
alignSelf="start"
gap={5}
textAlign={{ base: 'center', md: 'start' }}
>
<Image
src={logoDark}
alt="Andrea Slop Fotografie"
htmlWidth={500}
htmlHeight={500}
w={{ base: '150px', md: '110px' }}
h="auto"
flexShrink={0}
loading="lazy"
/>
{/* Regelafbrekingen uit de content blijven staan */}
<Text color="ink.soft" whiteSpace="pre-line">
{content.footerIntro}
</Text>
</Flex>
{socials.length > 0 && (
<FooterColumn title="Socials">
{socials.map((social) => (
<chakra.li key={social.platform}>
<FooterLink
href={social.href}
target="_blank"
rel="noopener noreferrer"
data-testid={`footer-social-${social.platform}`}
>
{/* Spatie buiten de verborgen tekst, anders
valt hij weg uit de voorgelezen naam */}
{socialPlatforms[social.platform].name}{' '}
<VisuallyHidden>
(opent in nieuw tabblad)
</VisuallyHidden>
</FooterLink>
</chakra.li>
))}
</FooterColumn>
)}
{email && (
<FooterColumn title="Contact">
<chakra.li>
<FooterLink
href={`mailto:${email}`}
data-testid="footer-email-link"
>
{email}
</FooterLink>
</chakra.li>
</FooterColumn>
)}
</Grid>
<Flex
direction={{ base: 'column', md: 'row' }}
alignItems="center"
justifyContent="space-between"
gap={{ base: 2, md: 6 }}
py={6}
borderTopWidth="1px"
borderTopColor="line"
textAlign={{ base: 'center', md: 'start' }}
>
<Text fontSize="sm" color="ink.soft">
{copyrightLine(year)}
</Text>
<chakra.nav aria-label="Footermenu">
<Flex
as="ul"
listStyleType="none"
wrap="wrap"
justifyContent="center"
columnGap={6}
>
{footerNav.map((item) => (
<chakra.li key={item.to}>
<FooterLink asChild>
<RouterLink
to={item.to}
data-testid={`footer-nav-${item.to.slice(1)}`}
>
{item.label}
</RouterLink>
</FooterLink>
</chakra.li>
))}
</Flex>
</chakra.nav>
</Flex>
</Container>
</Box>
);
}
@@ -0,0 +1,31 @@
import type { ReactNode } from 'react';
import { Box, Heading, Stack } from '@chakra-ui/react';
type FooterColumnProps = {
title: string;
children: ReactNode;
};
// Kolom in de footer: kopje als label, daaronder een lijst. De kop is een h2,
// want de kolommen zijn hoofdsecties van de pagina (BR-SEO-09).
export default function FooterColumn({ title, children }: FooterColumnProps) {
return (
<Box>
<Heading
as="h2"
// Mobiele schermlezers lezen de CSS-hoofdletters ("SOCIALS") als
// afkorting; het label geeft ze het woord in gewone schrijfwijze
aria-label={title}
textStyle="eyebrow"
fontFamily="body"
color="ink.soft"
mb={{ base: 2, lg: 4 }}
>
{title}
</Heading>
<Stack as="ul" listStyleType="none" gap={{ base: 0, lg: 2 }}>
{children}
</Stack>
</Box>
);
}
+14
View File
@@ -0,0 +1,14 @@
import { Link, type LinkProps } from '@chakra-ui/react';
// Link in de footer: de rustige `subtle`-stijl, en op touch minimaal 44px
// hoog als klikdoel (BR-RWD-04)
export default function FooterLink(props: LinkProps) {
return (
<Link
variant="subtle"
minH={{ base: '44px', lg: 'auto' }}
fontSize="sm"
{...props}
/>
);
}
+67
View File
@@ -0,0 +1,67 @@
import { fireEvent, screen, waitFor } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import { describe, expect, it } from 'vitest';
import heroContent from '@/content/heroContent';
import siteContent from '@/content/siteContent';
import { axeResults } from '@/test/axe';
import { renderWithProviders } from '@/test/renderWithProviders';
import Hero from './Hero';
describe('Hero', () => {
it('toont alleen geldige socials, met melding over het nieuwe tabblad', async () => {
const { container } = await renderWithProviders(
<Hero
content={heroContent}
socials={[
...siteContent.socials,
{ platform: 'facebook', href: 'javascript:alert(1)' },
]}
/>,
);
const links = screen.getAllByRole('link', {
name: /opent in nieuw tabblad/,
});
expect(links).toHaveLength(2);
expect(links[0]).toHaveAccessibleName(
'Facebook (opent in nieuw tabblad)',
);
expect(links[0]).toHaveAttribute('rel', 'noopener noreferrer');
expect(await axeResults(container)).toHaveNoViolations();
});
it('laadt eerst de eerste foto, daarna alleen de volgende en vorige', async () => {
const { container } = await renderWithProviders(
<Hero content={heroContent} socials={siteContent.socials} />,
);
const sources = () =>
[...container.querySelectorAll('img')].map((img) =>
img.getAttribute('src'),
);
const slide = (i: number) => heroContent.slides[i].src;
const last = heroContent.slides.length - 1;
expect(sources()).toEqual([slide(0)]);
fireEvent.load(container.querySelector('img')!);
// Vanaf de eerste foto is de vorige de laatste
await waitFor(() =>
expect(sources()).toEqual([slide(0), slide(1), slide(last)]),
);
await userEvent.click(
screen.getByRole('button', { name: 'Volgende foto' }),
);
expect(sources()).toEqual([slide(0), slide(1), slide(2)]);
});
it('heeft pijlen met een toegankelijke naam', async () => {
await renderWithProviders(
<Hero content={heroContent} socials={siteContent.socials} />,
);
expect(
screen.getByRole('button', { name: 'Vorige foto' }),
).toBeInTheDocument();
expect(
screen.getByRole('button', { name: 'Volgende foto' }),
).toBeInTheDocument();
});
});
+40 -18
View File
@@ -1,20 +1,35 @@
import { useState } from 'react';
import { Box, chakra, Container, Heading, Image } from '@chakra-ui/react';
import LinkButton from '../LinkButton';
import HeroArrows from './HeroArrows';
import HeroSocials from './HeroSocials';
import useHeroSlider from './useHeroSlider';
import type { HeroContent } from './types';
import type { HeroContent, SocialLink } from '@/content/types';
import { slidesToLoad } from '@/lib/slidesToLoad';
const SLIDE_DURATION = '6s';
type HeroProps = {
content: HeroContent;
socials: SocialLink[];
};
export default function Hero({ content }: HeroProps) {
const { title, tagline, cta, slides, socials } = content;
export default function Hero({ content, socials }: HeroProps) {
const { title, tagline, cta, slides } = content;
const { active, reducedMotion, autoplay, paused, next, prev, handlers } =
useHeroSlider(slides.length);
// De slides liggen op elkaar in beeld, dus loading="lazy" stelt niets uit.
// Eerst alleen de actieve foto; zodra die binnen en getekend is (twee
// frames later, dus na de eerste paint) ook de volgende en de vorige.
// Verder weg laden we pas als de slider in de buurt komt (BR-HERO-01).
const [firstPainted, setFirstPainted] = useState(false);
const onFirstLoaded = () =>
requestAnimationFrame(() =>
requestAnimationFrame(() => setFirstPainted(true)),
);
const loaded = firstPainted
? slidesToLoad(active, slides.length)
: [active];
return (
<Box
@@ -48,21 +63,28 @@ export default function Hero({ content }: HeroProps) {
transitionDuration="fade"
transitionTimingFunction="smooth"
>
<Image
src={slide.src}
alt={slide.alt}
fetchPriority={i === 0 ? 'high' : undefined}
loading={i === 0 ? undefined : 'lazy'}
w="100%"
h="100%"
objectFit="cover"
transform={
reducedMotion || i === active
? 'scale(1)'
: 'scale(1.06)'
}
transition="transform 9s linear"
/>
{loaded.includes(i) && (
<Image
src={slide.src}
alt={slide.alt}
fetchPriority={i === 0 ? 'high' : undefined}
onLoad={
firstPainted ? undefined : onFirstLoaded
}
onError={
firstPainted ? undefined : onFirstLoaded
}
w="100%"
h="100%"
objectFit="cover"
transform={
reducedMotion || i === active
? 'scale(1)'
: 'scale(1.06)'
}
transition="transform 9s linear"
/>
)}
</Box>
))}
</Box>
+17 -13
View File
@@ -1,4 +1,4 @@
import { chakra } from '@chakra-ui/react';
import { chakra, useRecipe } from '@chakra-ui/react';
import { Icon } from '@iconify/react/offline';
import leftOutlined from '@iconify-icons/ant-design/left-outlined';
import rightOutlined from '@iconify-icons/ant-design/right-outlined';
@@ -12,10 +12,20 @@ type HeroArrowsProps = {
export default function HeroArrows({ onPrev, onNext }: HeroArrowsProps) {
return (
<>
<ArrowButton side="left" aria-label="Vorige foto" onClick={onPrev}>
<ArrowButton
side="left"
aria-label="Vorige foto"
data-testid="hero-prev-button"
onClick={onPrev}
>
<Icon icon={leftOutlined} aria-hidden />
</ArrowButton>
<ArrowButton side="right" aria-label="Volgende foto" onClick={onNext}>
<ArrowButton
side="right"
aria-label="Volgende foto"
data-testid="hero-next-button"
onClick={onNext}
>
<Icon icon={rightOutlined} aria-hidden />
</ArrowButton>
</>
@@ -29,26 +39,20 @@ type ArrowButtonProps = React.ComponentProps<typeof chakra.button> & {
const ARROW_OFFSET = 'clamp(0.5rem, 3vw, 2.5rem)';
function ArrowButton({ side, ...props }: ArrowButtonProps) {
// Doorzichtigheid, hover en witte focusring komen uit de iconControl-recipe
const iconControl = useRecipe({ key: 'iconControl' });
return (
<chakra.button
type="button"
css={iconControl()}
position="absolute"
top="50%"
left={side === 'left' ? ARROW_OFFSET : undefined}
right={side === 'right' ? ARROW_OFFSET : undefined}
zIndex={2}
transform="translateY(-50%)"
display="flex"
p={2}
color="white"
fontSize={{ base: '1.5rem', md: '2rem' }}
cursor="pointer"
opacity={0.6}
transitionProperty="opacity"
transitionDuration="interaction"
transitionTimingFunction="smooth"
_hover={{ opacity: 1 }}
_focusVisible={{ opacity: 1, outline: '1px solid white', outlineOffset: '2px' }}
{...props}
/>
);
+24 -29
View File
@@ -1,48 +1,43 @@
import { chakra, HStack } from '@chakra-ui/react';
import { chakra, HStack, useRecipe } from '@chakra-ui/react';
import { Icon } from '@iconify/react/offline';
import socialPlatforms from './socialPlatforms';
import type { HeroSocial } from './types';
import socialPlatforms from '@/content/socialPlatforms';
import type { SocialLink } from '@/content/types';
import { visibleSocials } from '@/lib/visibleSocials';
type HeroSocialsProps = {
socials: HeroSocial[];
socials: SocialLink[];
};
// Socials linksonder, naast elkaar
export default function HeroSocials({ socials }: HeroSocialsProps) {
const iconControl = useRecipe({ key: 'iconControl' });
return (
<HStack
position="absolute"
left="gutter"
bottom={{ base: 6, md: 10 }}
zIndex={2}
gap={5}
color="white"
gap={2}
fontSize="1.5rem"
>
{socials
.filter((social) => social.href)
.map((social) => {
const { name, icon } = socialPlatforms[social.platform];
{visibleSocials(socials).map((social) => {
const { name, icon } = socialPlatforms[social.platform];
return (
<chakra.a
key={social.platform}
href={social.href}
target="_blank"
rel="noopener noreferrer"
aria-label={name}
display="flex"
opacity={0.6}
transitionProperty="opacity"
transitionDuration="interaction"
transitionTimingFunction="smooth"
_hover={{ opacity: 1 }}
_focusVisible={{ opacity: 1 }}
>
<Icon icon={icon} aria-hidden />
</chakra.a>
);
})}
return (
<chakra.a
key={social.platform}
href={social.href}
target="_blank"
rel="noopener noreferrer"
aria-label={`${name} (opent in nieuw tabblad)`}
data-testid={`hero-social-${social.platform}`}
css={iconControl()}
>
<Icon icon={icon} aria-hidden />
</chakra.a>
);
})}
</HStack>
);
}
-36
View File
@@ -1,36 +0,0 @@
import type { HeroContent } from './types';
// Images
import hero1 from '../../assets/hero-1.jpg';
import hero2 from '../../assets/hero-2.jpg';
import newborn from '../../assets/newborn.jpg';
import hero4 from '../../assets/hero-4.jpg';
import hero5 from '../../assets/hero-5.jpg';
import hero6 from '../../assets/hero-6.jpg';
// Statische content tot de CMS-API er is. Daarna komt dit object uit de API.
const heroContent: HeroContent = {
title: 'Andrea Slop',
tagline: 'Lifestyle fotograaf · Huizen',
cta: { label: 'Lees meer', to: '/over-mij' },
slides: [
{ id: 'hero-1', src: hero1, alt: 'Lifestyle fotografie van Andrea Slop' },
{ id: 'hero-2', src: hero2, alt: 'Zwangerschapsshoot in de buitenlucht' },
{ id: 'newborn', src: newborn, alt: 'Newbornshoot van een pasgeboren baby' },
{ id: 'hero-4', src: hero4, alt: 'Spontaan portret buiten' },
{ id: 'hero-5', src: hero5, alt: 'Natuurlijke lifestylefoto' },
{ id: 'hero-6', src: hero6, alt: 'Portret in de natuur' },
],
socials: [
{
platform: 'facebook',
href: 'https://www.facebook.com/andreaslopfotografie/',
},
{
platform: 'instagram',
href: 'https://www.instagram.com/andreaslopfotografie/',
},
],
};
export default heroContent;
-30
View File
@@ -1,30 +0,0 @@
import type { SocialPlatform } from './socialPlatforms';
// Vorm van de hero-content. Deze types zijn bewust platte data (strings en
// arrays) zodat ze later 1-op-1 uit de CMS-API kunnen komen.
export interface HeroSlide {
id: string;
src: string;
alt: string;
}
export interface HeroCta {
label: string;
to: string;
}
export interface HeroSocial {
platform: SocialPlatform;
href: string; // leeg = niet tonen
}
export interface HeroContent {
title: string;
// Klein label in hoofdletters boven de titel: wat en waar, voor bezoekers
// en zoekmachines (bv. "Lifestyle fotograaf · Huizen")
tagline: string;
cta: HeroCta;
slides: HeroSlide[];
socials: HeroSocial[];
}

Some files were not shown because too many files have changed in this diff Show More