> For the complete documentation index, see [llms.txt](https://suigar.gitbook.io/suigar-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://suigar.gitbook.io/suigar-docs/seo/subprojects/frontend.md).

# Production frontend

Last reviewed: 2026-07-13

Applies to `frontend/`, the production Suigar web app.

## Current Anchors

* Metadata component: `frontend/src/components/PageTitle.tsx`.
* Global defaults: `frontend/src/configs/seo.ts`.
* Structured data helpers: `frontend/src/utils/seo.ts`.
* Sitemap inventory: `frontend/scripts/sitemap-routes.mjs`.
* Sitemap validation/build: `frontend/scripts/sitemap-generator.mjs`.
* Metadata quality report: `frontend/scripts/seo-metadata-report.mjs`.
* Static route head writer: `frontend/scripts/seo-static-html.mjs`.
* Robots/sitemap post-build assets: `frontend/scripts/write-seo-assets.mjs`.
* Frontend deploy workflow: `.github/workflows/frontend.yaml`.
* Shared static deploy action: `.github/actions/deploy-static-site/action.yml`.
* Frontend CloudFront route rewrite: `infrastructure/main.tf` `aws_cloudfront_function.frontend_host_redirect`.

## Rules

* Every public route must use `PageTitle` directly or through shared SEO helpers.
* Every concrete TanStack route must be classified as indexed or excluded in `sitemap-routes.mjs`.
* Every indexed sitemap route must include static SEO metadata in `sitemap-routes.mjs` so raw HTML has a unique title, description, and canonical before React runs.
* Frontend sitemap entries emit only canonical `loc` plus source-derived `lastmod`; `changefreq` and `priority` are forbidden.
* The production build must regenerate both `dist/sitemap.xml` and the timestamp-free `dist/sitemap_index.xml`; non-mainnet builds must remove both.
* Mainnet robots must advertise only `https://suigar.com/sitemap_index.xml`.
* Indexed route titles and descriptions must remain unique and within the current metadata quality bounds enforced by `pnpm --filter @suigar/ui run check:seo`.
* Mainnet builds must generate static route HTML with `index, follow`; non-mainnet builds must generate the same route files with `noindex, nofollow` so app routes keep working without competing in search.
* Frontend deploys must upload route HTML with HTML cache headers and SEO control files with short-lived cache headers. Do not deploy nested `*/index.html` as immutable assets.
* Game pages should use `buildGameSeoMeta` unless they need a more specific override.
* Authenticated, callback, tokenized, redirect-only, development, and thin dynamic pages should stay excluded or emit `noIndex`.
* Mainnet is the production canonical surface. Testnet/devnet should not compete for indexation.
* The shared production sitemap audit is opt-in through `ENABLE_LIVE_SITEMAP_AUDIT=true`; it must not block deployments by default.
* Legacy `mainnet.suigar.com` URLs must redirect path-preserving to `https://suigar.com`.
* Legacy route aliases such as `/lootbox`, `/roadmap`, `/rewards`, and `/weekly-contest` must server-side 301 to their current canonical targets instead of returning a soft client redirect.
* Public acquisition pages must be useful to logged-out users and must expose crawlable links for important destinations.
* Keep copy degen-simple and action-oriented. Do not expose backend internals, sponsorship fallback mechanics, stack traces, or implementation names.

## Validation

Run for route/indexability changes:

```bash
pnpm run test:seo
pnpm --filter @suigar/ui run check:seo
```

For metadata review without failing on issues:

```bash
pnpm --filter @suigar/ui run check:seo:metadata
```

For mainnet build metadata changes, also confirm that generated static route HTML has route-specific heads:

```bash
NETWORK=mainnet pnpm --filter @suigar/ui run build
pnpm --filter @suigar/ui run check:seo:static
```

For non-mainnet route-serving changes, confirm generated route HTML exists and emits noindex:

```bash
NETWORK=testnet pnpm --filter @suigar/ui run build
rg 'name="robots" content="noindex, nofollow"' frontend/dist/games/index.html
```

Use broader checks when page code, metadata rendering, or structured data changes:

```bash
pnpm --filter @suigar/ui run typecheck
pnpm --filter @suigar/ui run build:ci
```

## Next Improvements

* Add page-specific social preview assets for game and campaign pages.
* Attach Search Console canonical/indexing evidence to `../status.md`.
