CMS Guide

Sanity Studio is hosted on Sanity (App Studio). The storefront pulls content via GROQ and revalidates via webhook on publish.

  • Studio URL: https://www.sanity.io/@oJjkNT4GN/studio/blgyxui5ep83evp3wncgrwyy
  • Storefront URL: https://rubrion.store
  • Sanity project: rubrion-store (id l54kfv7o)
  • Dataset: production

Accessing Studio

  1. Open the Studio URL above.
  2. Log in with your Sanity account.
  3. If access is denied, ask the project owner to invite you: sanity.io/manage → rubrion-storeMembersInvite member → role Editor or Viewer.

The sidebar shows: Home pages, Navigation, Landing pages, Static pages — each per locale (BR / ES / US).

Daily editing flow

Home page

  1. Sidebar → Home pages → choose locale.
  2. Fill Hero (heading, paragraph, image, up to 3 buttons) + Sections (Banner / CTA / Featured products).
  3. Set SEO if needed. Click Publish.

Landing page

  1. Sidebar → Landing pages+ Create.
  2. Fill Internal title, Locale, Slug (e.g. summer-sale).
  3. Publish → live at https://rubrion.store/us/summer-sale.
  1. Sidebar → Navigation → choose locale.
  2. Edit Header links, Footer groups, Legal links. Publish.

Static pages

  1. Sidebar → Static pages+ Create.
  2. Fill title, locale, slug (e.g. privacy), body (rich text).
  3. Publish → live at https://rubrion.store/us/pages/privacy.

Cache revalidation

Two paths run in parallel:

  • Webhook (instant) — on Publish, Sanity fires a signed webhook → /api/revalidate. Handler invalidates Next.js cache tags scoped to the doc (~1 second).
  • ISR fallback (60 s) — if the webhook ever fails, Next.js auto-revalidates after 60 s on the next request.

Verify webhook health: sanity.io/manage → rubrion-storeAPIWebhooksAttempts tab. Look for HTTP 200 responses.

Updating Studio schema

cd apps/storefront

# 1. Edit schema files under sanity/schemas/
# 2. Edit sanity/structure.ts if sidebar layout changed
# 3. Validate locally
bunx sanity schema validate

# 4. Deploy schema + Studio
bun run studio:deploy

For iterating locally without deploying:

bun run studio:dev   # local Studio at http://localhost:3333

CMS env vars (Marketplace service on Railway)

VarPurpose
NEXT_PUBLIC_SANITY_PROJECT_IDSanity project to read from
NEXT_PUBLIC_SANITY_DATASETdataset name (production)
NEXT_PUBLIC_SANITY_API_VERSIONAPI version pin
SANITY_API_READ_TOKENServer-only read token
SANITY_REVALIDATE_SECRETWebhook signature secret

Common operations

TaskWhereRedeploy needed
Change hero copyStudio → Home pages → publishNo
Add new banner sectionStudio → Home → Sections → publishNo
Add a new localeEdit sanity/env.ts + storefront i18nYes + studio:deploy
Add new field to existing schemaEdit sanity/schemas/...tsstudio:deployOnly if storefront consumes new field
Update GROQ queryEdit sanity/lib/queries.tsYes (storefront)
Change webhook secretSanity webhooks UI and Railway envYes (storefront)