Files
AndreaSlopFotografie/aidlc-docs/_shared/reverse-engineering/api-documentation.md
T
SluijsensandClaude Opus 5.5 c81dcd3979 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 <noreply@anthropic.com>
2026-10-19 23:46:30 +02:00

68 lines
3.5 KiB
Markdown

# API Documentation
## REST APIs
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 | 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 / 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<RoutePath, PageMeta>`, `pageList(pages)`
- `sitemapXml(...)` — used by `config/sitemapPlugin.ts`
### Components (props)
- `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
- `useHeroSlider(count)` → slider state, controls, handlers, `HeroAnnouncement`
- `useScrolledPast(getThreshold)` → boolean (stable `getThreshold` required)
- `useRouteFocus()` — focuses `<main>` 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
### 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?`