Installation

Set up the template locally, connect it to a Sanity project and add the example content.

Requirements

  • Node.js 24 or later
  • pnpm
  • A Sanity account (the free plan is enough)

1. Get the code

git clone https://github.com/narr07/sanity-nuxtui.git my-sitecd my-sitepnpm install

The repository is a pnpm workspace with two apps: apps/studio (Sanity Studio) and apps/web (the Nuxt site).

2. Create a Sanity project

Create a project at sanity.io/manage and copy its project ID. Or let the CLI do it:

pnpm --filter studio exec sanity init --bare

The template expects a dataset called production with public visibility, the default for new projects.

3. Configure the environment

cp apps/studio/.env.example apps/studio/.envcp apps/web/.env.example apps/web/.env

All variables are described in Deployment.

4. Log in and allow the site to read content

pnpm --filter studio exec sanity loginpnpm --filter studio exec sanity cors add http://localhost:3000 --credentials
Use the same login method every time
Sanity treats Google, GitHub and email logins as separate accounts. Log in with the one that owns the project.

5. Add the example content

pnpm seed

This creates the pages, the Blog, Gallery and Projects collections, two authors, these docs and the site settings, with photos from Unsplash. It refuses to run when the dataset already has content; pnpm seed --replace deletes the template's document types first.

6. Run

pnpm dev
AppAddress
Sitehttp://localhost:3000
Studiohttp://localhost:3333

If port 3000 is taken, Nuxt picks the next free port. Update SANITY_STUDIO_PREVIEW_URL in apps/studio/.env and add that origin to CORS as well.

Scripts

Run them from the repository root.

CommandDescription
pnpm devStudio and site together
pnpm dev:web / pnpm dev:studioOne of them
pnpm buildBuild both
pnpm generateBuild the site as static files
pnpm typegenExtract the schema and regenerate apps/web/sanity.types.ts
pnpm seedAdd the example content (--replace to start over)
pnpm docs:importImport the Markdown guides in docs/ into the Docs collection
pnpm deploy:studioDeploy the Studio to <name>.sanity.studio
pnpm lint / pnpm typecheckCheck the site