Adds the first unit's code summary and updates the shared docs
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -7,7 +7,7 @@ A single client-side React SPA (`web/`) built with Vite. Routing is file-based v
|
||||
|
||||
```mermaid
|
||||
graph TD
|
||||
Main["main.tsx: Sentry start, router, ChakraProvider"] --> Root["routes/__root.tsx: HeadContent, AppShell, 404 and error components"]
|
||||
Main["client.tsx: Sentry start, hydration (router.tsx: getRouter)"] --> Root["routes/__root.tsx: HeadContent, AppShell, 404 and error components"]
|
||||
Root --> Shell["components/AppShell.tsx"]
|
||||
Shell --> Skip["SkipNavLink and main landmark"]
|
||||
Shell --> Nav["NavigationBar (NavLink, MobileNav)"]
|
||||
@@ -41,17 +41,17 @@ graph TD
|
||||
class Content,NavData,Seo,Theme,Blocks support;
|
||||
```
|
||||
|
||||
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 and six sections built from shared blocks (one of them lazily loads the contact form); the about route renders the Over mij page; the other routes render placeholder PageIntros; the shoot pages render `shoots/ShootPage`, whose sections follow `shootPageBands(view)` (`lib/shootPageBands.ts`): intro, stories, process, photos, FAQ, package, closing; content, navigation, SEO and theme modules support all of it.
|
||||
Text alternative: client.tsx starts Sentry and hydrates the prerendered page (prerendering; router from router.tsx); the root route renders AppShell (skip link, NavigationBar, the page via Outlet, Footer, BackToTop, Umami); the home route renders the Hero and six sections built from shared blocks (one of them lazily loads the contact form); the about route renders the Over mij page; the other routes render placeholder PageIntros; the shoot pages render `shoots/ShootPage`, whose sections follow `shootPageBands(view)` (`lib/shootPageBands.ts`): intro, stories, process, photos, FAQ, package, closing; content, navigation, SEO and theme modules support all of it.
|
||||
|
||||
## Component Descriptions
|
||||
### main.tsx
|
||||
### client.tsx, router.tsx (replace main.tsx; prerendering)
|
||||
- **Purpose**: Application bootstrap
|
||||
- **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
|
||||
- **Responsibilities**: `client.tsx` starts Sentry (deferred) and hydrates the prerendered document with `StartClient`; `router.tsx` creates the router (scroll restoration, default error component); ChakraProvider (light only) and the fonts are in the document shell of `routes/__root.tsx`
|
||||
- **Type**: Application
|
||||
|
||||
### routes/__root.tsx
|
||||
- **Purpose**: Root route / layout
|
||||
- **Responsibilities**: Site-wide head (`siteHead`: OG basics + JSON-LD), `HeadContent`, `AppShell`, dev-only router devtools, `NotFound` and `ErrorPage`
|
||||
- **Responsibilities**: Site-wide head (`siteHead`: OG basics + JSON-LD), `HeadContent`, `AppShell`, dev-only router devtools, `NotFound` and `ErrorPage`; document shell (`shellComponent`, prerendering); `routes/$.tsx` is the catch-all for unknown URLs (prerendered as `404.html`)
|
||||
- **Type**: Application
|
||||
|
||||
### components/AppShell.tsx
|
||||
@@ -108,7 +108,7 @@ Text alternative: main.tsx starts Sentry and mounts the router; the root route r
|
||||
|
||||
### hooks/
|
||||
- **Purpose**: Shared behaviour
|
||||
- **Responsibilities**: `useRouteFocus`, `useScrolledPast`, `useInView` (IntersectionObserver), `usePageLoaded` (after the load event), `useReveal` (reveal once, immediately with reduced motion)
|
||||
- **Responsibilities**: `useRouteFocus`, `useScrolledPast`, `useInView` (IntersectionObserver), `usePageLoaded` (after the load event), `useReveal` (reveal once, immediately with reduced motion), `useHydrated`, `useEmailAddress` (prerendering: the first render equals the prerendered HTML)
|
||||
- **Type**: Application
|
||||
|
||||
### seo.ts, sitePages.ts, sitemap.ts
|
||||
@@ -123,7 +123,7 @@ Text alternative: main.tsx starts Sentry and mounts the router; the root route r
|
||||
|
||||
### 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
|
||||
- **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; prerendering adds `pageFiles.ts`, `inlineScripts.ts`, `externalizeInlineScripts.ts` (post-build step: moves inline scripts to `/assets/inline-<hash>.js` so the CSP stays) and `previewServer.ts` (serves `dist/client` with the real server rules, 404 for unknown paths)
|
||||
- **Type**: Infrastructure-as-code (small)
|
||||
|
||||
### theme.ts / recipes/
|
||||
@@ -159,6 +159,6 @@ Text alternative: a visitor navigates, the router renders the root layout (AppSh
|
||||
|
||||
## Infrastructure Components
|
||||
- **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)
|
||||
- **Deployment Model**: Static prerendered build (prerendering: `dist/client` holds one HTML file per page plus `404.html`; `dist/server` is not deployed; server rules still to be changed in unit 3 of prerendering). 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
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
```mermaid
|
||||
graph LR
|
||||
Visitor["Website visitor (prospective client)"] --> Site["Andrea Slop Fotografie website (React SPA)"]
|
||||
Visitor["Website visitor (prospective client)"] --> Site["Andrea Slop Fotografie website (React, prerendered)"]
|
||||
Crawler["Search engines and link previews"] --> Site
|
||||
Site --> Social["Facebook and Instagram profiles"]
|
||||
Site --> Mail["E-mail (mailto, address assembled in the browser)"]
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
## Build System
|
||||
- **Type**: pnpm (`packageManager: pnpm@12.11.2`, lockfile `web/pnpm-lock.yaml`)
|
||||
- **Configuration**:
|
||||
- `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/package.json` — scripts `dev`, `build` (`tsc && vite build` and the script step `config/externalizeInlineScripts.ts`; prerendering), `preview` (`config/previewServer.ts`), `e2e` (browser tests), `test` (vitest + coverage), `lint`, `format:check`, `audit:deps`, `audit:dev`, `lighthouse`, `server-config`, and `check` (all of them in sequence, `e2e` added by prerendering)
|
||||
- `web/vite.config.ts` — TanStack Start plugin with prerendering (prerendering; replaces the router plugin, code splitting included) 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
|
||||
@@ -53,8 +53,8 @@ Text alternative: the root route renders AppShell (NavigationBar, Footer, BackTo
|
||||
|
||||
### Existing Files Inventory
|
||||
Candidates for modification are marked with ★ for the over-mij-page feature.
|
||||
- `web/index.html` — HTML entry; static fallback head for non-JS crawlers
|
||||
- `web/src/main.tsx` — bootstrap
|
||||
- `web/index.html` and `web/src/main.tsx` — removed by prerendering; replaced by `src/client.tsx` (hydration entry, Sentry start), `src/router.tsx` (`getRouter`) and the document shell in `routes/__root.tsx`
|
||||
- `web/src/routes/$.tsx` — catch-all route, renders `NotFound` (prerendered as `404.html`; prerendering)
|
||||
- `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 (`/`): Hero + six sections, `?pakket=` search param
|
||||
@@ -76,7 +76,7 @@ Candidates for modification are marked with ★ for the over-mij-page feature.
|
||||
- `web/src/content/aboutContent.ts` — about page content; `web/src/assets/about/*` — portrait and duo photos; `web/public/og-over-mij.jpg` — preview image
|
||||
- `web/src/routes/soorten-fotoshoots/index.tsx` — the shoot types page (moved from `routes/soorten-fotoshoots.tsx`); `newborn.tsx`, `zwangerschap.tsx`, `gezin.tsx`, `loveshoot.tsx`, `portret.tsx` — one route per shoot page (`/soorten-fotoshoots/<id>`); `-shootPageSources.ts` — the sources the shoot routes share
|
||||
- `web/src/content/shootPageShared.ts` — shared shoot page content (breadcrumb, process, deposit, shared FAQ items, offer texts); `web/src/content/shootPages/*.ts` — one content module per shoot page, plus `shootPages.test.ts` (content consistency)
|
||||
- `web/src/test/renderApp.tsx` — `renderApp(path)` and `expectShell()` for the route tests
|
||||
- `web/src/test/renderApp.tsx` — `renderApp(path)` and `expectShell()` for the route tests (prerendering: with a test shell instead of the document shell); `web/src/test/hydrate.tsx` — hydration helpers incl. `hydrateAppAsStart`
|
||||
- `web/src/shootPages.test.tsx` — route tests for the five shoot pages (unit 2): outline, sections, breadcrumb, `aria-current` (main and menus), package variants, OG registry, axe; the overview's "Lees meer" links
|
||||
- `web/src/routes/portfolio.tsx` — the portfolio (indexed; `?shoot=` filter; `ImageGallery` JSON-LD); `web/src/components/portfolio/PortfolioGallery/`, `web/src/content/portfolioContent.ts`, `web/src/lib/portfolioFilters.ts`, `web/src/assets/portfolio/*` (10 photos × 2 sizes), `web/public/og-portfolio.jpg`
|
||||
- `web/src/routes/{contact,privacyverklaring}.tsx` — placeholders with `PageIntro`
|
||||
@@ -99,7 +99,7 @@ Candidates for modification are marked with ★ for the over-mij-page feature.
|
||||
- ★ `web/src/content/types.ts` — content interfaces (API shape)
|
||||
- ★ `web/src/content/*.ts` — static content (`siteContent`, `heroContent`, `homeContent` (exports `introPhotos`), `instagramContent`, `packages`, `testimonials`, `socialPlatforms`)
|
||||
- `web/src/contact/*` — contact form types and placeholder submit
|
||||
- `web/src/hooks/*` — `useRouteFocus`, `useScrolledPast`, `useInView`, `usePageLoaded`, `useReveal`, `useSwipe` (shared by the hero and the lightbox)
|
||||
- `web/src/hooks/*` — `useRouteFocus`, `useScrolledPast`, `useInView`, `usePageLoaded`, `useReveal`, `useSwipe` (shared by the hero and the lightbox), `useHydrated`, `useEmailAddress` (prerendering: first render equals the prerendered HTML)
|
||||
- `web/src/hooks/useDismiss.ts` — Escape and outside pointer down while active (`useDismiss(ref, active, onDismiss)`), used by NavSubmenu and MobileNav (unit 3)
|
||||
- `web/src/components/{PortfolioGrid,Lightbox,FilterBar}/` — gallery building blocks (portfolio-page unit 2): masonry grid in reading order (CSS only), lightbox on Chakra `Dialog` (lazy-loadable default export), single-choice toggle buttons; generic over `GalleryItem` / `FilterOption`
|
||||
- `web/src/lib/*.ts` — pure helpers with tests
|
||||
@@ -113,6 +113,7 @@ Candidates for modification are marked with ★ for the over-mij-page feature.
|
||||
- `web/src/assets/*` — hero photos (8), `home/` (intro 1–4, andrea, deco 1–2, two review photos), light/dark logos
|
||||
- `web/config/securityHeaders.ts` — CSP
|
||||
- `web/config/serverConfig.ts`, `writeServerConfig.ts`, `sitemapPlugin.ts`, `testSeed.ts`
|
||||
- `web/config/{pageFiles,inlineScripts,externalizeInlineScripts,previewServer}.ts` — prerendering: page file names, moving inline scripts to files after the build, preview server with the real server rules; `web/e2e/` and `web/vitest.e2e.config.ts` — browser tests on `dist/client`
|
||||
- `web/deploy/iis/web.config`, `web/deploy/nginx/*.conf` — generated server configs
|
||||
- `web/public/*` — favicon, logo, og-image, robots.txt, icons.svg; `og-{newborn,zwangerschap,gezin,loveshoot,portret}.jpg` (unit 2: 1200 × 630, the shoot pages' `ogImage`)
|
||||
|
||||
@@ -156,8 +157,8 @@ Candidates for modification are marked with ★ for the over-mij-page feature.
|
||||
## Critical Dependencies
|
||||
### @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`
|
||||
### @tanstack/react-router 1.170.46 (+ @tanstack/react-start 1.169.4; prerendering)
|
||||
- **Usage**: File-based routes, static prerendering (Start), `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
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# Component Inventory
|
||||
|
||||
## Application Packages
|
||||
- `web` — React 19 SPA (Vite, Chakra UI v3, TanStack Router): the public website
|
||||
- `web` — React 19 site, statically prerendered (Vite, TanStack Start, Chakra UI v3, TanStack Router): the public website
|
||||
|
||||
## Infrastructure Packages
|
||||
- `.gitea/workflows/continuous_integration.yaml` — Gitea Actions CI/CD (check, lighthouse, deploy-test, deploy-production)
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
```mermaid
|
||||
graph LR
|
||||
main["main.tsx"] --> theme["theme.ts + recipes"]
|
||||
main["client.tsx"] --> theme["theme.ts + recipes"]
|
||||
main --> routes["routes/*"]
|
||||
main --> monitoring["monitoring/*"]
|
||||
routes --> components["components/*"]
|
||||
@@ -25,7 +25,7 @@ graph LR
|
||||
class config build;
|
||||
```
|
||||
|
||||
Text alternative: main depends on theme, routes and monitoring; routes depend on components, content and SEO; components depend on lib, hooks, navigation, assets and the contact form module; build-time config reads monitoring (CSP origins) and SEO (sitemap).
|
||||
Text alternative: client.tsx (replaces main.tsx; prerendering) depends on theme, routes and monitoring; routes depend on components, content and SEO; components depend on lib, hooks, navigation, assets and the contact form module; build-time config reads monitoring (CSP origins) and SEO (sitemap).
|
||||
|
||||
### routes depend on content and components
|
||||
- **Type**: Compile
|
||||
@@ -41,8 +41,8 @@ Text alternative: main depends on theme, routes and monitoring; routes depend on
|
||||
## External Dependencies
|
||||
### @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
|
||||
### @tanstack/react-router 1.170.46, @tanstack/react-start 1.169.4
|
||||
- **Purpose**: Routing and static prerendering (Start, prerendering) — **License**: MIT
|
||||
### react / react-dom ^19.3.0
|
||||
- **Purpose**: UI runtime — **License**: MIT
|
||||
### @sentry/react ^11.8.0
|
||||
|
||||
@@ -8,7 +8,8 @@
|
||||
## 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, dev only)
|
||||
- TanStack Router — 1.170.46 (exact) — file-based routing, head management (devtools ^1.167.2, dev only)
|
||||
- TanStack Start — @tanstack/react-start 1.169.4 (exact) — static prerendering (prerendering feature)
|
||||
- @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
|
||||
@@ -22,7 +23,7 @@
|
||||
## Build Tools
|
||||
- Vite — ^8.3.0 — dev server and bundler
|
||||
- @vitejs/plugin-react — ^6.1.2
|
||||
- @tanstack/router-plugin — ^1.168.40 — route tree generation, code splitting
|
||||
- Route tree generation and code splitting — inside TanStack Start (prerendering; the direct @tanstack/router-plugin was removed)
|
||||
- @chakra-ui/cli — ^3.37.0 — theme typegen
|
||||
- pnpm — 12.11.2 — package manager
|
||||
- Node — 24 (CI)
|
||||
@@ -35,3 +36,4 @@
|
||||
- ESLint ^9.39.5 + typescript-eslint, react-hooks, jsx-a11y
|
||||
- Prettier ^3.9.9
|
||||
- @lhci/cli ^0.15.1 — Lighthouse CI (mobile and desktop)
|
||||
- playwright-core 1.55.0 (exact) — browser tests (`pnpm e2e`, prerendering)
|
||||
|
||||
Reference in New Issue
Block a user