Next.jsReactCorporate WebsiteStarter

sanitypress — Next.js Business Template

By nuotsu

SanityPress is an open-source page building template built on Next.js 16 and Sanity, aimed at marketing sites and blogs. Editors build pages from reusable modules in Sanity Studio, and developers get a type-safe App Router codebase.

Explore the design

Compare the page layouts and mobile experience. Open any screenshot for a closer look.

2 previews
Desktop homepage1 / 2
Desktop captureTop of page

Actual screenshot captured by the server browser.

All pages & views 2

Screenshots show visual appearance; interactive behavior may differ.

Recorded 2026-10-19View source

What stands out

A quick read of the recorded project description.

01

Frontend built with Next.js 16 App Router, Server Components, TypeScript and Tailwind 4

02

Pages are built from reusable modules in Sanity Studio, with modules organized by _type in the frontend and schema

03

TypeScript types are generated from the Sanity schema and queries via GROQ TypeGen

04

Built-in SEO support, including metadata, canonical links, sitemap.xml and redirects manageable in Studio

05

Provides the Live Content API and Visual Editing, plus image optimization based on Next Image and the Sanity CDN

06

Automatically generates a blog RSS feed and provides /llms.txt and Markdown versions of pages for AI crawlers

Template Details

SanityPress is an MIT-licensed open-source template. It builds the frontend with Next.js 16 (App Router, Server Components, TypeScript) and Tailwind 4, and uses Sanity as the content management backend. Editors can build pages from reusable modules in Sanity Studio, while developers get a type-safe codebase that includes built-in capabilities such as SEO, redirects and Visual Editing.

The template provides a page builder, GROQ-based TypeGen type generation, the Live Content API with Visual Editing, image optimization using the Next Image component and the Sanity CDN, an automatically generated sitemap.xml and blog RSS feed, and SEO metadata, canonical links and redirects that can be managed in Studio. It also includes /llms.txt and Markdown versions of pages for AI crawlers, plus skill files and guidance documents for coding agents.

The README covers project initialization, environment variable configuration, local startup, required content documents and deployment. Before use, a site document and a page document with the slug index must be published in Sanity, otherwise the frontend shows a blank page. The README does not provide further information on performance, production readiness, or deployment platforms other than Vercel/Netlify.

Next.jsCorporate websiteStarter

Is it right for your project?

Use Cases

  • Website projects that need editors to build marketing pages modularly in a CMS
  • Blog sites that want Sanity as the content backend and Next.js as the frontend
  • Development teams that need a type-safe codebase and want TypeScript types generated automatically from the Sanity schema
  • Content operations scenarios that need to manage SEO metadata, redirects and the sitemap in Studio

Suitable For

  • Developers familiar with the Next.js App Router and Sanity
  • Teams that need to quickly establish a content editing workflow for a marketing site or blog
  • Organizations that want to use an MIT-licensed open-source template as a project starting point

Getting started & customization

Use these recorded setup notes alongside the repository instructions for your chosen version.

  1. 1

    Initialize the project via the Sanity template link or by running npm create sanity@latest -- --template=nuotsu/sanitypress

  2. 2

    Configure NEXT_PUBLIC_BASE_URL, NEXT_PUBLIC_SANITY_PROJECT_ID, NEXT_PUBLIC_SANITY_DATASET and SANITY_API_READ_TOKEN in .env.local; NEXT_PUBLIC_BASE_URL must be set to the production domain

  3. 3

    After installing dependencies, run npm run dev; the frontend is at http://localhost:3000 and Sanity Studio is at http://localhost:3000/admin

  4. 4

    A site document and a page document with the slug index must be published in Sanity Studio, otherwise the frontend shows a blank page; alternatively, run sanity dataset import demo.tar.gz to import a demo dataset containing the required documents

  5. 5

    The README states that deployment can be enabled by adding the Vercel (default) or Netlify widget in Studio

Read repository instructions

License & source material

Usage conditions & limitations

Free to use · keep license notice

This listing covers the free version under the MIT license in the public repository; the free scope is the code of this version and does not mean external services or third-party assets are free.

Must comply with when using

  • The code of this version may be used, modified, used commercially and distributed free of charge.
  • When distributing copies or substantial portions of the code, retain the original author's copyright notice and the full MIT license notice.
  • The code is provided as is; warranties and limitations of liability are governed by the original license and applicable law.

Additional costs & items to verify

  • Demo images, fonts, icons and other third-party assets must be checked against their respective licenses and cannot be judged solely by the MIT license of the code.
  • External services such as domains, hosting, databases, payments or AI may incur separate charges.
  • A Sanity project ID (NEXT_PUBLIC_SANITY_PROJECT_ID) must be configured in .env.local, which requires a Sanity account and project.
  • A Sanity API read token with Viewer permissions, SANITY_API_READ_TOKEN, must be provided.
  • NEXT_PUBLIC_BASE_URL must be set to the production domain.
  • A site document and a page document with the slug index must be published in Sanity Studio, otherwise the frontend shows a blank page.
  • Deployment requires adding the Vercel (default) or Netlify widget in Studio; the related hosting services may incur costs.
View Original Text Basis

Permission is hereby granted, free of charge

Original License Text

NEXT_PUBLIC_SANITY_PROJECT_ID="abcd1234" # Sanity project id

Original README

SANITY_API_READ_TOKEN="..." # API token with "Viewer" permissions

Original README

⚠️ **Required**: Set `NEXT_PUBLIC_BASE_URL` to your production domain.

Original README

Publish the **required** documents: `site` and `page` (with the slug "index"). Otherwise, you’ll just see a blank page on the Next.js frontend.

Original README

Add a [Vercel](https://www.sanity.io/plugins/vercel-dashboard-widget) (default) or [Netlify widget](https://www.sanity.io/plugins/sanity-plugin-dashboard-widget-netlify) to enable deployments from the Studio.

Original README
https://github.com/nuotsu/sanitypress/blob/main/LICENSEhttps://github.com/nuotsu/sanitypress/blob/main/README.md

Compiled by DeepSeek based on repository license and README ·2026-10-19. Results only cover the materials read; dependencies, images, fonts, and subsequent term changes are subject to their respective original texts.

Project checks & description sources

Template Information

Source platforms
GitHub
Documentation and maintenance reference score
More documented · 92 / 100
Technologies
Next.js · React
Website type
Corporate Website · Starter
How this score is calculated

Our heuristic uses license records (up to 30), a demo link (12), a preview (10), stars (15), recorded maintenance (15), description completeness (8), feature records (5) and classification data (5). It is not a code, security or performance test, or a Google score. A link does not establish tested functionality.

What to verify for this project

Repository update recorded
2026-10-18
Screenshot last checked
2026-10-19

A demo link is listed. Check it with your own content and viewport sizes; its presence does not confirm that forms, authentication or payments work.

The catalog identifies Next.js as the primary stack. Check the actual dependency manifest and lockfile for versions and hosting requirements. These notes use recorded metadata, not a code audit or a deployment test.

Use a selection guide →

How this description was prepared

AI-assisted description based on catalog records and repository material. Repository authors are not automatically the reviewers of this description.

Review declaration: codex-user-requested-batch-review-20261021 · 2026-10-21

Inspect the recorded source material

SHA-256: 92470277f15265d6e63d5884620ec09852cbdcef6a6b57eccf1d4b86f3321b93

2026-10-19T00:56:03.336Z

Source file / repository
# SanityPress

SanityPress is a free, open-source (MIT) Next.js 16 + Sanity page builder template for marketing sites and blogs. Editors build pages from reusable modules in Sanity Studio, and developers get a type-safe App Router codebase with SEO, redirects, and Visual Editing built in.

```sh
npm create sanity@latest -- --template=nuotsu/sanitypress
```

This repository is the actively maintained version of SanityPress. The original 2023 version ([nuotsu/sanitypress-2023](https://github.com/nuotsu/sanitypress-2023)) is archived.

[Get started](https://www.sanity.io/get-started?template=sanitypress) | [Read more about TypeGen](https://sanitypress.dev/blog/introducing-sanitypress-with-typegen) | [View on Sanity.io](https://www.sanity.io/templates/sanitypress)

![SanityPress: The Next.js + Sanity page builder template](https://cdn.sanity.io/images/cyu7k2r0/production/082d65996a8142d3de23484391d1aeee7787b1e5-2400x1260.png)

## Key Features

- Next.js 16 (App Router, Server Components, TypeScript) with Tailwind 4
- Page builder with reusable modules
- GROQ TypeGen for your Sanity Schema types
- [Perfect PageSpeed Insight scores](https://pagespeed.web.dev/analysis/https-typed-sanitypress-dev/78sjwe1x39?form_factor=desktop)
- Live Content API with Visual Editing
- Optimized images with Next Image component and Sanity CDN
- Auto-generated sitemap.xml and blog RSS feed
- SEO built in (metadata, canonicals, sitemap.xml, redirects managed in Studio)
- AI-agent ready (`/llms.txt` and Markdown versions of pages for AI crawlers)
- Agent skills included (`.agents/skills/`, tracked in `skills-lock.json`) plus `AGENTS.md` / `CLAUDE.md` guidance for Claude Code and other coding agents

## File Structure

```
SanityPress
├─ src/
│ ├─ app/              # Next.js App Router
│ │ ├─ (frontend)/     # Public-facing site
│ │ │ ├─ layout.tsx    # Frontend root layout
│ │ │ ├─ not-found.tsx # 404 page
│ │ │ ├─ [[...slug]]/  # Catch-all for all standard pages
│ │ │ ├─ blog/[slug]/  # Individual blog post pages
│ │ │ ├─ blog/rss.xml/ # RSS feed endpoint
│ │ │ └─ api/          # API route handlers
│ │ │ │ ├─ draft-mode/ # Enable/disable Sanity draft mode
│ │ │ │ └─ og/         # Open Graph image generation
│ │ ├─ (studio)/admin/ # Sanity Studio (CMS editor UI)
│ │ └─ sitemap.ts      # Auto-generated sitemap
│ ├─ modules/          # Colocated modules (one folder per Sanity module `_type`)
│ │ └─ <module-name>/
│ │   ├─ index.tsx     # Frontend component
│ │   ├─ schema.ts     # Sanity schema
│ │   └─ query.ts      # GROQ projection (only if needed)
│ ├─ ui/               # React components
│ │ ├─ modules/        # ModulesResolver + <Module> wrapper
│ │ ├─ blog/           # Shared blog UI helpers (filters, previews, etc.)
│ │ ├─ header/         # Header, navigation, megamenu
│ │ ├─ footer/         # Footer and link list
│ │ └─ ...             # Shared components (CTA, Img, Logo, etc.)
│ ├─ sanity/           # Sanity CMS configuration
│ │ ├─ schemaTypes/
│ │ │ ├─ documents/    # Top-level content types (page, blog.post, site, navigation…)
│ │ │ ├─ objects/      # Reusable field groups (cta, link, metadata…)
│ │ │ └─ fragments/    # Shared helpers (define-module, modules field)
│ │ ├─ lib/            # Queries, GROQ fragments, fetch helpers, image builder
│ │ ├─ ui/             # Custom Studio UI components
│ │ └─ ...             # Sanity files
│ ├─ lib/              # Shared app utilities and env helpers
│ ├─ hooks/            # Custom React hooks
│ └─ types/            # Global TypeScript declarations
├─ public/
│ ├─ module-thumbnails/ # Studio insert-menu previews (`<module-name>.webp`)
│ └─ ...               # Favicon and other static assets
├─ .env.*              # Environment variable template
├─ next.config.ts      # Next.js configuration
├─ sanity.config.ts    # Sanity Studio configuration
├─ sanity.cli.ts       # Sanity CLI configuration
└─ package.json
```

## Getting Started

### 1. Initialize the project

Click the [Sanity template link](https://www.sanity.io/get-started?template=sanitypress) -- OR -- install with the Sanity CLI:

```sh
npm create sanity@latest -- --template=nuotsu/sanitypress
```

### 2. Set environment variables

If initialized via the Sanity template link, the `.env.local` file should be created automatically.

If initialized via the CLI, duplicate the `.env.example` file as `.env.local` and assign the variables to your project:

```sh
# .env.local
NEXT_PUBLIC_BASE_URL="https://example.com" # your website's domain

NEXT_PUBLIC_SANITY_PROJECT_ID="abcd1234" # Sanity project id
NEXT_PUBLIC_SANITY_DATASET="production" # Sanity dataset name

SANITY_API_READ_TOKEN="..." # API token with "Viewer" permissions
```

⚠️ **Required**: Set `NEXT_PUBLIC_BASE_URL` to your production domain.

### 3. Install and start local server

Install required packages and dependencies with your desired package manager (e.g. npm, pnpm, deno, bun, etc.).

```sh
npm install
```

Once installed, run the development script:

```sh
npm run dev
```

Then open:

- Next.js frontend: http://localhost:3000
- Sanity Studio: http://localhost:3000/admin

### 4. Add content in your Sanity Studio

Publish the **required** documents: `site` and `page` (with the slug "index"). Otherwise, you’ll just see a blank page on the Next.js frontend.

What you'll need:

| Document        | Slug or Path | Usage              | Required? | Notes                                |
| --------------- | ------------ | ------------------ | :-------: | ------------------------------------ |
| `site`          |              | Global settings    |    Yes    |                                      |
| `page`          | `index`      | Homepage route     |    Yes    |                                      |
| `page`          | `404`        | Not found route    |           |                                      |
| `page`          | `blog`       | Blog listing route |           | Add the **Blog index** module        |
| `global-module` | `blog/`      | Blog post template |           | Add the **Blog post content** module |

Alternatively, you can run the following command to import a demo dataset with the required documents:

```sh
sanity dataset import demo.tar.gz
```

> 📸 See what the Sanity Studio backend looks like on the [Screenshots page](https://sanitypress.dev/docs/sanity-studio-screenshots).

### 5. Set up deployments

Add a [Vercel](https://www.sanity.io/plugins/vercel-dashboard-widget) (default) or [Netlify widget](https://www.sanity.io/plugins/sanity-plugin-dashboard-widget-netlify) to enable deployments from the Studio.

### 6. Customize

Adjust frontend styles to your liking, edit or add new schema and modules, etc.

## History

SanityPress started in 2023 as a Next.js + Sanity.io starter template. That version lives on, archived, at [nuotsu/sanitypress-2023](https://github.com/nuotsu/sanitypress-2023). This repository is its rewrite, adding auto-generated TypeScript types from your Sanity schema and GROQ queries, and is the version that is actively maintained.

## License

[MIT](LICENSE)
Report a correction

Explore similar templates

Compare previews and descriptions within the same stack and category.