# 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 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["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)"] Shell --> Outlet["Outlet (active page route)"] Shell --> Footer["Footer (FooterColumn, FooterLink)"] Shell --> ToTop["BackToTop"] Shell --> Umami["UmamiAnalytics"] Outlet --> Home["routes/index.tsx: Hero + six sections"] Outlet --> About["routes/over-mij.tsx: about page"] Outlet --> Portfolio["routes/portfolio.tsx: PortfolioGallery + InstagramGrid"] Outlet --> Placeholders["contact, privacyverklaring: PageIntro"] Outlet --> ShootPages["routes/soorten-fotoshoots/: overview and five shoot pages"]:::page Home --> Hero["Hero (HeroArrows, HeroPauseButton, HeroSocials, useHeroSlider)"] Home --> Sections["components/home/: IntroGallery, AboutBlock, Pricing, Testimonials, ContactSection; shared InstagramGrid"] Sections --> Blocks["Shared blocks: PageSection, MediaText, CallToAction, RichParagraph, Eyebrow, SectionHeading, FramedImage, DeferredImage, Reveal; gallery: PortfolioGrid, Lightbox, FilterBar"] Sections --> Form["ContactForm + ContactFormGate (lazy), contact/"] Content["content/: siteContent, heroContent, homeContent, packages, testimonials, 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,Skip,Nav,Footer,ToTop,Umami,Outlet shell; class Home,About,Portfolio,Placeholders,Hero,Sections,Form page; class Content,NavData,Seo,Theme,Blocks support; ``` 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 ### client.tsx, router.tsx (replace main.tsx; prerendering) - **Purpose**: Application bootstrap - **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`; document shell (`shellComponent`, prerendering); `routes/$.tsx` is the catch-all for unknown URLs (prerendered as `404.html`) - **Type**: Application ### components/AppShell.tsx - **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 until scrolled; shrinks after scroll; logo links home (the light logo is lazy off `/` until the page has loaded); desktop links and full-screen mobile menu from `mainNav`; without JavaScript a `