# Public site

> How the public site and its docs are built.

Source: https://werker.cloud/docs/engineering/site-plan (updated 2026-12-01)

The landing page, the pages about Werker and the blog are a separate
app, `apps/site`. It is deployed at `werker.cloud`, with the app
(`apps/app`) at `app.werker.cloud`, as two Coolify applications
([Coolify](../self-hosting.md#on-coolify)).

## Why two apps

- The site has no database or sign-in, and its server only runs the
  [waiting list](#waiting-list). Its policy in
  `tools/checks/policy.ts` allows only `@werkerai/ui` and the pure
  `@werkerai/rules`.
- The site builds without the app.
- A self-hosted install gets the app only. Its `/` redirects to the
  dashboard or to sign-in (`apps/app/src/routes/+server.ts`).

## Deploying it

A second Coolify application from the same repository, beside the
[app](../self-hosting.md#on-coolify). Its addresses and sender are in
`apps/site/src/lib/site.ts`.

| Setting           | Value                                |
| ----------------- | ------------------------------------ |
| Site type         | Dynamic (a web application)          |
| Build pack        | Railpack, base directory `/`         |
| Build command     | `pnpm --filter @werkerai/site build` |
| Start command     | `pnpm --filter @werkerai/site start` |
| Port              | 3000                                 |
| Publish directory | none; Coolify shows `/`              |

- **Environment:** the four `RESEND_*` variables of the
  [waiting list](#waiting-list), and `WERKER_SITE_ORIGIN` on the app
  for [page views](#visitor-analytics).
- A push to `main` redeploys both applications.

## What is shared: `packages/ui`

The theme tokens, the logo and the shadcn-svelte primitives are in
[`packages/ui`](https://github.com/werker-ai/werker/blob/main/packages/ui/README.md). Each app
compiles them from source in its own build.

## How the site is built

- SvelteKit with `@sveltejs/adapter-node`; every route is prerendered
  (`apps/site/src/routes/+layout.ts`). `pnpm build` writes
  `apps/site/build/`.
- `pnpm dev:site` serves it on port 5232.
- Pages and posts are markdown in `apps/site/src/content/pages/` and
  `apps/site/src/content/blog/`, compiled by mdsvex 1.1.0 (a Vite
  plugin). Code fences are highlighted with twinkleplop at build time
  (`@twinkleplop/theme-night-owl`).
- Frontmatter is checked at build (`apps/site/src/lib/content.ts`):
  `title`, `description` (200 characters at most), `updated`, and
  `published` for a post. A missing or bad field fails the build.
- The order of pages, in menus and in `llms.txt`, is `page_order` in
  the same file. Short menu names are in
  `apps/site/src/lib/messaging/chrome.ts`.

### The docs section

`/docs` is every doc, written in `apps/site/src/content/docs/`: pages
for people using Werker, and `engineering/` for working on its code
(`.agents/skills/docs/SKILL.md`). Root `docs/` holds one generated
file, `glossary.md`, written by `pnpm docs:glossary`
(`apps/site/src/lib/server/glossary.ts`); a test fails when it is
stale.

- **Layout:** the docs have their own
  (`apps/site/src/routes/docs/+layout.svelte`). Every other page is in
  `apps/site/src/routes/(site)/`.
- **Groups and order:** `apps/site/src/lib/docs/groups.ts`. A doc it
  leaves out fails a test. `/docs` redirects to Getting started.
- **Frontmatter:** as for a page.
- **Moved pages:** `apps/site/src/lib/moved.ts` lists the old
  addresses, which the server redirects (`src/hooks.server.ts`).
- **Links:** between docs they become pages; anything else in the
  repository opens on GitHub (`apps/site/src/lib/docs/links.ts`). A
  link to a missing doc or heading fails the build.
- **Writing:** the rule on `{`, `}`, `<` and `>` below applies here.
- **Search:** the browser fetches every section once, from
  `/docs/search.json`, and ranks them itself
  (`apps/site/src/lib/docs/search.ts`). `/docs/search?q=` lists more.
  A result opens with the words marked from `?find=`
  (`apps/site/src/lib/docs/highlight.ts`).
- **Links to other sites** open in a new tab
  (`apps/site/src/lib/components/document-link.svelte`), in pages and
  posts too.
- **Link graph:** `/docs/graph`
  (`apps/site/src/lib/components/docs/graph.svelte`).
- **Credit:** the sidebar credits
  [wiki0](https://github.com/spences10/wiki0)
  (`apps/site/src/lib/components/docs/wiki0-credit.svelte`).

### Adding a page or a post

1. Add `apps/site/src/content/pages/<slug>.md` or
   `apps/site/src/content/blog/<slug>.md` with the frontmatter above.
2. For a page, add its slug to `page_order`.
3. Outside code spans and fences, do not write `{`, `}`, `<` or `>`:
   mdsvex reads them as Svelte. A value containing `: ` in the
   frontmatter must be quoted.

## What is written for programs

Each is built from the same lists as the pages
(`apps/site/src/lib/server/machine-files.ts`).

| Address           | What it is                                                              |
| ----------------- | ----------------------------------------------------------------------- |
| `/<slug>.md`      | The page as markdown, with its title and address on top                 |
| `/blog/<slug>.md` | The post as markdown                                                    |
| `/docs/<slug>.md` | The doc as markdown                                                     |
| `/llms.txt`       | An index: what Werker is, then a link to each page's and doc's markdown |
| `/llms-full.txt`  | Every page, doc and post in one markdown file                           |
| `/sitemap.xml`    | Every page, doc and post with the date it was updated                   |
| `/robots.txt`     | Allows every crawler and names the sitemap                              |
| `/blog/rss.xml`   | The blog as RSS 2.0                                                     |

### Head tags and share cards

- Head tags come from [svead](https://github.com/spences10/svead)
  0.2.0, in one component (`apps/site/src/lib/components/seo.svelte`):
  the title, description, canonical link, Open Graph and Twitter tags.
  The same component adds a link to the page's markdown.
- JSON-LD is written by svead's `SchemaOrg` from typed nodes
  (`apps/site/src/lib/structured-data.ts`): `WebSite` and
  `SoftwareApplication` on `/`, `TechArticle` on a page, `BlogPosting`
  on a post, and `FAQPage` on `/faq`, read from its `##` headings
  (`apps/site/src/lib/server/faq.ts`).
- Every page, post and doc has its own share card, a 1200 by 630 PNG
  at `/api/og-image/<slug>.png` (`blog-<slug>` for a post,
  `docs-<slug>` for a doc, `site` for `/`). Nothing is drawn by hand:
  the card is an SVG built from the page's title and description and
  rendered with Resvg (WASM) while the site is built
  (`apps/site/src/lib/og/cards.ts`,
  `apps/site/src/lib/server/og/render.ts`).
- The cards are set in Inter, from two TTF files in
  `apps/site/src/lib/server/og/fonts/` (SIL Open Font License,
  `OFL.txt` beside them).

## Pages

| Page            | Answers                                    | Drafted from                                                      |
| --------------- | ------------------------------------------ | ----------------------------------------------------------------- |
| `/`             | What Werker is                             | `apps/site/src/routes/(site)/+page.svelte`                        |
| `/how-it-works` | Describe, generate, run, result; factories | [agents, workflows and factories](agents-workflows-factories.md)  |
| `/security`     | Sandboxes, network, keys, workspaces       | [sandboxes](sandboxes.md), [workspaces](workspaces-and-access.md) |
| `/pricing`      | The three offerings; no prices             | [hosting plan](https://github.com/werker-ai/werker/issues/77)     |
| `/status`       | Each built thing and how far it was tested | [status epic](https://github.com/werker-ai/werker/issues/59)      |
| `/fit`          | Who it suits today and who should wait     | [status epic](https://github.com/werker-ai/werker/issues/59)      |
| `/faq`          | Short answers                              | The pages above                                                   |

## Waiting list

The form on the landing page and the dialog a link opens there use
remote functions (`apps/site/src/lib/waiting-list.remote.ts`), and the
site's server calls Resend itself: the app has no part in it.

- Joining emails a link to the landing page; a button in its dialog
  adds the address to a Resend segment, one per answer. Opening the
  link does not.
- The site keeps no list. What was asked for is signed into the link,
  in the fragment, and lasts 7 days.
- **Resend:** the sender is at a domain verified in Resend
  (`email_from` in `apps/site/src/lib/site.ts`). Environment:
  `RESEND_API_KEY` (sending), `RESEND_CONTACTS_KEY` (contacts), and
  the segment IDs `RESEND_USE_SEGMENT` and `RESEND_HOST_SEGMENT`.
  Without all four the form says sign-ups are closed.
- One address is emailed at most every 10 minutes for each answer, and
  100 emails an hour in all, counted in the process: a restart
  forgets.

## Visitor analytics

The site's page views are recorded by the app and shown in Admin →
Analytics with the app's own
([visitor analytics](observability.md#visitor-analytics)). Set
`WERKER_SITE_ORIGIN=https://werker.cloud` on the app. The site posts
to `app_url` in `apps/site/src/lib/site.ts`; it does not post in
development.
