The reference host's pages
Part of Architecture, which is built from ARCHITECTURE.md in the repository, where it is edited.
The routes of the reference site.
packages/web/src/routes.ts is the host's route table. The pages are:
/, the product page (routes/product.tsx,src/product/). It is server-rendered and static, and it sits outside the app layout (below), so it builds no services: no adapter, no layer definition, no engine and no engine styles are loaded there and no tile is requested. Its picture of the playground is committed WebP captures, one view at two sizes (product/captures, taken byscripts/captureProduct.ts,docs/guides/product-captures.md), served from this site, so no tile is requested for it either. Its loader returns the latest release, read fromCHANGELOG.mdat build time byproduct/releaseFacts.server.ts, so the page asks no service for it and the changelog stays on the server. Its own markup requests nothing from another site; in production the host adds its cookieless page-view counter, as on every page. Its words live once, inproduct/productContent.ts, and three outputs are rendered from them: the page itself, its Markdown twin at/index.mdand the second half of/llms-full.txt. The embedding example is the README's three files (product/embedExampleFiles.tsand the files inproduct/embed/), held as text because nothing underpackages/may import the umbrella package: a test keeps each file equal to the README's block and tosites/docs/docs/guides/embed-a-map.md, andpackages/core/src/lint/readme.test.tstype-checks the README'smain.tsxas an app outside the repository would. The page shows an excerpt ofmain.tsx, cut from that file byexcerptOf, so it shows code that compiles. It draws a map only when a project that installs@mapcairn/sdk,react,react-domandmaplibre-glruns it; nothing on the page runs it. Its artwork takes every position fromproduct/surveyGeometry.ts, pure functions of a few constants, which a unit test and a browser test check. The page is English only by decision, so its route'shandle(PageLanguageHandle) sets<html lang="en-GB">in the server render. The root marks that fixed language so the pre-paint theme script does not replace it with a stored playground language./map, the playground (routes/map.tsx): the map, mounted after hydration as before. Its server render carries a short description of the playground for readers that do not run the app./privacy, the privacy policy.
The root route renders only the matched page. The services, the one announcer and tooltips belong to a pathless layout route, routes/app.tsx, around /map, /privacy and the development-only /design and /design/two-maps: it calls createServices() once per app instance and keeps <html lang> and the tab title in step with the interface's language. A full page that is not the map (the product page and the privacy page) carries data-document-scroll on its container, and then the document scrolls rather than the map's fixed frame (global.css.ts), so the keyboard scrolls it from the first key press. The map package marks its style modules as its only side effects ("sideEffects" in its manifest), so a page that uses one or two of its components loads only their styles and code.
Each page exports its own meta through buildPageMeta (title, description, Open Graph and Twitter tags, a preview image the project draws itself) and its own JSON-LD from structuredData.ts: SoftwareSourceCode and the page's questions as an FAQPage on /, a WebApplication and a breadcrumb trail on /map, a WebPage and a trail on /privacy, and the WebSite on each. The resource routes robots.txt, sitemap.xml, llms.txt, llms-full.txt and index.md are built once from the same sources (product/llmsText.ts, product/productMarkdown.ts).
The playground moved from / to /map. A shared link keeps the map's state in the fragment, which the server never receives, so the move cannot be a server redirect. Instead the product page's first element is an inline script (app/mapLinkRedirect.ts), allowed by its own SHA-256 hash in the Content Security Policy beside the theme script's: when the fragment holds a key=value pair, it replaces the address with /map, keeping the query and the fragment, before the page paints. UrlState reads and writes the fragment on whatever path the map is on, so the playground's own links carry /map.