# Sites Website onboarding

## Purpose

Sites supports a reusable multi-Website registry. It does not create a universal CMS or a generic public page builder. Each Website has a stable identity and can use a purpose-built frontend implementation when needed.

## Resumable setup flow

1. **Basics** — Create a Website with a human name, immutable normalized code and unique primary hostname. Creation is always Draft.
2. **Operators** — Add one or more active operators as Website variants. A variant starts as Draft; its public slug is Website-owned. Great Eastern defaults to `ge`.
3. **Identity** — Set the public Site Title. Logo and favicon are optional uploads.
4. **Typography** — Keep the default type system or choose a Google Font / WOFF / WOFF2 source and optional responsive H1–H6 / paragraph matrix.
5. **Marketing** — Optional Google Ads and trusted provider header code. Header code is Website-isolated and only injected into eligible public marketing pages, never legal pages or management portals.
6. **Domain** — Run the existing Domain Health check. Hostname data is normalized and must not contain a scheme, path, query or fragment.
7. **Review** — Inspect required readiness checks, frontend implementation status and global shared settings. The review never auto-publishes a Website.

The Website detail page keeps every stage as an independent tab so a Sites administrator can stop and resume without losing progress.

## Lifecycle and frontend implementation

`draft`, `live`, `paused` and `archived` remain Website lifecycle states. `frontend_implementation_status` is separate operational metadata:

- `not_started`
- `in_development`
- `ready`

Setting the frontend status to `ready` does not publish a Website. A Website cannot be made Live unless a published Main Operator is selected and its frontend status is Ready. Domain health and all other readiness checks remain visible for an explicit administrator decision.

## Main operator rule

The Main Operator is never silently inferred. It can only be selected from operators configured for that Website whose variant status is Published. Switching the Main Operator affects only that Website.

## Shared and Website-specific configuration

Website-specific: domain, identity assets, typography, marketing/header code, configured operators, Main Operator, health and reporting.

Global/shared: Operator Themes, legal templates, Campaign Popups and Social Proof. Global legal templates resolve Website variables at render time; no Website onboarding step duplicates legal content.

## Second Website verification

Website #2 exists only in automated tests/factories; production seed data remains Takaful.Online only. Tests prove isolated domain, operator variants, Main Operator and frontend implementation state while preserving the global settings model.
