Skip to content

CMS (Sanity)

Sanity appears in two places: the standalone Studio in apps/cms, and the dormant CMS starter shipped inside the project template.

A Sanity Studio (schemas + desk structure) trimmed from the turbo-solid starter. Schemas are organized under schemas/ as blocks, pages, settings, slices, and taxonomies. Runs with pnpm dev:cms on localhost:4700 (off Sanity’s default 3333 so outside studios never collide).

Shared Sanity settings (project ID, domains, locales) come from packages/config.

Scaffolded projects include a Sanity starter (src/sanity/, sanity.config.ts, src/lib/sanity.ts) that stays dormant until connected. The editor’s Connect CMS flow (apps/app/src/lib/cms.ts):

  1. installs the Sanity dependencies into the project,
  2. writes PUBLIC_SANITY_PROJECT_ID (and friends) to the project .env,
  3. which activates @sanity/astro and the embedded Studio at /admin via the template’s env-guarded astro.config.mjs.

The stock sanity schema deploy cannot be used from the app: the Sanity CLI 7.x vite/rolldown worker SIGABRTs and swallows its own error output. Instead the app bundles a Bun script (apps/app/src-tauri/scripts/sanity-deploy-cli.ts) that the deploy_schema Tauri command writes to a temp file and runs with the project’s Bun, authenticated by the developer’s existing Sanity CLI login.

Success or failure, the script’s output carries an PLYY_RESULT: line that the frontend parses (parseDeployResult in src/lib/cms.ts).

  • packages/config — shared configuration consumed by the apps: sanity.ts (project settings), domains.ts, locales.ts
  • packages/tailwind-config — shared Tailwind v4 theme (theme.css, styles.css) used by the desktop app and web app