From c81dcd3979582b9ef29dd56c852e534f85374a1e Mon Sep 17 00:00:00 2001 From: Sluijsens Date: Mon, 19 Oct 2026 23:46:30 +0200 Subject: [PATCH] Adds the inception docs and design for the homepage sections Refreshes the shared reverse engineering docs, adds the requirements, application design and units for the homepage-sections feature, and updates the static design: live prices and form fields, the new Lieve woorden block and the coming-soon gate over the contact form. Co-Authored-By: Claude Opus 5.5 --- .ai/layout-conventions.md | 3 +- LAYOUT.md | 6 +- .../reverse-engineering/api-documentation.md | 79 ++++-- .../reverse-engineering/architecture.md | 109 +++++--- .../reverse-engineering/business-overview.md | 46 ++-- .../code-quality-assessment.md | 31 ++- .../reverse-engineering/code-structure.md | 134 +++++----- .../component-inventory.md | 14 +- .../reverse-engineering/dependencies.md | 70 +++--- .../reverse-engineering-timestamp.md | 9 +- .../reverse-engineering/technology-stack.md | 27 +- aidlc-docs/active-features.md | 1 + .../features/homepage-sections/aidlc-state.md | 82 ++++++ .../features/homepage-sections/audit.md | 235 ++++++++++++++++++ ...festyle-fotografie-code-generation-plan.md | 77 ++++++ .../application-design/application-design.md | 82 ++++++ .../component-dependency.md | 51 ++++ .../application-design/component-methods.md | 115 +++++++++ .../application-design/components.md | 86 +++++++ .../inception/application-design/services.md | 53 ++++ .../unit-of-work-dependency.md | 44 ++++ .../unit-of-work-story-map.md | 26 ++ .../application-design/unit-of-work.md | 65 +++++ .../plans/application-design-plan.md | 94 +++++++ .../inception/plans/execution-plan.md | 157 ++++++++++++ .../inception/plans/unit-of-work-plan.md | 52 ++++ .../requirement-verification-questions.md | 213 ++++++++++++++++ .../inception/requirements/requirements.md | 212 ++++++++++++++++ design/andreaslop-static/assets/css/style.css | 151 +++++++++++ .../andreaslop-static/assets/img/intro-3.jpg | Bin 434968 -> 429849 bytes .../andreaslop-static/assets/img/manifest.txt | 4 +- design/andreaslop-static/assets/js/main.js | 143 +++++++++-- design/andreaslop-static/index.html | 158 +++++++++--- 33 files changed, 2354 insertions(+), 275 deletions(-) create mode 100644 aidlc-docs/features/homepage-sections/aidlc-state.md create mode 100644 aidlc-docs/features/homepage-sections/audit.md create mode 100644 aidlc-docs/features/homepage-sections/construction/plans/lifestyle-fotografie-code-generation-plan.md create mode 100644 aidlc-docs/features/homepage-sections/inception/application-design/application-design.md create mode 100644 aidlc-docs/features/homepage-sections/inception/application-design/component-dependency.md create mode 100644 aidlc-docs/features/homepage-sections/inception/application-design/component-methods.md create mode 100644 aidlc-docs/features/homepage-sections/inception/application-design/components.md create mode 100644 aidlc-docs/features/homepage-sections/inception/application-design/services.md create mode 100644 aidlc-docs/features/homepage-sections/inception/application-design/unit-of-work-dependency.md create mode 100644 aidlc-docs/features/homepage-sections/inception/application-design/unit-of-work-story-map.md create mode 100644 aidlc-docs/features/homepage-sections/inception/application-design/unit-of-work.md create mode 100644 aidlc-docs/features/homepage-sections/inception/plans/application-design-plan.md create mode 100644 aidlc-docs/features/homepage-sections/inception/plans/execution-plan.md create mode 100644 aidlc-docs/features/homepage-sections/inception/plans/unit-of-work-plan.md create mode 100644 aidlc-docs/features/homepage-sections/inception/requirements/requirement-verification-questions.md create mode 100644 aidlc-docs/features/homepage-sections/inception/requirements/requirements.md diff --git a/.ai/layout-conventions.md b/.ai/layout-conventions.md index 4c262a1..514f995 100644 --- a/.ai/layout-conventions.md +++ b/.ai/layout-conventions.md @@ -13,7 +13,7 @@ Used by every page except Shell (see exception below): - If a page needs more blocks than the template currently has letters for, add a new letter/color rather than cycling back to `A` — never reuse a color, since that would visually suggest two different blocks are "the same element." A new color's stroke is always its fill at 25% darker (multiply each RGB channel by 0.75, round, convert back to hex), kept in the same style: medium-high saturation, similar lightness to the existing set. - For two sections that sit side-by-side in one row (e.g. Contact's Photo + Contact form), switch that page's diagram to `columns 2`, give full-width blocks a `:2` span, and place the side-by-side pair as plain unspanned nodes next to each other in the code (no composite container needed) — small manual width tweaks to line them up are fine, it only needs to look "good enough." -Current letter → color template (extend with a new letter using the same formula if a 7th block is ever needed): +Current letter → color template (extend with a new letter using the same formula if an 8th block is ever needed): ``` style A fill:#e76f51,stroke:#ad533d,color:#fff,font-size:16px,width:400px,height:125px,stroke-width:2px @@ -22,6 +22,7 @@ style C fill:#2a9d8f,stroke:#20766b,color:#fff,font-size:16px,width:400px,height style D fill:#264653,stroke:#1d353e,color:#fff,font-size:16px,width:400px,height:125px,stroke-width:2px style E fill:#e9c46a,stroke:#af9350,color:#fff,font-size:16px,width:400px,height:125px,stroke-width:2px style F fill:#b56576,stroke:#884c59,color:#fff,font-size:16px,width:400px,height:125px,stroke-width:2px +style G fill:#6d7fcc,stroke:#525f99,color:#fff,font-size:16px,width:400px,height:125px,stroke-width:2px ``` ## Exception — Shell diff --git a/LAYOUT.md b/LAYOUT.md index 12a734d..23f929a 100644 --- a/LAYOUT.md +++ b/LAYOUT.md @@ -24,8 +24,9 @@ columns 1 B["Highlights"] C["About me"] D["Prices"] - E["Contact"] - F["Instagram"] + E["Testimonials"] + F["Contact"] + G["Instagram"] style A fill:#e76f51,stroke:#ad533d,color:#fff,font-size:16px,width:400px,height:125px,stroke-width:2px style B fill:#f4a261,stroke:#b77a49,color:#fff,font-size:16px,width:400px,height:125px,stroke-width:2px @@ -33,6 +34,7 @@ columns 1 style D fill:#264653,stroke:#1d353e,color:#fff,font-size:16px,width:400px,height:125px,stroke-width:2px style E fill:#e9c46a,stroke:#af9350,color:#fff,font-size:16px,width:400px,height:125px,stroke-width:2px style F fill:#b56576,stroke:#884c59,color:#fff,font-size:16px,width:400px,height:125px,stroke-width:2px + style G fill:#6d7fcc,stroke:#525f99,color:#fff,font-size:16px,width:400px,height:125px,stroke-width:2px ``` ## About me diff --git a/aidlc-docs/_shared/reverse-engineering/api-documentation.md b/aidlc-docs/_shared/reverse-engineering/api-documentation.md index 266e6be..092fb41 100644 --- a/aidlc-docs/_shared/reverse-engineering/api-documentation.md +++ b/aidlc-docs/_shared/reverse-engineering/api-documentation.md @@ -1,42 +1,67 @@ # 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 }` +None. There is no back-end yet (`api/` is empty). The static design README anticipates these endpoints on a .NET API: +- `POST /api/contact` — contact form, payload `{ naam, email, onderwerp, bericht }` (maps to a C# `ContactRequest` record) - `/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 | +| Path | File | Head | Component | Indexed | +|------|------|------|-----------|---------| +| (root) | `routes/__root.tsx` | `siteHead(siteContent)` | `AppShell` | — | +| `/` | `routes/index.tsx` | `pageHead('/')` | `Hero` | yes | +| `/over-mij` | `routes/over-mij.tsx` | `pageHead(...)` | `PageIntro` placeholder | no | +| `/portfolio` | `routes/portfolio.tsx` | `pageHead(...)` | `PageIntro` placeholder | no | +| `/soorten-fotoshoots` | `routes/soorten-fotoshoots.tsx` | `pageHead(...)` | `PageIntro` placeholder | no | +| `/contact` | `routes/contact.tsx` | `pageHead(...)` | `PageIntro` placeholder | no | +| `/privacyverklaring` | `routes/privacyverklaring.tsx` | `pageHead(...)` | `PageIntro` placeholder | no | +| (not found) | — | — | `NotFound` | — | -### seo.ts -- **Methods**: `pageHead({ title: string, description: string })` → `{ meta: [...] }`; `siteHead` constant -- **Return Types**: TanStack Router `head` option object (title, description, og:title, og:description) +### seo.ts / sitePages.ts / sitemap.ts +- `pageHead(path: RoutePath)` → `{ meta, links }` (title, description, robots noindex if not indexed, OG tags, canonical) +- `siteHead(content: SiteContent)` → `{ meta, scripts }` (OG basics, JSON-LD ProfessionalService) +- `canonicalUrl(path, base?)`, `jsonLdScript(data)`, `professionalService(content)` +- `sitePages: Record`, `pageList(pages)` +- `sitemapXml(...)` — used by `config/sitemapPlugin.ts` ### Components (props) -- `AppShell()` — no props -- `NavigationBar()` — no props; reads route via `useRouterState`, scroll via `useScrolledPast` -- `NavLink(props: ComponentProps)` -- `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[] })` +- `AppShell()`, `NavigationBar()`, `BackToTop()`, `NotFound()` — no props +- `MobileNav({ id, open, onClose })`, `NavLink(RouterLink props)` +- `Footer({ content: SiteContent })`, `FooterColumn({ title, children })`, `FooterLink(LinkProps)` +- `Hero({ content: HeroContent, socials: SocialLink[] })`, `HeroArrows({ onPrev, onNext })`, `HeroPauseButton({ stopped, onToggle })`, `HeroSocials({ socials })` +- `PageIntro({ title, eyebrow?, children? })` — renders the page's only h1 +- `StatusPage({ title, children, actions? })`, `ErrorPage({ error, reset })` +- `LinkButton(RouterLink props & { variant?: 'outline' | 'accent' | 'light' })` +- `UmamiAnalytics({ hostname? })` ### 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 }` +- `useHeroSlider(count)` → slider state, controls, handlers, `HeroAnnouncement` +- `useScrolledPast(getThreshold)` → boolean (stable `getThreshold` required) +- `useRouteFocus()` — focuses `
` after navigation + +### Pure helpers (`lib/`) +- `emailAddress({ user, domain }): string | null` +- `visibleSocials(socials): SocialLink[]` — only valid https links +- `copyrightLine(year): string` +- `slidesToLoad(active, count): number[]` +- `backToTopThreshold(viewportHeight): number` + +### Monitoring +- `monitoringFor(hostname): Monitoring | null`, `startSentry(hostname?)`, `reportError(error)` ## 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 +### SiteContent (`content/types.ts`) +- **Fields**: `footerIntro: string`, `socials: SocialLink[]`, `email: EmailAddress` +### SocialLink +- **Fields**: `platform: SocialPlatform` (`facebook` | `instagram`), `href: string` +- **Validation**: shown only if `href` is a valid https URL +### EmailAddress +- **Fields**: `user`, `domain` — assembled only in the browser; invalid parts → hidden +### HeroContent +- **Fields**: `title`, `tagline`, `cta: { label, to }`, `slides: { id, src, alt }[]` +### NavItem (`navigation.ts`) +- **Fields**: `to: RoutePath`, `label: string` +### PageMeta (`sitePages.ts`) +- **Fields**: `title`, `description`, `indexed`, `ogImage?` diff --git a/aidlc-docs/_shared/reverse-engineering/architecture.md b/aidlc-docs/_shared/reverse-engineering/architecture.md index f074cc4..1cadd60 100644 --- a/aidlc-docs/_shared/reverse-engineering/architecture.md +++ b/aidlc-docs/_shared/reverse-engineering/architecture.md @@ -1,79 +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. +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 system (tokens from the static design). There is no back-end, API or database; `api/` is an empty placeholder for the planned .NET API. Content lives in typed TypeScript modules under `web/src/content/`, shaped so the API can later deliver it 1-to-1. One build serves both environments; the hostname decides whether monitoring is active. ## Architecture Diagram ```mermaid graph TD - Main["main.tsx: ChakraProvider + ThemeProvider + RouterProvider"] --> Root["routes/__root.tsx: HeadContent + AppShell + Devtools"] + Main["main.tsx: Sentry start, router, ChakraProvider"] --> Root["routes/__root.tsx: HeadContent, AppShell, 404 and error components"] Root --> Shell["components/AppShell.tsx"] - Shell --> Nav["NavigationBar (+ NavLink, MobileNav, navItems)"] + Shell --> Skip["SkipNavLink and main landmark"] + Shell --> Nav["NavigationBar (NavLink, MobileNav)"] Shell --> Outlet["Outlet (active page route)"] - Shell --> Footer["Footer (placeholder)"] + Shell --> Footer["Footer (FooterColumn, FooterLink)"] + Shell --> ToTop["BackToTop"] + Shell --> Umami["UmamiAnalytics"] 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 + Outlet --> Placeholders["over-mij, portfolio, soorten-fotoshoots, contact, privacyverklaring: PageIntro"] + Home --> Hero["Hero (HeroArrows, HeroPauseButton, HeroSocials, useHeroSlider)"] + Content["content/: siteContent, heroContent, types"] -.-> Shell + Content -.-> Home + Nav --> NavData["navigation.ts: mainNav, footerNav"] + Footer --> NavData + Seo["seo.ts + sitePages.ts"] -.-> Root Seo -.-> Home + Theme["theme.ts + recipes/"] -.-> Main 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; + class Shell,Skip,Nav,Footer,ToTop,Umami,Outlet shell; + class Home,Placeholders,Hero page; + class Content,NavData,Seo,Theme 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. +Text alternative: main.tsx starts Sentry and mounts the router; the root route renders AppShell (skip link, NavigationBar, the page via Outlet, Footer, BackToTop, Umami); the home route renders the Hero, the other routes render placeholder PageIntros; content, navigation, SEO and theme modules 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 +- **Responsibilities**: Starts Sentry (deferred), creates the router (scroll restoration, default error component), mounts ChakraProvider (light only), loads self-hosted fonts, removes static fallback head tags - **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 +- **Responsibilities**: Site-wide head (`siteHead`: OG basics + JSON-LD), `HeadContent`, `AppShell`, dev-only router devtools, `NotFound` and `ErrorPage` - **Type**: Application ### components/AppShell.tsx -- **Purpose**: Application shell -- **Responsibilities**: Renders NavigationBar, ``, Footer. No `
` landmark, skip link or to-top button yet +- **Purpose**: Application shell (LAYOUT.md "Shell") +- **Responsibilities**: Skip link + `
`, NavigationBar, Outlet, Footer, BackToTop, UmamiAnalytics; moves focus to main on route change (`useRouteFocus`) - **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) +- **Responsibilities**: Fixed header, transparent over the hero on desktop until scrolled; shrinks after scroll; logo links home; desktop links and full-screen mobile menu from `mainNav` - **Type**: Application -### components/Footer.tsx +### components/Footer/ - **Purpose**: Site footer -- **Responsibilities**: Placeholder copyright line only; uses Tailwind-style `className`s that have no effect (Tailwind is not installed) +- **Responsibilities**: Logo + intro text, Socials column, Contact column (e-mail assembled in the browser), copyright line, footer menu from `footerNav`; empty columns are omitted - **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 +- **Purpose**: Homepage hero slider (the only homepage section so far) +- **Responsibilities**: Crossfade slides, progress-driven autoplay, arrows, swipe, pause button, pause on hover/focus/hidden tab, reduced motion, live-region announcements, lazy loading of nearby slides, social 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) +### components/PageIntro/, StatusPage/ +- **Purpose**: Shared page building blocks +- **Responsibilities**: `PageIntro` — eyebrow, the page's h1 and an intro (used by placeholders); `StatusPage` — layout for 404 and error pages +- **Type**: Application -### seo.ts -- **Purpose**: Head tag helpers -- **Responsibilities**: `pageHead({title, description})` for route `head` options; `siteHead` for site-wide Open Graph tags -- **Type**: Application (utility) +### content/ +- **Purpose**: Static content until the CMS API exists +- **Responsibilities**: `types.ts` (API-shaped interfaces), `siteContent.ts` (footer intro, socials, e-mail parts), `heroContent.ts` (title, tagline, CTA, slides), `socialPlatforms.ts` (platform → name + offline icon) +- **Type**: Application (data) + +### lib/ +- **Purpose**: Pure, fully tested helpers +- **Responsibilities**: `emailAddress`, `visibleSocials`, `copyrightLine`, `slidesToLoad`, `backToTopThreshold` +- **Type**: Application (utility, 100% coverage threshold) + +### seo.ts, sitePages.ts, sitemap.ts +- **Purpose**: SEO +- **Responsibilities**: Page registry (title, description, `indexed`), `pageHead(path)`, canonical URLs, JSON-LD, sitemap generation at build time (via `config/sitemapPlugin.ts`) +- **Type**: Application (utility, 100% coverage threshold) + +### monitoring/ +- **Purpose**: Error reporting and analytics configuration +- **Responsibilities**: Hostname → environment map, Sentry DSN and origins; Sentry loaded after the load event with a queue +- **Type**: Application + +### config/ (build-time, Node) +- **Purpose**: Server configuration as code +- **Responsibilities**: `securityHeaders.ts` (CSP + headers for dev/preview/prod), `serverConfig.ts` (generates `deploy/iis/web.config` and nginx confs; a test checks they are in sync), sitemap plugin, test seed +- **Type**: Infrastructure-as-code (small) + +### theme.ts / recipes/ +- **Purpose**: Design system +- **Responsibilities**: Colour, font, spacing, easing, duration, z-index tokens; semantic `bg`/`fg`/`focusRing`, `header`/`content`/`pageTop` sizes; `eyebrow`/`display`/`pageTitle` text styles; recipes `container`, `link` (subtle), `linkButton` (outline/accent/light), `iconControl`, `skipNavLink` +- **Type**: Application (shared UI foundation) ## Data Flow @@ -90,18 +118,19 @@ sequenceDiagram 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 + P-->>R: head() title and meta from sitePages + R-->>V: Updated page, head tags, focus on main ``` -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. +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 from the page registry and focus moves to main. ## Integration Points -- **External APIs**: None yet (planned .NET API for content and contact form) +- **External APIs**: None yet (planned .NET API for content and the contact form — design README: `POST /api/contact` with `{ naam, email, onderwerp, bericht }`) - **Databases**: None -- **Third-party Services**: Outbound links only — Facebook, Instagram profiles +- **Third-party Services**: Sentry (errors, EU ingest), Umami at analytics.slpsoftware.nl (cookieless stats), UptimeRobot (availability, external), outbound links to Facebook/Instagram ## Infrastructure Components -- **CDK Stacks**: None -- **Deployment Model**: Not defined yet; output is a static Vite build (`dist/`) +- **IaC**: None beyond generated web server configs in `web/deploy/` +- **Deployment Model**: Static `dist/` build. Test: scp to nginx on a Raspberry Pi (auto on push to master). Production: FTPS to an IIS webhost (manual, `release/*` only, after Lighthouse) +- **Security headers**: Strict CSP — `script-src 'self'` + Umami, `connect-src 'self'` + Umami + Sentry, **`form-action 'self'`**, `frame-ancestors 'none'`. Any third-party form or script endpoint must be added here (and regenerated into the server configs) - **Networking**: N/A diff --git a/aidlc-docs/_shared/reverse-engineering/business-overview.md b/aidlc-docs/_shared/reverse-engineering/business-overview.md index aa97249..c91fb1e 100644 --- a/aidlc-docs/_shared/reverse-engineering/business-overview.md +++ b/aidlc-docs/_shared/reverse-engineering/business-overview.md @@ -7,7 +7,9 @@ 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)"] + Site --> Mail["E-mail (mailto, address assembled in the browser)"] + Site --> Umami["Umami (cookieless visitor stats)"] + Site --> Sentry["Sentry (JS error reports)"] Owner["Andrea (photographer, content owner)"] -.-> CMS["Planned .NET API / CMS"] CMS -.-> Site classDef person fill:#f6e05e,stroke:#c05621,stroke-width:1px,color:#000; @@ -16,32 +18,46 @@ graph LR 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 Social,Mail,Umami,Sentry 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. +Text alternative: visitors and crawlers use the website, which links out to social profiles and e-mail and reports to Umami and Sentry; 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 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 will replace the existing WordPress (Solene theme) site at andreaslop.nl; a test build runs at test.andreaslop.nl. +- **Business Transactions** (current state — front-end only, no back-end): + - **Browse the homepage** — hero slider with featured photos (autoplay, arrows, swipe, pause button, screen reader announcements), call-to-action to "Over mij" + - **Navigate between pages** — header navigation (desktop), full-screen menu (mobile), footer menu, skip link, back-to-top button + - **Visit social profiles** — Facebook / Instagram links in the hero and footer + - **E-mail the photographer** — mailto link in the footer + - **Share / discover pages** — per-page title, description, canonical URL, Open Graph tags, JSON-LD (ProfessionalService), sitemap.xml, robots.txt + - **Recover from errors** — 404 page inside the shell, error page with retry + - *Placeholder pages (noindex)*: Over mij, Portfolio, Soorten fotoshoots, Contact, Privacyverklaring + - *Planned (static design only)*: homepage sections below the hero (lifestyle gallery, about, prices, contact form, Instagram), portfolio with lightbox, shoot types and pricing page, contact page - **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) + - **Highlights / Lifestyle fotografie** — homepage intro section with a four-photo gallery + - **Package (pakket)** — a priced shoot offer (Newborn, Zwangerschap, Loveshoot) with what is included - **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 + - **Info menu / side area** — slide-in panel from the design (out of scope, by owner decision) + - **CMS** — the planned .NET API that will provide page content and receive the contact form; content is hard-coded in `web/src/content/` until then + - **Placeholder page** — a route that exists for navigation but shows "in de maak" and is `noindex` ## 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) +- **Responsibilities**: Page routing, layout shell, homepage hero, SEO, monitoring, design system, server configuration for test (nginx) and production (IIS) + +### .gitea/workflows (CI/CD) +- **Purpose**: Quality gate and delivery +- **Responsibilities**: Lint, format, tests, build, audit, Lighthouse; deploy to test on merge to master; deploy to production manually from `release/*` ### 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 +- **Purpose**: Static HTML/CSS/JS rebuild of the live site, the visual and structural source of truth +- **Responsibilities**: Defines page sections, markup, design tokens and interactions to port to React + +### api (planned) +- **Purpose**: .NET back-end for content and the contact form +- **Responsibilities**: None yet — the folder is empty diff --git a/aidlc-docs/_shared/reverse-engineering/code-quality-assessment.md b/aidlc-docs/_shared/reverse-engineering/code-quality-assessment.md index 84b1359..3a446c4 100644 --- a/aidlc-docs/_shared/reverse-engineering/code-quality-assessment.md +++ b/aidlc-docs/_shared/reverse-engineering/code-quality-assessment.md @@ -1,26 +1,23 @@ # 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 +- **Overall**: Good. Vitest with v8 coverage; 100% threshold enforced for `src/lib/**`, `src/seo.ts`, `src/sitemap.ts`; other files reported +- **Unit Tests**: Pure helpers, SEO, sitemap, monitoring config, security headers, server config (incl. drift check against `deploy/`) +- **Component Tests**: AppShell, NavigationBar, Footer, Hero (+ slider hook), BackToTop, PageIntro, StatusPage, Umami — with axe accessibility checks +- **Property-based Tests**: fast-check, shared arbitraries in `src/test/arbitraries.ts`, seed logged in CI +- **Integration / E2E**: No browser E2E; Lighthouse CI covers built pages (accessibility, best practices, SEO, performance) ## 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 +- **Linting**: ESLint (typescript-eslint, react-hooks, jsx-a11y), enforced in CI +- **Code Style**: Consistent, Prettier-enforced in CI +- **Documentation**: Short Dutch comments explaining *why*, often referencing requirement IDs (FR-xx, BR-xx, NFR-xx, Mx) from earlier AI-DLC features ## 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 `
` 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` +- Homepage mobile Lighthouse performance target is lowered to 0.8 (images not responsive, title after JavaScript); back to 0.9 is planned with responsive images from the API and prerendering +- Five routes are placeholders (`noindex`); `lighthouserc.cjs` keeps its own list of indexed/noindex paths, guarded by a test against `sitePages.ts` +- Static design images for the homepage sections (intro gallery, about photo, pricing decorations) are not yet in `web/src/assets` +- No responsive image pipeline (srcset/sizes); hero photos are single large JPEGs ## 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 +- **Good Patterns**: API-shaped content; pure, property-tested helpers; tokens and recipes as single source of truth; configuration as code for headers; strong accessibility baseline (axe in tests, Lighthouse accessibility 1.0) +- **Anti-patterns**: None significant found diff --git a/aidlc-docs/_shared/reverse-engineering/code-structure.md b/aidlc-docs/_shared/reverse-engineering/code-structure.md index 5b4edd6..8e10821 100644 --- a/aidlc-docs/_shared/reverse-engineering/code-structure.md +++ b/aidlc-docs/_shared/reverse-engineering/code-structure.md @@ -1,12 +1,15 @@ # Code Structure ## Build System -- **Type**: npm-compatible via **pnpm** (lockfile `web/pnpm-lock.yaml`) +- **Type**: pnpm (`packageManager: pnpm@12.11.2`, 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/package.json` — scripts `dev`, `build` (`tsc && vite build`), `preview`, `test` (vitest + coverage), `lint`, `format:check`, `audit:deps`, `audit:dev`, `lighthouse`, `server-config`, and `check` (all of them in sequence) + - `web/vite.config.ts` — TanStack Router plugin (`autoCodeSplitting`) before React plugin, sitemap plugin, security headers on dev/preview, Vitest config (jsdom, 20 s timeout, 100% coverage threshold for `src/lib/**`, `seo.ts`, `sitemap.ts`) + - `web/tsconfig.json` — bundler mode, `@/*` → `src/*` + - `web/eslint.config.js` — JS + typescript-eslint + react-hooks + jsx-a11y recommended - `web/.prettierrc` — 4 spaces, single quotes, semicolons + - `web/lighthouserc.cjs` / `.desktop.cjs` — Lighthouse CI against `pnpm preview` (accessibility and best practices 1.0, performance 0.9; home mobile 0.8) + - `.gitea/workflows/continuous_integration.yaml` — jobs `check`, `deploy-test`, `lighthouse`, `deploy-production` ## Key Classes/Modules @@ -14,80 +17,97 @@ graph TD Root["routes/__root.tsx"] --> AppShell["components/AppShell.tsx"] AppShell --> NavigationBar["NavigationBar/NavigationBar.tsx"] - AppShell --> Footer["components/Footer.tsx"] + AppShell --> Footer["Footer/Footer.tsx"] + AppShell --> BackToTop["BackToTop/BackToTop.tsx"] + AppShell --> Umami["Analytics/UmamiAnalytics.tsx"] NavigationBar --> NavLink["NavigationBar/NavLink.tsx"] NavigationBar --> MobileNav["NavigationBar/MobileNav.tsx"] - NavigationBar --> navItems["NavigationBar/navItems.ts"] - MobileNav --> navItems - NavigationBar --> useScrolledPast["hooks/useScrolledPast.tsx"] + NavigationBar --> navigation["navigation.ts"] + Footer --> navigation Index["routes/index.tsx"] --> Hero["Hero/Hero.tsx"] Hero --> HeroArrows["Hero/HeroArrows.tsx"] + Hero --> HeroPause["Hero/HeroPauseButton.tsx"] Hero --> HeroSocials["Hero/HeroSocials.tsx"] Hero --> useHeroSlider["Hero/useHeroSlider.ts"] Hero --> LinkButton["components/LinkButton.tsx"] - HeroSocials --> socialPlatforms["Hero/socialPlatforms.ts"] + LinkButton --> RouterLink["components/RouterLink.tsx"] + Placeholder["routes/contact.tsx and other placeholders"] --> PageIntro["PageIntro/PageIntro.tsx"] 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; + class Root,AppShell,NavigationBar,Footer,BackToTop,Umami,NavLink,MobileNav shell; + class Index,Hero,HeroArrows,HeroPause,HeroSocials,Placeholder,PageIntro page; + class navigation,useHeroSlider,LinkButton,RouterLink 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. +Text alternative: the root route renders AppShell (NavigationBar, Footer, BackToTop, Umami); NavigationBar and Footer read navigation.ts; the index route renders the Hero with its sub-components and LinkButton; placeholder routes render PageIntro. ### 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 +Candidates for modification are marked with ★ for the homepage-sections feature. +- `web/index.html` — HTML entry; static fallback head for non-JS crawlers +- `web/src/main.tsx` — bootstrap +- `web/src/routeTree.gen.ts` — generated (do not edit) +- `web/src/routes/__root.tsx` — root layout, site head, 404/error +- ★ `web/src/routes/index.tsx` — home (`/`), currently only the Hero +- `web/src/routes/{over-mij,portfolio,soorten-fotoshoots,contact,privacyverklaring}.tsx` — placeholders with `PageIntro` +- `web/src/components/AppShell.tsx` — shell +- `web/src/components/NavigationBar/*` — header, NavLink, MobileNav +- `web/src/components/Footer/*` — footer, FooterColumn, FooterLink +- `web/src/components/Hero/*` — hero slider, arrows, pause button, socials, slider hook +- `web/src/components/BackToTop/BackToTop.tsx` — back-to-top button +- `web/src/components/Analytics/UmamiAnalytics.tsx` — Umami script injection +- `web/src/components/PageIntro/PageIntro.tsx` — page head block (eyebrow, h1, intro) +- `web/src/components/StatusPage/*` — StatusPage layout, NotFound, ErrorPage +- `web/src/components/LinkButton.tsx`, `RouterLink.tsx` — router links (button style / Chakra-wrapped) +- ★ `web/src/content/types.ts` — content interfaces (API shape) +- ★ `web/src/content/siteContent.ts`, `heroContent.ts`, `socialPlatforms.ts` — static content +- `web/src/hooks/useRouteFocus.ts`, `useScrolledPast.tsx` +- `web/src/lib/*.ts` — pure helpers with tests +- `web/src/monitoring/*` — Sentry/Umami config and loader +- `web/src/navigation.ts` — `RoutePath`, `mainNav`, `footerNav` +- ★ `web/src/seo.ts`, `sitePages.ts`, `sitemap.ts` — SEO (home description may change) +- `web/src/theme.ts`, `web/src/recipes/*.ts` — design system +- `web/src/test/*` — `renderWithProviders`, axe matcher, fast-check arbitraries, setup +- `web/src/assets/*` — hero photos (8), light/dark logos +- ★ `web/config/securityHeaders.ts` — CSP (only if the contact form posts to a third party) +- `web/config/serverConfig.ts`, `writeServerConfig.ts`, `sitemapPlugin.ts`, `testSeed.ts` +- `web/deploy/iis/web.config`, `web/deploy/nginx/*.conf` — generated server configs +- `web/public/*` — favicon, logo, og-image, robots.txt, icons.svg ## 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)` +### API-shaped static content +- **Location**: `content/types.ts` + `content/*.ts` +- **Purpose**: Hard-coded today, swappable for API responses later +- **Implementation**: Plain data objects typed with interfaces, passed to components as props from the route (or AppShell) + +### Pure helpers with property-based tests +- **Location**: `lib/`, `seo.ts`, `sitemap.ts` +- **Purpose**: Logic that decides what is shown (e.g. invalid social → hidden, invalid e-mail → column omitted) lives outside components and is tested with fast-check +- **Implementation**: Small exported functions, 100% coverage threshold, shared arbitraries in `test/arbitraries.ts` ### Design tokens + recipes -- **Location**: theme.ts, 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 +### Page registry +- **Location**: `sitePages.ts`, typed by `RoutePath` +- **Purpose**: One source for head tags and the sitemap; `indexed: false` for placeholders -### Route-level head management -- **Location**: seo.ts, each route's `head` option, `HeadContent` in root -- **Purpose**: Per-page SEO without SSR +### Configuration as code for hosting +- **Location**: `config/securityHeaders.ts` → `config/serverConfig.ts` → `deploy/` +- **Purpose**: Same headers in dev, preview, nginx (test) and IIS (production); a test guards drift + +### Accessibility by default +- **Location**: across components; `test/axe.ts` in component tests; Lighthouse in CI +- **Implementation**: landmarks, skip link, focus management, live regions, visible focus ring, 44px targets, reduced motion ## 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) +### @chakra-ui/react ^3.37.0 +- **Usage**: All layout and styling; typegen from `theme.ts` on install +### @tanstack/react-router ^1.170.39 (+ router-plugin ^1.168.40) +- **Usage**: File-based routes, `Link`, `Outlet`, `HeadContent`, typed `RoutePath` +### @sentry/react ^11.8.0 +- **Usage**: Error reporting, lazy-loaded after the load event +### @iconify/react ^6.0.2 + @iconify-icons/ant-design 2.0.1 +- **Usage**: Offline icons (bundled at build time) diff --git a/aidlc-docs/_shared/reverse-engineering/component-inventory.md b/aidlc-docs/_shared/reverse-engineering/component-inventory.md index e1ae827..4b2e9a3 100644 --- a/aidlc-docs/_shared/reverse-engineering/component-inventory.md +++ b/aidlc-docs/_shared/reverse-engineering/component-inventory.md @@ -4,21 +4,23 @@ - `web` — React 19 SPA (Vite, Chakra UI v3, TanStack Router): the public website ## Infrastructure Packages -- None (no IaC, Docker, or CI/CD configuration present) +- `.gitea/workflows/continuous_integration.yaml` — Gitea Actions CI/CD (check, lighthouse, deploy-test, deploy-production) +- `web/config/` + `web/deploy/` — security headers and generated nginx (test) / IIS (production) configuration ## Shared Packages -- None as separate packages. Inside `web`, shared modules are `theme.ts`, `recipes/`, `seo.ts`, `hooks/`, `components/LinkButton.tsx` +- None as separate packages. Inside `web`: `theme.ts`, `recipes/`, `content/`, `lib/`, `seo.ts`, `navigation.ts`, `hooks/`, `components/LinkButton.tsx`, `components/RouterLink.tsx`, `components/PageIntro/` ## Test Packages -- None +- None as separate packages. Tests are co-located (`*.test.ts(x)`) and run with Vitest (unit, component, property-based with fast-check, accessibility with axe-core); Lighthouse CI for quality budgets ## Reference (non-code) - `design/andreaslop-static` — static HTML/CSS/JS design reference (not built or deployed) - `design/AndreaSlopFotografie_React.zip` — archive of design files +- `api/` — empty placeholder for the planned .NET API ## Total Count -- **Total Packages**: 1 +- **Total Packages**: 1 (plus CI workflow and server config) - **Application**: 1 -- **Infrastructure**: 0 +- **Infrastructure**: 1 (CI/CD + server config, inside the repo) - **Shared**: 0 -- **Test**: 0 +- **Test**: 0 (co-located) diff --git a/aidlc-docs/_shared/reverse-engineering/dependencies.md b/aidlc-docs/_shared/reverse-engineering/dependencies.md index be326f4..0934c67 100644 --- a/aidlc-docs/_shared/reverse-engineering/dependencies.md +++ b/aidlc-docs/_shared/reverse-engineering/dependencies.md @@ -4,51 +4,51 @@ ```mermaid graph LR - routes["routes/*"] --> components["components/*"] - routes --> seo["seo.ts"] + main["main.tsx"] --> theme["theme.ts + recipes"] + main --> routes["routes/*"] + main --> monitoring["monitoring/*"] + routes --> components["components/*"] + routes --> content["content/*"] + routes --> seo["seo.ts + sitePages.ts"] + components --> lib["lib/*"] components --> hooks["hooks/*"] - components --> theme["theme.ts tokens (via Chakra props)"] + components --> navigation["navigation.ts"] components --> assets["assets/*"] - main["main.tsx"] --> theme - main --> routes + config["config/* (Node, build time)"] --> monitoring + config --> seo classDef app fill:#63b3ed,stroke:#2b6cb0,stroke-width:1px,color:#000; classDef support fill:#e2e8f0,stroke:#4a5568,stroke-width:1px,color:#000; + classDef build fill:#f6e05e,stroke:#c05621,stroke-width:1px,color:#000; class main,routes,components app; - class seo,hooks,theme,assets support; + class theme,monitoring,content,seo,lib,hooks,navigation,assets support; + class config build; ``` -Text alternative: main depends on theme and routes; routes depend on components and seo; components depend on hooks, theme tokens and assets. +Text alternative: main depends on theme, routes and monitoring; routes depend on components, content and SEO; components depend on lib, hooks, navigation and assets; build-time config reads monitoring (CSP origins) and SEO (sitemap). -### routes depend on components +### routes depend on content and components - **Type**: Compile -- **Reason**: Routes render AppShell (root) and page components +- **Reason**: Routes pass static content objects into components as props + +### config depends on monitoring/config.ts +- **Type**: Build time (Node) +- **Reason**: CSP `script-src`/`connect-src` include the Umami and Sentry origins; that file therefore has no Vite imports ### 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 +- **Type**: Runtime (string token references such as `bg="paper.alt"`, `textStyle="eyebrow"`) ## 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 +### @chakra-ui/react ^3.37.0, @emotion/react ^11.14.0 +- **Purpose**: Styling system and UI primitives — **License**: MIT +### @tanstack/react-router ^1.170.39 +- **Purpose**: Routing — **License**: MIT +### react / react-dom ^19.3.0 +- **Purpose**: UI runtime — **License**: MIT +### @sentry/react ^11.8.0 +- **Purpose**: Error reporting — **License**: MIT +### @fontsource/jost, @fontsource/marcellus ^5.3.0 +- **Purpose**: Self-hosted fonts — **License**: OFL-1.1 +### @iconify/react ^6.0.2, @iconify-icons/ant-design 2.0.1 (dev) +- **Purpose**: Icons, bundled at build time — **License**: MIT +### Dev tooling +- Vite, Vitest, Testing Library, fast-check, axe-core, ESLint, Prettier, Lighthouse CI, Chakra CLI — all MIT/Apache-2.0/MPL-2.0 (axe-core) diff --git a/aidlc-docs/_shared/reverse-engineering/reverse-engineering-timestamp.md b/aidlc-docs/_shared/reverse-engineering/reverse-engineering-timestamp.md index 322cecb..10d73a9 100644 --- a/aidlc-docs/_shared/reverse-engineering/reverse-engineering-timestamp.md +++ b/aidlc-docs/_shared/reverse-engineering/reverse-engineering-timestamp.md @@ -1,10 +1,11 @@ # Reverse Engineering Metadata -**Analysis Date**: 2026-10-14T09:58:04Z +**Analysis Date**: 2026-10-19T19:19:38Z (refresh; previous analysis 2026-10-14T09:58:04Z at 8f5841c) **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) +**Workspace**: K:\Development\SlpSoftware\Projects\AndreaSlopFotografie +**Codebase Commit**: 38c5c3e (branch master) +**Total Files Analyzed**: ~95 (web/src, web/config, web/deploy, web config files, CI workflow, design/andreaslop-static pages and README) +**Refreshed for**: feature homepage-sections ## Artifacts Generated - [x] business-overview.md diff --git a/aidlc-docs/_shared/reverse-engineering/technology-stack.md b/aidlc-docs/_shared/reverse-engineering/technology-stack.md index 0ca9cee..4238e48 100644 --- a/aidlc-docs/_shared/reverse-engineering/technology-stack.md +++ b/aidlc-docs/_shared/reverse-engineering/technology-stack.md @@ -1,28 +1,37 @@ # Technology Stack ## Programming Languages -- TypeScript — ~6.0.2 — all application code (TSX) +- TypeScript — ~6.0.2 — all application, config and test 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) +- TanStack Router — ^1.170.39 — file-based routing, head management (devtools ^1.167.2, dev only) - @fontsource/jost, @fontsource/marcellus — ^5.3.0 — self-hosted fonts - @iconify/react ^6.0.2 + @iconify-icons/ant-design 2.0.1 — offline icons +- @sentry/react — ^11.8.0 — error reporting ## Infrastructure -- None yet; static build output suitable for any static host +- Gitea Actions — CI/CD (runners: Raspberry Pi arm64 and a pc) +- nginx on Raspberry Pi — test environment (test.andreaslop.nl) +- IIS at a webhost via FTPS — production (andreaslop.nl) +- Sentry (SaaS, EU), Umami (self-hosted, analytics.slpsoftware.nl), UptimeRobot — monitoring ## Build Tools - Vite — ^8.3.0 — dev server and bundler -- @vitejs/plugin-react — ^6.1.1 +- @vitejs/plugin-react — ^6.1.2 - @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 +- pnpm — 12.11.2 — package manager +- Node — 24 (CI) -## Testing Tools -- None configured (no test runner, no linter such as ESLint) +## Quality and Testing Tools +- Vitest ^5.0.5 + @vitest/coverage-v8 — unit and component tests, coverage thresholds +- @testing-library/react ^16.3.3, user-event, jest-dom, jsdom ^30.1.3 +- fast-check ^4.10.2 — property-based tests +- axe-core ^4.14.0 — accessibility checks in component tests +- ESLint ^9.39.5 + typescript-eslint, react-hooks, jsx-a11y +- Prettier ^3.9.9 +- @lhci/cli ^0.15.1 — Lighthouse CI (mobile and desktop) diff --git a/aidlc-docs/active-features.md b/aidlc-docs/active-features.md index 490ca3d..70ddf97 100644 --- a/aidlc-docs/active-features.md +++ b/aidlc-docs/active-features.md @@ -4,3 +4,4 @@ |------|------|--------|--------|---------------------|---------------| | Bug | [hero-carousel-announce-and-pause](bugs/hero-carousel-announce-and-pause/bug-fix.md) | ✅ Complete | fix/hero-carousel-announce-and-pause | web/src/components/Hero (Hero, HeroArrows, useHeroSlider) | 2026-10-19 | | Feature | frontend-shell | ✅ Complete | 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 | +| Feature | homepage-sections | 🔵 Inception | feature/homepage-sections | web/src/routes/index.tsx, new homepage section components, web/src/content (types + static content), possibly web/config/securityHeaders.ts (contact form) | 2026-10-19 | diff --git a/aidlc-docs/features/homepage-sections/aidlc-state.md b/aidlc-docs/features/homepage-sections/aidlc-state.md new file mode 100644 index 0000000..9a2974c --- /dev/null +++ b/aidlc-docs/features/homepage-sections/aidlc-state.md @@ -0,0 +1,82 @@ +# AI-DLC State Tracking + +## Project Information +- **Feature Name**: Homepage sections below the hero (Lifestyle photography, About me, Prices, Lieve woorden, Contact, Instagram) +- **Feature Slug**: homepage-sections +- **Project Type**: Brownfield +- **Start Date**: 2026-10-19T19:19:38Z +- **Current Stage**: CONSTRUCTION - Unit 1 Lifestyle fotografie - Code Generation (planning) +- **Branch**: feature/homepage-sections (to be created before Code Generation) + +## Workspace State +- **Existing Code**: Yes +- **Programming Languages**: TypeScript (React/TSX) +- **Build System**: pnpm + Vite (`tsc && vite build`), Gitea Actions CI +- **Project Structure**: Single front-end SPA in `web/`; static HTML design reference in `design/andreaslop-static/`; `api/` folder present but empty (.NET back-end planned) +- **Reverse Engineering Needed**: Yes (refresh — artifacts stale since commit 8f5841c) +- **Workspace Root**: K:\Development\SlpSoftware\Projects\AndreaSlopFotografie + +## Code Location Rules +- **Application Code**: Workspace root (NEVER in aidlc-docs/) — front-end lives in `web/` +- **Feature Documentation**: aidlc-docs/features/homepage-sections/ only +- **Shared Artifacts**: aidlc-docs/_shared/ +- **Structure patterns**: See code-generation.md Critical Rules + +## Language Configuration +- **Documentation Language**: English +- **Conversation Language**: User Language (Dutch) +- **Source**: inherited from aidlc-docs/language-preference.md (answer A); user may override + +## Extension Configuration +| Extension | Enabled | Decided At | +|---|---|---| +| Security Baseline | Yes | Requirements Analysis | +| Property-Based Testing | Yes (full enforcement) | Requirements Analysis | + +## Operations Configuration +- **Include Operations Phase**: Undecided +- **Decided At**: Pending — asked at Requirements Analysis + +## Scope Notes (from user) +- One feature, one unit per homepage block: Lifestyle photography, About me, Prices, Lieve woorden (testimonials, new — from the live site), Contact, Instagram +- Contact form: built with anti-spam and a robot check, but covered by an overlay ("coming soon, e-mail info@andreaslop.nl for now") until the API exists +- Lieve woorden: user asked for a design proposal, possibly added to design/andreaslop-static +- Hero already exists and is out of scope + +## Execution Plan Summary +- **Stages to Execute**: Application Design (incl. static design update, FR-HP-01), Units Generation, Functional Design (Prijzen, Lieve woorden, Contact), Code Generation (6 units), Build and Test +- **Stages to Skip**: User Stories (single persona), Functional Design for Lifestyle fotografie / Over mij / Instagram (presentational), NFR Requirements (NFRs set at requirements level), NFR Design (no new patterns), Infrastructure Design (no infrastructure changes) +- **Operations**: Undecided (asked again at Build and Test) +- **Delivery**: one branch feature/homepage-sections, commits per unit, one PR at the end; full `pnpm check` (incl. Lighthouse) after each unit +- **Unit order**: 1 Lifestyle fotografie (+ shared blocks) → 2 Over mij → 3 Prijzen → 4 Lieve woorden → 5 Contact → 6 Instagram + +## Stage Progress + +### 🔵 INCEPTION PHASE +- [x] Workspace Detection +- [x] Reverse Engineering (refresh, approved) +- [x] Requirements Analysis (approved) +- [x] User Stories - SKIP (single visitor persona, concrete FRs) +- [x] Workflow Planning (approved) +- [x] Application Design - EXECUTE (approved) +- [x] Units Generation - EXECUTE (approved) + +### 🟢 CONSTRUCTION PHASE +- [ ] Functional Design - EXECUTE (Prijzen, Lieve woorden, Contact) / SKIP (Lifestyle fotografie, Over mij, Instagram) +- [ ] NFR Requirements - SKIP +- [ ] NFR Design - SKIP +- [ ] Infrastructure Design - SKIP +- [ ] Code Generation - EXECUTE (per unit) +- [ ] Build and Test - EXECUTE + +### 🟡 OPERATIONS PHASE +- [ ] Deployment Setup, Monitoring Setup, Production Readiness Validation - UNDECIDED + +## Current Status +- **Lifecycle Phase**: CONSTRUCTION +- **Current Stage**: Unit 1 Lifestyle fotografie — Code Generation (planning) +- **Next Stage**: CONSTRUCTION - Unit 1 Code Generation + +## Reverse Engineering Status +- [x] Reverse Engineering - Artifacts refreshed on 2026-10-19T19:19:38Z at commit 38c5c3e (approved 2026-10-19T19:31:00Z) +- **Artifacts Location**: aidlc-docs/_shared/reverse-engineering/ diff --git a/aidlc-docs/features/homepage-sections/audit.md b/aidlc-docs/features/homepage-sections/audit.md new file mode 100644 index 0000000..6eb13c9 --- /dev/null +++ b/aidlc-docs/features/homepage-sections/audit.md @@ -0,0 +1,235 @@ +# AI-DLC Audit Log — homepage-sections + +## Initial User Request + +**Timestamp**: 2026-10-19T19:19:38Z + +**User Input**: "Ik wil met aidlc de homepage toe gaan voegen. De Hero staat er al, maar de 4 blokken eronder nog niet. Die wil ik in 1 feature opppakken met elk blok als een losse unit. Voor de duidleijkheid. De 4 blokken zijn: +1. Lifestyle fotografie +2. Over mij +3. Prijzen +4. Contact + +Nou is het nog een statische site zonder back-end dus het contactformulier kan nog niet functioneel gemaakt worden dus ik hoor graag een suggestie hoe ik dit tijdelijk kan oplossen totdat we een API hebben." + +**AI Response**: "Started AI-DLC workflow (existing multi-feature workspace, no welcome message). Began Workspace Detection." + +**Context**: INCEPTION - Workspace Detection (start) + +--- + +## Workspace Detection + +**Timestamp**: 2026-10-19T19:19:38Z + +**User Input**: (none — automatic stage) + +**AI Response**: "Feature resolution: all existing items (frontend-shell, hero-carousel-announce-and-pause) are ✅ Complete and the request is clearly new work, so a new feature was started without a feature-selection prompt. Classification: Feature (new user-facing sections, no defect). Slug: homepage-sections. Brownfield (React SPA in web/). Language configuration inherited from aidlc-docs/language-preference.md (answer A: English docs, Dutch conversation) and stated to the user for correction instead of re-asking. Reverse engineering artifacts in _shared/ are stale: generated at commit 8f5841c (2026-10-14), before the front-end shell, CI/CD, monitoring and the hero fix landed (HEAD 38c5c3e). Next: refresh Reverse Engineering." + +**Context**: INCEPTION - Workspace Detection (complete). Parallel features: none active. Conflicts: none. + +--- + +## Reverse Engineering (refresh) + +**Timestamp**: 2026-10-19T19:19:38Z + +**User Input**: (none — automatic stage) + +**AI Response**: "Refreshed all eight artifacts in aidlc-docs/_shared/reverse-engineering/ against commit 38c5c3e: CI/CD (Gitea Actions, test on Pi nginx, production FTPS to IIS), monitoring (Sentry, Umami), complete shell (footer, skip link, back-to-top, 404/error), content/ modules, pure lib/ helpers with property-based tests, page registry and sitemap, security headers as code. Key finding for this feature: CSP has form-action 'self' and connect-src limited to self/Umami/Sentry, so a third-party contact form endpoint requires a CSP change in web/config/securityHeaders.ts plus regenerated server configs. LAYOUT.md Home lists six blocks (Hero, Highlights, About me, Prices, Contact, Instagram); the user named four — Instagram is to be confirmed in requirements questions. Design images for the four blocks exist in design/andreaslop-static/assets/img. Presented completion message and awaited approval." + +**Context**: INCEPTION - Reverse Engineering (complete, awaiting approval) + +--- + +## Reverse Engineering — User Response + +**Timestamp**: 2026-10-19T19:31:00Z + +**User Input**: "Oh je hebt gelijk. Die Instagram-module moet er ook komen, die ben ik gewoon vergeten. Sterker nog. In het design staat het niet, want het is later op de live werbsite gekomen. Op de huidige website op https://andreaslop.nl/ is het blok \"Lieve woorden\" erbij gekomen. Zou je daar ook een voorstel voor design kunnen doen? Eventueel verwerken in het design in deze workspace?. Voor het formulier moet er inderdaad ook nog anti-spam inkomen en een robot check. Misschien kunnen we voor het formulier wel bouwen, maar dan een overlay er overheen met een tekst dat die binnenkort komt en dta je voor nu een email moet sturen naar info@andreaslop.nl?" + +**AI Response**: "Treated as implicit approval of the Reverse Engineering refresh (no changes requested to the analysis). Scope extended: Instagram block added; new 'Lieve woorden' (testimonials) block from the live site added, needing a design proposal and possibly an update to design/andreaslop-static. Contact form: build it with anti-spam and a robot check, covered by an overlay saying the form is coming soon and to e-mail info@andreaslop.nl for now. Proceeding to Requirements Analysis; inspecting the live site's 'Lieve woorden' block first." + +**Context**: INCEPTION - Reverse Engineering approved; scope change recorded + +--- + +## Requirements Analysis — Clarifying Questions + +**Timestamp**: 2026-10-19T20:07:00Z + +**User Input**: (none — AI-initiated) + +**AI Response**: "Inspected live andreaslop.nl: 'Lieve Woorden' is an owl-slider testimonial widget (photo, shoot-type title, text, author) with two reviews; live prices differ from the static design (Zwangerschap 175, Newborn 185, Gezin 175, richer inclusions); live form has a shoot-type select (Zwangerschap/Newborn/Familie/Overig) instead of a free-text subject plus a honeypot; live Instagram widget is broken. Created inception/requirements/requirement-verification-questions.md with 16 content questions plus the Security, PBT and Operations opt-in questions (Dutch, matching the previous feature's question files). Depth: Standard." + +**Context**: INCEPTION - Requirements Analysis (awaiting answers) + +--- + +## Requirements Analysis — Answers Received + +**Timestamp**: 2026-10-19T20:40:00Z + +**User Input**: "ik heb de vragen beantwoord" + +**AI Response**: "Read answers: Q1–Q13 A, Q11 A with note 'Als we het er dan toch inbouwen dan kan ik het later ook makkelijk uitzetten mocht dat nodig zijn.', Q14 B (Friendly Captcha), Q15 A, Q16 A, Security Baseline A, PBT A, Operations C. No contradictions or ambiguities found. Loaded security-baseline.md and property-based-testing.md (opted in). Generated inception/requirements/requirements.md (12 functional, 6 non-functional requirements, extension compliance tables). Recorded extension and operations configuration in aidlc-state.md. User Stories proposed to be skipped (single visitor persona, concrete requirements). Presented completion message and awaited approval." + +**Context**: INCEPTION - Requirements Analysis (complete, awaiting approval) + +--- + +## Requirements Analysis — Change Request + +**Timestamp**: 2026-10-19T20:48:00Z + +**User Input**: "NFR-HP-02: Code comments wil ik liever in het Engels." + +**AI Response**: "Updated NFR-HP-02: code comments in English for all new code, including new comments in existing files; existing Dutch comments are not translated in this feature; visitor-facing texts stay Dutch. Re-presented the completion message." + +**Context**: INCEPTION - Requirements Analysis (change applied, awaiting approval) + +--- + +## Requirements Analysis — Approval + +**Timestamp**: 2026-10-19T20:52:00Z + +**User Input**: "Ga verder naar de volgende stage" + +**AI Response**: "Requirements approved; User Stories skipped (user did not choose 'Add User Stories'). The question whether English code comments should become a standing preference for future features was not answered; treated as applying to this feature only. Proceeding to Workflow Planning." + +**Context**: INCEPTION - Requirements Analysis approved; User Stories SKIP + +--- + +## Workflow Planning + +**Timestamp**: 2026-10-19T20:55:00Z + +**User Input**: (none — AI-initiated) + +**AI Response**: "Created inception/plans/execution-plan.md. Execute: Application Design (incl. FR-HP-01 static design + LAYOUT.md update as a review gate before React work), Units Generation (six units), Functional Design for Prijzen, Lieve woorden and Contact, Code Generation per unit, Build and Test. Skip: User Stories, Functional Design for presentational units, NFR Requirements, NFR Design, Infrastructure Design. Operations undecided. Risk: Low. Prompt: 'Ready to proceed with this plan?'" + +**Context**: INCEPTION - Workflow Planning (awaiting approval) + +--- + +## Workflow Planning — Approval + +**Timestamp**: 2026-10-19T21:00:00Z + +**User Input**: "akkoord, ga verder" + +**AI Response**: "Execution plan approved. Proceeding to Application Design." + +**Context**: INCEPTION - Workflow Planning approved + +--- + +## Application Design — Plan and Questions + +**Timestamp**: 2026-10-19T21:05:00Z + +**User Input**: (none — AI-initiated) + +**AI Response**: "Created inception/plans/application-design-plan.md with the plan (incl. FR-HP-01 static design steps) and 6 design questions: folder structure, content modules, testimonial carousel (Chakra Carousel available in the installed @chakra-ui/react), Prijzen → Contact handover, location of contactFormEnabled, testimonial photo style. Recorded already-decided items (SectionHeading, HomeSection, Reveal/useReveal, Chakra Field/Input/Textarea/NativeSelect, no form library, submitContactForm adapter)." + +**Context**: INCEPTION - Application Design (awaiting answers) + +--- + +## Application Design — Answers and Artifacts + +**Timestamp**: 2026-10-19T21:40:00Z + +**User Input**: "ik heb de vragen beantwoord" + +**AI Response**: "Answers: Q1 B, Q2 A, Q3 A, Q4 A, Q5 A, Q6 A — no ambiguities. Executed FR-HP-01: design/andreaslop-static index.html (live packages with ?pakket preselect links, new Lieve woorden section, live contact fields with honeypot and coming-soon gate, contact section moved to plain background), style.css (13b testimonials, select, honeypot, form gate, responsive), main.js (contact form handles shoot/onderwerp, honeypot + time check, preselect, initFormGate, initTestimonials), manifest intro-3 updated to the live photo; LAYOUT.md Home now seven blocks with new colour G (also added to .ai/layout-conventions.md). Verified with headless Chrome screenshots (desktop 1440, mobile 520). contact.html left unchanged (out of scope). Generated components.md, component-methods.md, services.md, component-dependency.md, application-design.md. Security/PBT compliance included; no blocking findings." + +**Context**: INCEPTION - Application Design (complete, awaiting approval) + +--- + +## Application Design — Approval + +**Timestamp**: 2026-10-19T21:50:00Z + +**User Input**: "ga verder naar de volgende stage" + +**AI Response**: "Application design (incl. static design update) approved. Proceeding to Units Generation." + +**Context**: INCEPTION - Application Design approved + +--- + +## Units Generation — Plan and Questions + +**Timestamp**: 2026-10-19T21:52:00Z + +**User Input**: (none — AI-initiated) + +**AI Response**: "Created inception/plans/unit-of-work-plan.md: six units per block in the approved order, shared pieces assigned to the first unit that needs them; two questions on delivery (one PR vs PR per unit) and per-unit verification depth (full pnpm check incl. Lighthouse vs without)." + +**Context**: INCEPTION - Units Generation, Part 1 Planning (awaiting answers) + +--- + +## Units Generation — Answers + +**Timestamp**: 2026-10-19T21:58:00Z + +**User Input**: "ik heb de vragen beantwoord" + +**AI Response**: "Answers: Q1 A (one PR for the whole feature, commits per unit on feature/homepage-sections, optional manual 'Deploy to Test' on the branch), Q2 A (full pnpm check incl. Lighthouse per unit). No ambiguities. Prompt: 'Unit of work plan complete. Review the plan in aidlc-docs/features/homepage-sections/inception/plans/unit-of-work-plan.md. Ready to proceed to generation?'" + +**Context**: INCEPTION - Units Generation, Part 1 Planning (awaiting plan approval) + +--- + +## Units Generation — Plan Approval and Generation + +**Timestamp**: 2026-10-19T22:02:00Z + +**User Input**: "ja genereer de unit-documenten" + +**AI Response**: "Plan approved. Generated inception/application-design/unit-of-work.md (six units with scope, shared pieces, images, Functional Design execute/skip, done criteria), unit-of-work-dependency.md (matrix, order diagram), unit-of-work-story-map.md (requirement-to-unit map; all FR-HP/NFR-HP assigned). Presented completion message." + +**Context**: INCEPTION - Units Generation (complete, awaiting approval) + +--- + +## Units Generation — Approval + +**Timestamp**: 2026-10-19T22:08:00Z + +**User Input**: "Ga verder naar de volgende stage" + +**AI Response**: "Units approved. Inception complete. Proceeding to CONSTRUCTION — Unit 1 Lifestyle fotografie (Functional Design skipped per plan) → Code Generation Part 1 Planning." + +**Context**: INCEPTION complete; CONSTRUCTION start + +--- + +## Unit 1 Lifestyle fotografie — Code Generation Plan + +**Timestamp**: 2026-10-19T22:15:00Z + +**User Input**: (none — AI-initiated) + +**AI Response**: "Created construction/plans/lifestyle-fotografie-code-generation-plan.md (20 steps): branch + baseline commit, image resize to 800x1200 via one-off System.Drawing script (ImageMagick not available; no project dependency), theme tokens, content types and homeContent, useReveal/Reveal, SectionHeading, HomeSection, IntroGallery, route, tests, pnpm check, code summary, commit (not pushed). Functional Design skipped; PBT-01 recorded as N/A (no logic). Test names in English proposed. Prompt: approve plan or request changes." + +**Context**: CONSTRUCTION - Unit 1 Code Generation Part 1 (awaiting plan approval) + +--- + +## Unit 1 Lifestyle fotografie — Plan Approval + +**Timestamp**: 2026-10-19T22:20:00Z + +**User Input**: "approve plan" + +**AI Response**: "Plan approved (incl. local commits on feature/homepage-sections, not pushed). Starting Code Generation Part 2." + +**Context**: CONSTRUCTION - Unit 1 Code Generation Part 2 (start) + +--- diff --git a/aidlc-docs/features/homepage-sections/construction/plans/lifestyle-fotografie-code-generation-plan.md b/aidlc-docs/features/homepage-sections/construction/plans/lifestyle-fotografie-code-generation-plan.md new file mode 100644 index 0000000..48ac02f --- /dev/null +++ b/aidlc-docs/features/homepage-sections/construction/plans/lifestyle-fotografie-code-generation-plan.md @@ -0,0 +1,77 @@ +# Code Generation Plan — Unit 1: Lifestyle fotografie + +**This plan is the single source of truth for Code Generation of unit 1.** + +## Unit context +- **Requirements**: FR-HP-02 (section), FR-HP-11 (scroll reveal, introduced), FR-HP-12 (content + images), NFR-HP-01/02/03/05/06 +- **Design**: [unit-of-work.md](../../inception/application-design/unit-of-work.md) unit 1; [components.md](../../inception/application-design/components.md); [component-methods.md](../../inception/application-design/component-methods.md) +- **Design reference**: `design/andreaslop-static/index.html` (`.section`, `.section__head--center`, `.lead`, `.intro-gallery`) and `assets/css/style.css` §4, §11, §19 +- **Depends on**: nothing (first unit); introduces the shared blocks every later unit uses +- **Functional Design**: skipped (presentational). **PBT-01**: no business logic, data transformation or algorithm in this unit → no property-based tests; this is recorded as N/A, not skipped silently. Example-based tests cover the components and hook (PBT-10). +- **Workspace**: `K:\Development\SlpSoftware\Projects\AndreaSlopFotografie`, code in `web/` + +## Conventions for this unit +- Code comments in English; visitor-facing text (headings, alt texts) in Dutch. **Test names in English** too, since they are code, not visitor-facing (existing tests stay Dutch). +- `data-testid` on the section and its gallery (`intro-gallery`, `intro-gallery-photo-{n}`). +- Styling via theme tokens/text styles and Chakra primitives; no CSS files, no hard-coded colours. + +## Steps + +### Branch and baseline +- [ ] **Step 1** — Create branch `feature/homepage-sections` from `master`. First commit: the inception artifacts so far (`aidlc-docs/…/homepage-sections/`, refreshed `aidlc-docs/_shared/reverse-engineering/`, `active-features.md`) and the static design update (`design/andreaslop-static/`, `LAYOUT.md`, `.ai/layout-conventions.md`). Not pushed. + +### Images +- [ ] **Step 2** — Resize the four live gallery photos (`design/andreaslop-static/assets/img/intro-1…4.jpg`, 1067×1600) to **800×1200**, JPEG quality ~80, into `web/src/assets/home/intro-1.jpg … intro-4.jpg`. Tool: a one-off PowerShell script using .NET `System.Drawing` (already on Windows; not added to the project). The script and its parameters are recorded in the code summary so later units reuse them. Target ≤ ~150 KB per photo. + +### Theme (shared) +- [ ] **Step 3** — `web/src/theme.ts`: add tokens from the design that later units also need: + - spacing `sectionY` (`clamp(4.5rem, 9vw, 8.5rem)`), `sectionYTight` (60% of it), `gridGap` (`clamp(1rem, 2.2vw, 2rem)`), `sectionHeadGap` (`clamp(2.5rem, 5vw, 4.5rem)`) + - size `contentNarrow` (`820px`) + - text styles `sectionTitle` (Marcellus; 1.85 / 2.125 / 2.5rem, line-height 1.15) and `lead` (1.25rem, weight 300, line-height 1.6) + - duration `reveal` (`0.8s`) + - then run `pnpm typegen` + +### Content +- [ ] **Step 4** — `web/src/content/types.ts`: add `ContentImage` and `HomeContent` with the `intro` part only (`{ title, lead, photos: ContentImage[] }`); later units extend `HomeContent`. +- [ ] **Step 5** — Create `web/src/content/homeContent.ts`: title "Lifestyle fotografie", lead "Jouw favoriete momenten, vastgelegd op een natuurlijke en ongedwongen manier.", four photos with width/height 800×1200 and alt texts: + 1. "Babyhandje in de hand van de moeder, op een gebreid dekentje" + 2. "Moeder drukt haar pasgeboren baby in een gebreid truitje tegen zich aan" + 3. "Zwangere vrouw op blote voeten in het zand bij zonsondergang" + 4. "Aanstaande vader omarmt zijn zwangere partner in de duinen" + +### Shared blocks +- [ ] **Step 6** — `web/src/hooks/useReveal.ts`: returns `{ ref, visible }`; visible immediately when `prefers-reduced-motion: reduce` or `IntersectionObserver` is missing; otherwise observes once (threshold 0.12, rootMargin `0px 0px -60px 0px`, as in the design) and disconnects on reveal and on unmount. +- [ ] **Step 7** — `web/src/hooks/useReveal.test.tsx`: visible without IntersectionObserver (jsdom); visible under reduced motion; hidden until intersecting with a mocked observer, then visible, then unobserved; disconnect on unmount. +- [ ] **Step 8** — `web/src/components/Reveal/Reveal.tsx`: wraps children in a `Box`; opacity 0 + translateY(24px) until visible, transition `reveal` duration with the `smooth` easing; optional `delay` (seconds) for staggering. +- [ ] **Step 9** — `web/src/components/Reveal/Reveal.test.tsx`: children always in the DOM and accessible; visible state without observer. +- [ ] **Step 10** — `web/src/components/SectionHeading/SectionHeading.tsx`: optional eyebrow (`eyebrow` text style, `accent.deep`), h2 with `id` (`sectionTitle` text style), optional lead (`lead` text style, `ink.soft`); `align` center (default, max width 620px, centred) or start; bottom margin `sectionHeadGap`. +- [ ] **Step 11** — `web/src/components/SectionHeading/SectionHeading.test.tsx`: h2 with id, optional eyebrow/lead, axe clean. +- [ ] **Step 12** — `web/src/components/HomeSection/HomeSection.tsx`: `
` with `py="sectionY"` (or `sectionYTight`), `bg` `paper` or `paper.alt` (`tone`), inner `Container` (`content` or `contentNarrow` width), optional `id` and `data-testid`. +- [ ] **Step 13** — `web/src/components/HomeSection/HomeSection.test.tsx`: region named by its heading, tone and width variants render, id passes through. + +### The section +- [ ] **Step 14** — `web/src/components/home/IntroGallery/IntroGallery.tsx`: `HomeSection` + `SectionHeading` (in `Reveal`) + grid of four `figure`s, each in a `Reveal` with a staggered delay; 4 columns from `lg`, 2 from `sm`, 1 below; 2nd and 4th photo offset downward from `sm` (design `margin-top`); image `aspectRatio 3/4`, `objectFit cover`, `loading="lazy"`, explicit width/height; slow hover zoom (1.05, `fade` duration), none under reduced motion. +- [ ] **Step 15** — `web/src/components/home/IntroGallery/IntroGallery.test.tsx`: region "Lifestyle fotografie", h2 + lead, four images with their alt texts and lazy loading, works with any number of photos (0 shows only the heading), axe clean. +- [ ] **Step 16** — `web/src/routes/index.tsx`: render `IntroGallery` with `homeContent.intro` after the Hero. +- [ ] **Step 17** — `web/src/app.test.tsx`: the homepage shows the "Lifestyle fotografie" section after the hero, still exactly one h1, axe clean (extend the existing home checks). + +### Verification and wrap-up +- [ ] **Step 18** — Run `pnpm check` (lint, format, tests incl. coverage thresholds, build, audits, Lighthouse mobile + desktop). Fix and rerun until green. +- [ ] **Step 19** — Write `aidlc-docs/features/homepage-sections/construction/lifestyle-fotografie/code/code-summary.md`: files created/modified, image script + parameters and resulting sizes, test results, Lighthouse scores, extension compliance. +- [ ] **Step 20** — Commit unit 1 on `feature/homepage-sections` ("Adds the Lifestyle fotografie section to the homepage" + attribution). Not pushed. + +## Requirement traceability +| Requirement | Steps | +|---|---| +| FR-HP-02 | 5, 14–17 | +| FR-HP-11 | 6–9, 14 | +| FR-HP-12 | 2, 4, 5 | +| NFR-HP-01 | 10–15, 17, 18 (Lighthouse a11y) | +| NFR-HP-02 | 3, 8–14 | +| NFR-HP-03 | 7, 9, 11, 13, 15, 17, 18 | +| NFR-HP-05 | 2, 14, 18 | +| NFR-HP-06 | 4, 5 | + +## Extension compliance (planned) +- **Security**: no new dependencies or external resources (SECURITY-10/13); no input handling; other rules N/A. +- **PBT**: PBT-01 N/A for this unit (no logic); PBT-08/09 unchanged; PBT-10 example-based tests present. diff --git a/aidlc-docs/features/homepage-sections/inception/application-design/application-design.md b/aidlc-docs/features/homepage-sections/inception/application-design/application-design.md new file mode 100644 index 0000000..fa9061d --- /dev/null +++ b/aidlc-docs/features/homepage-sections/inception/application-design/application-design.md @@ -0,0 +1,82 @@ +# Application Design — homepage-sections + +Consolidated design. Details: [components.md](components.md), [component-methods.md](component-methods.md), [services.md](services.md), [component-dependency.md](component-dependency.md). Decisions: [application-design-plan.md](../plans/application-design-plan.md) (Q1–Q6 all A, except Q1 = B). + +## 1. Design reference (FR-HP-01, done in this stage) +- `design/andreaslop-static/index.html` + `assets/css/style.css` + `assets/js/main.js`: + - Prijzen: live packages (Zwangerschap € 175, Newborn € 185, Gezin € 175 with the live inclusions); "Boek je shoot" → `index.html?pakket=#contact`, preselected by the script + - **Lieve woorden** (new, section 13b in the CSS): between Prijzen and Contact on `paper.alt`; one review at a time — framed photo (same sand offset block as the about block), large Marcellus quotation mark in heidegroen, shoot type as eyebrow, quote in Marcellus, names in small caps; prev/next arrows and dots (44 px hit areas); polite live region; no autoplay; stacked below 1024 px + - Contact: live fields (Naam, E-mail, "In welke shoot heb je interesse?" select, "Stel hier je vraag"), button "(Aan)vraag versturen", honeypot, time check; the form sits dimmed and `inert` under a "Binnenkort" notice with "Stuur een e-mail" (`data-form-disabled` switch); now on a plain `paper` background so backgrounds keep alternating + - Lifestyle fotografie: `intro-3.jpg` replaced by the current live photo (manifest updated) +- `LAYOUT.md`: Home now has seven blocks (Hero, Highlights, About me, Prices, **Testimonials**, Contact, Instagram); new letter G colour added to `.ai/layout-conventions.md`. +- `contact.html` (the `/contact` page design) is unchanged — out of scope (Q16); the script supports both forms. + +## 2. Structure + +```mermaid +graph TD + Route["routes/index.tsx (validateSearch pakket)"] --> Hero["Hero (exists)"] + Route --> S1["home/IntroGallery"] + Route --> S2["home/AboutBlock"] + Route --> S3["home/Pricing"] + Route --> S4["home/Testimonials"] + Route --> S5["home/ContactSection"] + Route --> S6["home/InstagramGrid"] + S5 --> Gate["ContactForm/ContactFormGate"] + Gate --> Form["ContactForm/ContactForm"] + Form --> Adapter["contact/submitContactForm"] + classDef route fill:#f6e05e,stroke:#c05621,stroke-width:1px,color:#000; + classDef home fill:#9ae6b4,stroke:#2f855a,stroke-width:1px,color:#000; + classDef shared fill:#63b3ed,stroke:#2b6cb0,stroke-width:1px,color:#000; + classDef existing fill:#e2e8f0,stroke:#4a5568,stroke-width:1px,color:#000; + class Route route; + class S1,S2,S3,S4,S5,S6 home; + class Gate,Form,Adapter shared; + class Hero existing; +``` + +Text alternative: the home route renders the Hero and six home sections in page order; the contact section wraps the reusable form in a gate, and the form submits through a single adapter. + +- **Folders** (Q1 = B): `components/home/{IntroGallery,AboutBlock,Pricing,Testimonials,ContactSection,InstagramGrid}`; reusable pieces in `components/{HomeSection,SectionHeading,Reveal,FramedImage,ContactForm}`; `hooks/useReveal.ts`; `contact/{types,submitContactForm}.ts`. +- **Shared building blocks**: `HomeSection` (padding, tone, width, `aria-labelledby`, anchor), `SectionHeading` (eyebrow, h2, lead), `Reveal` (+ `useReveal`), `FramedImage` (photo + sand offset block). + +## 3. Content (Q2 = A) +- `content/packages.ts` (`PricingPackage[]`), `content/testimonials.ts` (`Testimonial[]`), `content/homeContent.ts` (`HomeContent`: section texts, gallery, about, instagram), `siteContent.contactForm.enabled = false` (Q5 = A). +- Images as `ContentImage { src, alt, width, height }` from `web/src/assets`. +- Only the route imports content; components get props. + +## 4. Key interactions +- **Testimonials** (Q3 = A): Chakra `Carousel` (Ark UI) — keyboard, swipe, indicators and slide semantics built in; no autoplay; custom styling; live-region text from `slideLabel`; controls hidden for a single review. +- **Prijzen → Contact** (Q4 = A): `/?pakket=#contact`; `packageFromSearch` ignores unknown ids; preselected value flows into the form as `initialShoot`. +- **Contact form**: Chakra `Field`/`Input`/`Textarea`/`NativeSelect`; plain React state; `validateContact` → per-field errors, focus to the first invalid field; `isLikelySpam` (honeypot + time check) → silent success; `submitContactForm` adapter (today rejects generically). +- **Gate**: `ContactFormGate` with `enabled` from `siteContent.contactForm`; when off, the form is dimmed and `inert`, the notice shows the e-mail address (assembled with the existing `emailAddress`) and a mailto button; without a valid address only the coming-soon text. +- **Instagram**: profile URL derived from `siteContent.socials` via `visibleSocials`; section hidden without one. + +## 5. Pure helpers (`lib/`, PBT candidates) +`formatPrice`, `shootOptions`, `packageFromSearch`, `validateContact`, `toContactPayload`, `isLikelySpam`, `slideLabel`. Property identification per unit in Functional Design (PBT-01). + +## 6. Requirements coverage +| Requirement | Covered by | +|---|---| +| FR-HP-01 | §1 (done) | +| FR-HP-02 | IntroGallery | +| FR-HP-03 | AboutBlock, FramedImage | +| FR-HP-04 | Pricing, PriceCard, packages.ts, formatPrice, package handover | +| FR-HP-05 | Testimonials (Chakra Carousel), testimonials.ts, slideLabel | +| FR-HP-06 | ContactSection, ContactForm, validateContact, shootOptions, submitContactForm | +| FR-HP-07 | ContactFormGate, siteContent.contactForm | +| FR-HP-08 | isLikelySpam, honeypot field, max lengths | +| FR-HP-09 | Widget slot in ContactForm (no script); integration in the API feature | +| FR-HP-10 | InstagramGrid, homeContent.instagram | +| FR-HP-11 | Reveal, useReveal | +| FR-HP-12 | content modules, ContentImage, assets | +| NFR-HP-01 | HomeSection labelling, Field wiring, Carousel semantics, inert gate, 44 px targets | +| NFR-HP-02 | Shared blocks, Chakra built-ins, theme reuse, English comments | +| NFR-HP-03 | Injectable submit, pure helpers, arbitraries | +| NFR-HP-04 | No new third parties, adapter + gate, spam filter, generic errors | +| NFR-HP-05 | Lazy images with dimensions | +| NFR-HP-06 | API-shaped content and payload types | + +## 7. Extension compliance (Application Design) +- **Security Baseline**: SECURITY-04 compliant (no CSP change, no external resources); SECURITY-05 compliant at design level (client-side validation designed, server-side assigned to the API feature); SECURITY-10 compliant (no new dependencies — Chakra Carousel is part of the installed `@chakra-ui/react`); SECURITY-11 compliant (submission isolated in one adapter; misuse case: form spam — gate, honeypot, time check; captcha and rate limiting assigned to the API feature); SECURITY-13 compliant (no CDN resources); SECURITY-15 compliant (adapter failure → generic message, input kept). SECURITY-01/02/03/06/07/08/09/12/14 N/A (no server, data store, IAM or authentication in this feature). +- **Property-Based Testing**: PBT-01 planned per unit in Functional Design; pure helpers are isolated in `lib/` to make them property-testable; PBT-07 generators to be added to `test/arbitraries.ts`; PBT-08/09 compliant (existing fast-check setup with seed logging). diff --git a/aidlc-docs/features/homepage-sections/inception/application-design/component-dependency.md b/aidlc-docs/features/homepage-sections/inception/application-design/component-dependency.md new file mode 100644 index 0000000..28065df --- /dev/null +++ b/aidlc-docs/features/homepage-sections/inception/application-design/component-dependency.md @@ -0,0 +1,51 @@ +# Component Dependencies — homepage-sections + +## Dependency matrix + +Rows depend on columns (✓). + +| Component | HomeSection | SectionHeading | Reveal | FramedImage | LinkButton | ContactForm(+Gate) | lib/ helpers | content types | Chakra built-ins | +|---|---|---|---|---|---|---|---|---|---| +| IntroGallery | ✓ | ✓ | ✓ | | | | | ✓ | Grid, Image | +| AboutBlock | ✓ | ✓ | ✓ | ✓ | | | | ✓ | Grid, Text, Link | +| Pricing / PriceCard | ✓ | ✓ | ✓ | | ✓ | | formatPrice | ✓ | SimpleGrid, List | +| Testimonials | ✓ | ✓ | ✓ | ✓ | | | slideLabel | ✓ | Carousel, Blockquote | +| ContactSection | ✓ | ✓ | ✓ | | | ✓ | shootOptions | ✓ | — | +| ContactForm | | | | | linkButton recipe | | validateContact, toContactPayload, isLikelySpam | ✓ | Field, Input, Textarea, NativeSelect | +| ContactFormGate | | | | | ✓ (mail button) | | emailAddress (exists) | ✓ | — | +| InstagramGrid | ✓ | ✓ | ✓ | | | | | ✓ | Grid, Link, VisuallyHidden | +| routes/index.tsx | | | | | | | packageFromSearch, visibleSocials (exists) | content modules | — | + +No section depends on another section; the only cross-section link (Prijzen → Contact) goes through the URL. + +## Data flow + +```mermaid +graph LR + Content["content/ homeContent, packages, testimonials, siteContent"] --> Route["routes/index.tsx"] + URL["URL search pakket"] --> Route + Route -->|"props"| Sections["Six home sections"] + Route -->|"preselected id"| Contact["ContactSection / ContactForm"] + Sections -->|"Link with pakket + #contact"| URL + Contact -->|"ContactPayload"| Adapter["submitContactForm"] + Adapter -.->|"later"| API["POST /api/contact"] + classDef data fill:#9ae6b4,stroke:#2f855a,stroke-width:1px,color:#000; + classDef comp fill:#63b3ed,stroke:#2b6cb0,stroke-width:1px,color:#000; + classDef ext fill:#e2e8f0,stroke:#4a5568,stroke-width:1px,stroke-dasharray:5 5,color:#000; + class Content,URL data; + class Route,Sections,Contact,Adapter comp; + class API ext; +``` + +Text alternative: static content and the URL's pakket parameter flow into the home route, which passes props to the sections and the preselected package to the contact form; price cards write the package back into the URL; the form sends its payload through the single adapter, which will call the API later. + +## Communication patterns +- **Props down** from the route; no context or global store. +- **URL as the shared channel** between Prijzen and Contact. +- **Callback-free sections**: sections emit nothing upward. +- **Injectable submit** on ContactForm for tests; default is the real adapter. + +## Coupling notes +- `ContactForm` depends on `ShootOption[]`, not on `PricingPackage`, so the `/contact` page can reuse it with the same options. +- `InstagramGrid` receives `profileUrl` from the route (derived from `siteContent.socials` via `visibleSocials`), so the Instagram URL has one source. +- `FramedImage` is the only new shared visual primitive; anything else reuses theme tokens, text styles and recipes. diff --git a/aidlc-docs/features/homepage-sections/inception/application-design/component-methods.md b/aidlc-docs/features/homepage-sections/inception/application-design/component-methods.md new file mode 100644 index 0000000..833cde7 --- /dev/null +++ b/aidlc-docs/features/homepage-sections/inception/application-design/component-methods.md @@ -0,0 +1,115 @@ +# Component Methods — homepage-sections + +Signatures and data shapes. Detailed rules (validation messages, limits, carousel behaviour, spam thresholds) follow in Functional Design per unit. + +## Content types (`content/types.ts`, additions) + +```ts +// An image as the API will deliver it; src is a URL (bundled asset today) +interface ContentImage { + src: string; + alt: string; + width: number; + height: number; +} + +interface PricingPackage { + id: string; // stable slug, e.g. 'newborn'; used in ?pakket= and as the shoot value + name: string; // 'Newborn' + price: number; // whole euros, e.g. 185 + features: string[]; // '1-2 uur fotografie', ... +} + +interface Testimonial { + id: string; + shoot: string; // label, e.g. 'Newbornshoot' + quote: string; + author: string; // 'Demi & Kevin' + image: ContentImage; +} + +interface HomeContent { + intro: { title: string; lead: string; photos: ContentImage[] }; + about: { + eyebrow: string; + title: string; + paragraphs: string[]; + image: ContentImage; + link: { label: string; to: RoutePath }; + }; + pricing: { title: string; lead: string }; + testimonials: { title: string }; + contact: { title: string; lead: string }; + instagram: { title: string; handle: string; photos: ContentImage[] }; +} + +// SiteContent gains: +interface SiteContent { + // ...existing fields + contactForm: { enabled: boolean }; +} +``` + +Content modules (design Q2 = A): `content/packages.ts` → `PricingPackage[]`, `content/testimonials.ts` → `Testimonial[]`, `content/homeContent.ts` → `HomeContent`. + +## Contact types (`contact/types.ts`) + +```ts +interface ContactValues { // what the visitor typed + naam: string; + email: string; + shoot: string; // '' | a package id | 'overig' + bericht: string; +} + +type ContactField = keyof ContactValues; +type ContactErrors = Partial>; + +interface ContactPayload { // what goes to POST /api/contact + naam: string; + email: string; + shoot: string; + bericht: string; +} + +interface ShootOption { value: string; label: string } +``` + +## Components (props) + +| Component | Props | +|---|---| +| `HomeSection` | `{ labelledBy: string; id?: string; tone?: 'paper' \| 'alt'; width?: 'default' \| 'narrow'; spacing?: 'default' \| 'tight'; children: ReactNode }` | +| `SectionHeading` | `{ id: string; title: string; eyebrow?: string; lead?: string; align?: 'center' \| 'start' }` | +| `Reveal` | `{ children: ReactNode; delay?: number }` | +| `FramedImage` | `{ image: ContentImage; aspectRatio: string }` | +| `IntroGallery` | `{ content: HomeContent['intro'] }` | +| `AboutBlock` | `{ content: HomeContent['about'] }` | +| `Pricing` | `{ content: HomeContent['pricing']; packages: PricingPackage[] }` | +| `PriceCard` | `{ pkg: PricingPackage }` | +| `Testimonials` | `{ content: HomeContent['testimonials']; testimonials: Testimonial[] }` | +| `ContactSection` | `{ content: HomeContent['contact']; packages: PricingPackage[]; enabled: boolean; email: EmailAddress; preselected?: string }` | +| `ContactFormGate` | `{ enabled: boolean; email: EmailAddress; children: ReactNode }` | +| `ContactForm` | `{ idPrefix: string; options: ShootOption[]; initialShoot?: string; submit?: (payload: ContactPayload) => Promise }` (`submit` defaults to `submitContactForm`; injectable for tests) | +| `InstagramGrid` | `{ content: HomeContent['instagram']; profileUrl: string }` | + +## Hooks + +- `useReveal(): { ref: RefObject; visible: boolean }` — `visible` starts `true` when reduced motion is on or IntersectionObserver is missing; otherwise flips to `true` once and stops observing. + +## Pure helpers (`lib/`, 100% coverage, property-based tests) + +| Function | Purpose | +|---|---| +| `formatPrice(euros: number): string` | `185` → `'€ 185'` (nl-NL, no decimals) | +| `shootOptions(packages: PricingPackage[]): ShootOption[]` | package names in order + `{ value: 'overig', label: 'Overig' }` | +| `packageFromSearch(value: unknown, packages: PricingPackage[]): string \| undefined` | returns the id only if it matches a package | +| `validateContact(values: ContactValues, options: ShootOption[]): ContactErrors` | required fields, e-mail format, max lengths, shoot must be a known option | +| `toContactPayload(values: ContactValues): ContactPayload` | trims fields | +| `isLikelySpam(input: { honeypot: string; shownAt: number; now: number }): boolean` | honeypot filled or submitted too fast | +| `slideLabel(index: number, count: number): string` | `'Review 2 van 3'` for the live region and slide `aria-label` | + +## Services / adapters + +- `submitContactForm(payload: ContactPayload): Promise` (`contact/submitContactForm.ts`) — today rejects with a generic error (no back-end); later `POST /api/contact`. +- Route search: `validateSearch: (search) => ({ pakket: typeof search.pakket === 'string' ? search.pakket : undefined })` on `/`; the page then resolves it with `packageFromSearch`. diff --git a/aidlc-docs/features/homepage-sections/inception/application-design/components.md b/aidlc-docs/features/homepage-sections/inception/application-design/components.md new file mode 100644 index 0000000..4a39a3f --- /dev/null +++ b/aidlc-docs/features/homepage-sections/inception/application-design/components.md @@ -0,0 +1,86 @@ +# Components — homepage-sections + +Folder structure per design Q1 = B: the six homepage blocks live under `components/home/`; anything reusable elsewhere stays directly under `components/`. + +## Overview + +```mermaid +graph TD + Route["routes/index.tsx"] --> Hero["Hero (exists)"] + Route --> Intro["home/IntroGallery"] + Route --> About["home/AboutBlock"] + Route --> Pricing["home/Pricing"] + Route --> Testimonials["home/Testimonials"] + Route --> ContactSection["home/ContactSection"] + Route --> Instagram["home/InstagramGrid"] + Pricing --> PriceCard["home/Pricing/PriceCard"] + ContactSection --> Gate["ContactForm/ContactFormGate"] + Gate --> Form["ContactForm/ContactForm"] + About --> Framed["FramedImage"] + Testimonials --> Framed + Intro --> Shared["HomeSection + SectionHeading + Reveal"] + About --> Shared + Pricing --> Shared + Testimonials --> Shared + ContactSection --> Shared + Instagram --> Shared + classDef route fill:#f6e05e,stroke:#c05621,stroke-width:1px,color:#000; + classDef home fill:#9ae6b4,stroke:#2f855a,stroke-width:1px,color:#000; + classDef shared fill:#63b3ed,stroke:#2b6cb0,stroke-width:1px,color:#000; + classDef existing fill:#e2e8f0,stroke:#4a5568,stroke-width:1px,color:#000; + class Route route; + class Intro,About,Pricing,PriceCard,Testimonials,ContactSection,Instagram home; + class Gate,Form,Framed,Shared shared; + class Hero existing; +``` + +Text alternative: the home route renders the existing Hero and six new home sections; Pricing uses PriceCard, ContactSection wraps the reusable ContactForm in a ContactFormGate, AboutBlock and Testimonials share FramedImage, and every section uses HomeSection, SectionHeading and Reveal. + +## Shared components (`components/`) + +### HomeSection +- **Purpose**: the design's `.section` wrapper for a content block +- **Responsibilities**: vertical padding (`section-y`), optional `paper.alt` background (`tone`), optional tight padding, `Container` width (default or narrow), `aria-labelledby` pointing at its heading, optional `id` (anchor) +- **Interface**: `children` + +### SectionHeading +- **Purpose**: the design's `.section__head` +- **Responsibilities**: optional eyebrow (`eyebrow` text style, `accent.deep`), the h2 (with `id` for `aria-labelledby`), optional lead (`ink.soft`); centred or start-aligned +- **Interface**: `` + +### Reveal +- **Purpose**: the design's `.reveal` fade-in on scroll +- **Responsibilities**: wraps children; hidden-then-visible transition once the element enters the viewport; immediately visible under reduced motion, without IntersectionObserver, or before JavaScript runs (no content hidden by default in markup) +- **Interface**: `children`; logic in `hooks/useReveal.ts` + +### FramedImage +- **Purpose**: the photo with the sand offset block behind it (`.about__media`), shared by AboutBlock and Testimonials (design Q6 = A) +- **Responsibilities**: image with fixed aspect ratio, `loading="lazy"`, explicit width/height; decorative offset block hidden below `sm` +- **Interface**: `` + +### ContactForm (`components/ContactForm/`) +- **ContactForm** — the form itself: fields Naam, E-mail, shoot select, Bericht; honeypot; per-field errors via Chakra `Field`; submit button; status message. Owns its form state. Reusable on `/contact` later. +- **ContactFormGate** — wraps ContactForm; when `enabled` is false the form is dimmed and `inert` and the coming-soon notice with the mail button is shown over it; when true the form is shown as is. +- **submitContactForm** (`src/contact/submitContactForm.ts`) — the single submission adapter (see services.md). + +## Homepage sections (`components/home/`) + +| Component | Unit | Purpose | Key responsibilities | +|---|---|---|---| +| `IntroGallery` | 1 Lifestyle fotografie | Heading + four-photo gallery | Staggered 4-column grid (2 on tablet, 1 on mobile), hover zoom, alt texts | +| `AboutBlock` | 2 Over mij | Photo + intro text | FramedImage, eyebrow, h2, paragraphs, "Lees mijn verhaal" link to `/over-mij`, `paper.alt` | +| `Pricing` + `PriceCard` | 3 Prijzen | Package cards | Decorations, card grid (1 column below `lg`), price formatting, "Boek je shoot" link with `pakket` search param + `#contact` | +| `Testimonials` | 4 Lieve woorden | One review at a time | Chakra `Carousel` (no autoplay), FramedImage, quotation mark, shoot label, `Blockquote`, author; prev/next + indicators; live-region status; no controls for a single review; `paper.alt` | +| `ContactSection` | 5 Contact | Contact block | Heading + lead, `id="contact"`, ContactFormGate with ContactForm, passes the preselected package and the e-mail address | +| `InstagramGrid` | 6 Instagram | Heading + photo grid | Handle link, six tiles (6/3/2 columns) linking to the profile, external link attributes; not rendered without a valid Instagram profile URL | + +## Modified existing components / modules + +| File | Change | +|---|---| +| `routes/index.tsx` | Renders the six sections after the Hero; `validateSearch` for `pakket` | +| `content/types.ts` | New content interfaces (see component-methods.md) | +| `content/siteContent.ts` | `contactForm: { enabled: false }` (design Q5 = A) | +| `recipes/linkButton.ts` | Usable on a `
+ + +
+
+
+

Lieve woorden

+
+ +
+
+
+
+ Bruidegom schuift de trouwring om de vinger van de bruid +
+
+ +

Trouwshoot

+
+

Super mooie foto’s door Andrea gemaakt op onze trouwdag en pré-wedding shoot. Wij zijn er super blij mee! Een aantal hebben wij laten afdrukken en hangen nu ingelijst aan de muur, dus wij genieten er nog elke dag van.

+
+
Majella & Mark
+
+
+ + +
+ +
+ +
+ + +
+ +
+

+
+
+
+ -
+ +

Contact

Wil je meer informatie ontvangen? Neem gerust contact met mij op.

-
-
+
+ +
+
+ + + +
+
+ + + +
+
+
- - + +
+
- - + +
+ + + + + + + + + +
+

Binnenkort

+

Het contactformulier komt binnenkort. Mail me voor nu op info@andreaslop.nl

+ Stuur een e-mail
- -
- - - -
- -
- - - -
- - - - - +