GlyphfieldDocs
Documentation/System reference

Self-hosting

Install, build and deploy your own Glyphfield server with the right Node and pnpm versions, keep its dynamic routes working, and verify the deployment.

Last updated Oct 16, 2026

Glyphfield is a Next.js application with dynamic API, social image, Markdown and full-documentation routes. It is not a static export. A complete deployment runs the Next.js server and lets the browser use Canvas, WebGL, storage, files and downloads normally.

Glyphfield documentation and Studio system represented by the General Translation identity workspace
One deployment serves docs, discovery, API, and StudioNext.js · local-first browser state

Requirements

RequirementValueSource
Node.js22.13 or laterpnpm 11.15.1 requires Node.js 22.13, and Next.js 16 requires 20.9. package.json declares no engines field, so pin the version in your deployment environment
pnpm11.15.1packageManager in package.json. Enable Corepack so this version is used
Installpnpm install --frozen-lockfileThe lockfile is authoritative. pnpm 10 cannot install it with --frozen-lockfile because of its patched dependencies
VercelENABLE_EXPERIMENTAL_COREPACK=1Lets Vercel install with the pinned pnpm version

Install and run

corepack enable
pnpm install --frozen-lockfile
pnpm dev

pnpm dev starts Next.js with Turbopack on http://localhost:3012.

For a production server:

pnpm install --frozen-lockfile
pnpm typecheck
pnpm test
pnpm build
pnpm start

pnpm typecheck generates the documentation collection with fumadocs-mdx before it type-checks. pnpm start runs next start. Set the host and port with your hosting platform or the next start options. Integrations should read their own BASE_URL instead of hard-coding a deployment hostname.

Environment variables

VariableEffectDefault
NEXT_PUBLIC_STUDIO_URLThe public origin used for canonical URLs, Open Graph URLs, the sitemap, the sitemap link in robots.txt and the introduction of /llms-full.txt. A trailing slash is removedhttps://www.glyphfield.com. An empty value also uses the default
ENABLE_EXPERIMENTAL_COREPACKSet to 1 on Vercel so the build installs with the pinned pnpm versionNot set

Set NEXT_PUBLIC_STUDIO_URL before pnpm build, because Next.js reads NEXT_PUBLIC_ variables when it builds. The application code in src reads two other environment variables: NODE_ENV, which Next.js sets itself, and VERCEL_ENV, which Vercel sets. Google Analytics loads only on a Vercel production deployment that keeps the default NEXT_PUBLIC_STUDIO_URL, so a copy that sets its own origin sends no analytics. public/llms.txt is a static file that names https://www.glyphfield.com, so edit it in a self-hosted copy.

Routes to keep

Route familyPurposeRuntime behavior
/studioInteractive brand toolsRendered and stored in the browser
/docs/**Human documentationServer-rendered Fumadocs pages
/docs.md, /docs/**.mdProcessed Markdown copies of the docsRewritten to /api/docs
/llms.txtShort router for agentsStatic public file
/llms-full.txtComplete processed documentationGenerated on each request from the current docs source
/api/agent, /api/catalog, /api/labs, /api/materials, /api/identities, /api/elementsAgent discoveryJSON. Cache only as the response headers allow
/api/generate, /api/brand/validate, /api/brand/kitDeterministic generation and brand validationPublic POST, validated and processed in memory, no-store
/openapi.jsonOpenAPI 3.1 contractJSON with max-age=300
/og/**, /api/og, /api/og-homeSocial imagesImages rendered by the server
/api/surface-textures/**Allowlisted surface texture mapsServes only known assets and maps

Do not configure a CDN to turn the dynamic API, Markdown, social image or full-documentation routes into one long-lived static response.

Local-first storage

Projects and tool state live in each visitor's browser, and there is no server database. This has three consequences for operators:

  1. Deploying a new server does not move anyone's browser projects.
  2. A change of hostname, scheme or port creates a separate browser storage origin.
  3. Server backups do not contain user projects, saved designs or original local files.

Before changing a production origin, ask users to follow Backup and restore.

Proxy and response requirements

  • Forward GET, POST and OPTIONS requests with their bodies.
  • Keep the Content-Type, Content-Disposition, cache and CORS headers of API responses.
  • Accept request bodies up to 5,250,000 bytes, the application's limit, so the application can return its own 413 error.
  • Do not rewrite raw SVG responses from /api/generate as HTML.
  • After any change to security headers, including cross-origin isolation, test Canvas, fonts, local files, downloads and WebGL.
  • Serve production over HTTPS. The clipboard and the EyeDropper API (Pick screen color) work only in a secure context.

Health checks

After deploying, check the contracts as well as the home page:

BASE_URL=https://your-glyphfield.example

curl -fsS "$BASE_URL/api/agent" | jq '.schemaVersion'
curl -fsS "$BASE_URL/api/labs" | jq '.count'
curl -fsS "$BASE_URL/api/materials" | jq '.count'
curl -fsS "$BASE_URL/openapi.json" | jq '.openapi'
curl -fsS "$BASE_URL/docs/reference/endpoints.md" | head
curl -fsS "$BASE_URL/llms-full.txt" | head

Then open the deployed Studio in a supported browser, create a temporary project, render a material, reload once and export a small PNG. Passing HTTP checks does not prove that browser storage or graphics work.

Generation smoke test

curl -fsS -X POST "$BASE_URL/api/generate" \
  -H 'Content-Type: application/json' \
  -d '{
    "kind": "background",
    "identity": { "preset": "gt" },
    "settings": { "width": 1200, "height": 630 },
    "output": "raw"
  }' \
  -o glyphfield-smoke.svg

test -s glyphfield-smoke.svg

Read GET /api/generate before changing the request. The live contract is authoritative.

Operational ownership

The application validates request shapes, body size and geometry limits. The hosting platform owns network rate limiting, request logs, abuse response, uptime and rollback. A passing local build does not confirm that a firewall rule is active on the host. API security describes the production rate limit, and Browser support covers graphics, storage and codec checks.

Release checklist

  1. Install from the lockfile.
  2. Generate the docs collection and type-check.
  3. Run the contract and rendering tests.
  4. Build the production application.
  5. Review firewall changes before publishing them.
  6. Check the discovery, Markdown, OpenAPI, generation and social image routes.
  7. Check browser storage and one still or motion export that the release affects.
  8. Keep the previous deployment available until the source and export smoke tests pass.

Contributing, Troubleshooting and Storage and privacy cover development and operations further.

On this page