# Services ## Frontend services ### ThemeService (inside ThemeProvider) - Reads/writes mode in localStorage key `slp-software-mode` (guarded try/catch); never writes the variant. Applies `data-variant`/`data-mode`. Migration: ignore the old `slp-software-theme` key. ### OfferingsService (usePackagesQuery) - `GET /api/v1/offerings` via TanStack Query; later replaced by `cms-client/offerings`. ### ContactService (cms-client/contact) Orchestration of one submission: 1. On first focus (or mount), `getToken()` fetches the server-signed timestamp token and captcha info. 2. `useContactForm` validates on blur / submit; honeypot filled → no request, show success (silent drop). 3. Submit sends `POST /api/v1/contact-messages` with `Idempotency-Key`. 4. `202` → `sent`; `400` token expired → refetch token and retry once; `400` field errors → map to fields; `429` → `failed` with retry-after message; other → `failed` (input kept). 5. No PII in logs, Sentry breadcrumbs or analytics events (Sentry `beforeBreadcrumb`/`beforeSend` scrub for the form route). ### Observability - Existing Sentry and Umami remain. Umami event for form outcome without field data (`contact-sent`, `contact-failed`). ## Backend services (SlpModularCms, by `SLS Software - CMS`) - **ContactMessageService**: validate → store (status `new`) → send mail best-effort via `IEmailSender` → update `mailStatus`. - **ContactTokenService**: issues and verifies HMAC-signed timestamp tokens (site-bound). - **SpamGuard**: honeypot, minimum elapsed time from the token, optional captcha verification (Friendly Captcha), identical 202 response on spam. - **RetentionJob**: deletes messages older than the configured retention (12 months). - **RateLimiting**: extends `AddCmsRateLimiting` with policy `ContactForm`; needs `ForwardedHeaders:KnownProxies` for the real client IP.