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>
3.4 KiB
3.4 KiB
Services — homepage-sections
The site has no back-end; "services" here are the front-end mechanisms that provide content, connect sections and will later talk to the API.
1. Content provisioning
- Responsibility: deliver section content to the components.
- Today: static modules
content/homeContent.ts,content/packages.ts,content/testimonials.tsand the existingcontent/siteContent.ts, imported byroutes/index.tsxand passed down as props. Images are imported fromweb/src/assets(Vite-hashed URLs, typed asContentImage). - Later: the same shapes come from the .NET API (
/api/pages,/api/packages, testimonials and the Instagram feed server-side) through a route loader; components do not change. - Rule: components never import content modules directly — only the route does. Keeps them testable with generated content.
2. Package handover (Prijzen → Contact)
- Responsibility: "Boek je shoot" brings the visitor to the form with the package chosen (design Q4 = A).
- Flow:
PriceCardrenders a routerLinkto/withsearch={{ pakket: pkg.id }}andhash="contact". The/route'svalidateSearchkeepspakketas an optional string; the page resolves it withpackageFromSearchagainst the package list (unknown values are ignored) and passes it toContactSection→ContactFormasinitialShoot. The router scrolls to#contact. - Properties: survives a reload, shareable, no shared mutable state between sections.
3. Contact submission adapter
- Responsibility: the only place that sends a contact request.
- Today:
submitContactFormrejects with a generic error; withcontactForm.enabled = falseit is never reached because the form is inert. - Later (API feature):
POST /api/contactwithContactPayloadplus the Friendly Captcha token; server-side validation, spam checks and rate limiting; CSP additions for Friendly Captcha. - Switch:
siteContent.contactForm.enabled(design Q5 = A) — can be turned on and off again; later deliverable by the CMS.
4. Spam filtering (browser side)
- Responsibility: drop obvious bot submissions before they reach the adapter.
- Flow: on submit, after validation,
isLikelySpam({ honeypot, shownAt, now }); spam gets the normal success message and nothing is sent.
5. Scroll reveal
- Responsibility: fade sections in as they enter the viewport (
useReveal+Reveal), disabled under reduced motion.
Orchestration
sequenceDiagram
box rgba(246,224,94,0.4) Visitor
participant V as Visitor
end
box rgba(99,179,237,0.4) Homepage
participant P as PriceCard
participant R as Route /
participant C as ContactForm
participant A as submitContactForm
end
V->>P: Click Boek je shoot (Newborn)
P->>R: Navigate to /?pakket=newborn#contact
R->>R: packageFromSearch checks the id
R->>C: initialShoot newborn, scroll to contact
V->>C: Fill in and submit
C->>C: validateContact, isLikelySpam
C->>A: ContactPayload (only when enabled and not spam)
A-->>C: Resolved or generic error
C-->>V: Status message
Text alternative: clicking "Boek je shoot" navigates to the homepage with the package in the URL; the route checks it and preselects it in the form; on submit the form validates and filters spam before calling the single submission adapter and showing a status message.