# Services — Portfolio Page There is no service layer in this SPA (no back-end yet). "Orchestration" happens in the route and one page-specific component; everything that decides what is shown is a pure helper in `lib/`. ## Route as orchestrator (`routes/portfolio.tsx`) - **Reads**: `portfolioContent`, `instagramContent`, `shootTypes`, `siteContent.socials` - **URL state**: `validateSearch` turns `?shoot=` into `{ shoot?: ShootTypeId }` (allowlist). The component re-checks it against the shoot types that actually have photos (`shootFromSearch` with `shootTypesWithPhotos`), so a valid id without photos falls back to "Alles" - **Changes**: `navigate({ search: shoot ? { shoot } : {}, replace: true, resetScroll: false })` — no history entry per filter (Q4 = A), no scroll jump - **Head**: `pageHead('/portfolio')` + gallery JSON-LD - **Renders**: `PageIntro` → `PortfolioGallery` → `InstagramGrid` (only with a valid Instagram link, as on the homepage) ## PortfolioGallery as page controller - **Derives** (pure, memoised on input): filter options, filtered photos, gallery items - **Holds** the only UI state of the page: `openIndex: number | null`; closes the lightbox when the filter changes - **Coordinates**: grid `onOpen` → `openIndex`; grid `onIntent` → start loading the lightbox chunk; lightbox `onIndexChange` / `onClose`; filter `onChange` → route callback + polite count announcement - **Focus return**: on close, focus goes to the tile of the item shown last (requirements FR-PF-06) ## Future API - `GET /api/portfolio` can return `PortfolioContent` 1-to-1; the route then loads it instead of importing the module. Shoot types come from the same API as the Soorten fotoshoots page. Nothing else changes.