VercelLogotypeVercelLogotype
LoginSign Up
Back to Templates

CMS-Kit: Sanity + Next.js 15 Visual Site Builder

A production-ready boilerplate for Sanity on Next.js, making Headless CMS-based development accessible, comfortable, and fast.

DeployView Demo
Contentful thumbnail for CMS-Kit: Sanity + Next.js 15 visual site builder

CMS-Kit šŸ”§šŸ”§šŸ”§

This production ready boilerplate accumulating the experience and best practices collected at Focus Reactive. The project serves the idea of making Headless CMS-based development accessible, comfortable, and fast.

Features

  • Next.js 15 for performance: Leverage the power of Next.js 15 for performance and SEO-friendly sites
  • Real-time editing: Edit content and see changes live, creating dynamic experience
  • User-friendly interface: Reduce friction for your team when working with the content
  • Advanced content management: Collaborate with your team in real-time using publishing workflows and changes history
  • Instant publishing: Make content live instantaneous without delays
  • Multi-CMS support: Seamlessly switch between different headless CMS platforms
  • Type-safe development: Full TypeScript integration with auto-generated types
  • Modern UI components: Pre-built components using Radix UI for consistent design
  • Efficient caching: Smart caching strategies for optimal performance
  • Theme customization: Flexible theming system using CSS variables
  • Automated setup: One-command initialization script that handles CMS platform integration, account linking, and Vercel deployment

Demo šŸ‘€

Production website

  • Sanity
  • Storyblok
  • Payload (self-hosted, requires PostgreSQL)

Editing experience

  • Sanity

Getting Started

Prerequisites

  • Make sure your Github account is linked to Vercel account. You can do it here.
  • Make sure pnpm package manages is installed.

Sanity

  1. Create Github repository, create Sanity project, deploy to Vercel

  1. Clone project locally
  • Navigate to your Github account and clone project repository locally.
  • Navigate to project folder.
cd <project folder>
  • Install dependencies
pnpm install
  1. Pull required ENV variables

Execute following command to pull ENV variables from Vercel and replace some of the with local development values

pnpm vercel link &&
pnpm vercel env pull &&
mv .env.local apps/sanity/
  1. Import templates and example pages data
cd apps/sanity && pnpm import-dataset
  1. Run project locally
pnpm dev

Storyblok

Sanity CMS Overview

  1. Create a new repository using this template by clicking the "Use this template" button at the top of the repository page.

  2. Await the initial workflow to be finished

  1. Clone your new repository:

    git clone <your-repository-url>
  2. Navigate to the project directory:

    cd <repository-name>
  3. Install dependencies using pnpm:

    pnpm install
  4. Navigate to the Storyblok CLI directory:

    cd apps/storyblok/CLI
  5. Run the setup script,

āš ļø command should be executed from apps/storyblok/CLI (previous step), to consume correct environment variables:

node sb.mjs
  1. Follow the interactive prompts in the CLI tool to:

    • Enter your Storyblok Personal Access Token
    • Enter your Vercel Personal Auth Token
    • Select your Vercel team
    • Choose a project name
    • Complete the space creation and configuration process
  2. Go to project settings in Vercel dashboard

    • select Git section
    • create deploy hook and copy it
    • select Environment variables section
    • add variables called VERCEL_REDEPLOY_HOOK_URL and assign it to created deploy hook value
    • trigger rebuild

This process ensures that global component updates are displayed on all pages.

šŸ Your CMS-based project is ready šŸ

Payload

Payload CMS with PostgreSQL, multi-tenancy, i18n, and A/B testing.

Prerequisites:

  • Docker (for PostgreSQL)
  • Node.js ≄20, pnpm ≄9

Setup:

  1. Start PostgreSQL:
cd apps/payload
docker-compose up -d
  1. Copy and fill environment variables:
cp apps/payload/.env.local.example apps/payload/.env.local

Required env vars:

DATABASE_URI="postgresql://postgres:password@localhost:5432/payload"
PAYLOAD_SECRET="your-secret-key"
NEXT_PUBLIC_SERVER_URL="http://localhost:3000"
# Auth0 (optional, for admin auth):
AUTH0_SECRET="..."
AUTH0_BASE_URL="http://localhost:3000"
AUTH0_ISSUER_BASE_URL="https://your-tenant.auth0.com"
AUTH0_CLIENT_ID="..."
AUTH0_CLIENT_SECRET="..."
  1. Run migrations and generate types:
pnpm --filter payload payload migrate
pnpm --filter payload generate:types
pnpm --filter payload generate:importmap
  1. Start dev server:
pnpm --filter payload dev
# or from monorepo root:
turbo dev --filter=payload

Admin panel: http://localhost:3000/admin

Migrations:

pnpm --filter payload payload migrate:create # create new migration
pnpm --filter payload payload migrate # run pending migrations

Repo structure

  • apps/payload: CMS app (Payload CMS + PostgreSQL)
  • apps/storyblok: CMS app
  • apps/sanity: CMS app
  • packages/ui: UI components library, shared between both CMS apps
  • packages/eslint-config: shared eslint configurations
  • packages/ts-config: shared ts-config configuration
  • packages/tailwind-config: shared tailwind configuration

Types of components

  • UI component - universal and sharable component between multiple CMSs
  • Controller component - takes data from CMS, convert it to UI component format, and use UI component with converted props. Each CMS has it's own controller component for each UI component.
  • All controller components have common propertiers to change style, such as margin, background, alignment etc.

Components composition and hierarchy

The website structure follows a clear hierarchical composition:

  1. Pages

    • Top-level components that represent entire web pages
    • Each page contains multiple sections, SEO properties and theme
  2. Sections

    • Container components that organize content into distinct areas
    • Can be configured with settings like margin, background, width, alignment etc.
    • Hold and arrange other components
  3. Base Components

    • Components like link, image, and rich text
    • Combination of multiple functional components like card
    • Can be combined and reused across different sections

RichText component has additional functionality. It allows to add sections inside, which gives ability to combine sections with text.

Add new section

  1. Create new component using generators
pnpm gen
  1. Select type of component to create
- UI: Create a new UI component
- Storyblok: Create a new content section
- Sanity: Create a new content section
  1. Enter name of the component
  2. For Storyblok, add section component to the CMS
  3. Update properties and design
  4. Go to CMS folder
cd apps/storyblok

or

cd apps/sanity
  1. Generate types for added section
pnpm sb-login
pnpm gen:types

Update existing section

  1. Updata design
  2. Update fields
  3. Go to CMS folder
cd apps/storyblok

or

cd apps/sanity
  1. Generate types for updated section
pnpm gen:types

Start project in dev mode

Instalation

  1. Clone repository
    git clone https://github.com/focusreactive/cms-kit
  2. Go to project directory
    cd cms-kit
  3. Install dependencies
    pnpm install
  4. Add and fill .env and .env.local file with proper data:

Create .env and .env.local files in project folder (apps/sanity or apps/storyblok) and add the following variables:

.env

REPO_PROD_BRANCH="main"
REPO_TYPE="github"
REPO_ID="[repo id]"
REPO_NAME="[nickname]/[repo name]"

Storyblok project

.env.local

NEXT_PUBLIC_DOMAIN="https://localhost:4050"
NEXT_PUBLIC_IS_PREVIEW="true"
NEXT_PUBLIC_STORYBLOK_TOKEN="[storyblok space preview token]"
NEXT_PUBLIC_STORYBLOK_API_GATE="https://api.storyblok.com/v2/cdn"

Sanity project

.env.local

NEXT_PUBLIC_BASE_URL="http://localhost:3000"
NEXT_PUBLIC_SANITY_PROJECT_ID="[project id]"
NEXT_PUBLIC_SANITY_DATASET="production"
SANITY_API_READ_TOKEN="[read token]"
  1. Run dev server
    pnpm dev

Happy hacking šŸ‘¾

GitHub Repofocusreactive/cms-kit
Use Cases
CMS
Stack
Next.jsTailwind
CMS
Sanity

Related Templates

Get Started

  • Templates
  • Supported frameworks
  • Marketplace
  • Domains

Build

  • Next.js on Vercel
  • Turborepo
  • v0

Scale

  • Content delivery network
  • Fluid compute
  • CI/CD
  • Observability
  • AI GatewayNew
  • Vercel AgentNew

Secure

  • Platform security
  • Web Application Firewall
  • Bot management
  • BotID
  • SandboxNew

Resources

  • Pricing
  • Customers
  • Enterprise
  • Articles
  • Startups
  • Solution partners

Learn

  • Docs
  • Blog
  • Changelog
  • Knowledge Base
  • Academy
  • Community

Frameworks

  • Next.js
  • Nuxt
  • Svelte
  • Nitro
  • Turbo

SDKs

  • AI SDK
  • Workflow SDKNew
  • Flags SDK
  • Chat SDK
  • Streamdown AINew

Use Cases

  • Composable commerce
  • Multi-tenant platforms
  • Web apps
  • Marketing sites
  • Platform engineers
  • Design engineers

Company

  • About
  • Careers
  • Help
  • Press
  • Legal
  • Privacy Policy

Community

  • Open source program
  • Events
  • Shipped on Vercel
  • GitHub
  • LinkedIn
  • X
  • YouTube

Loading status…

Select a display theme:
    • AI Cloud
      • v0

        Build applications with AI

      • AI SDK

        The AI Toolkit for TypeScript

      • AI Gateway

        One endpoint, all your models

      • Vercel Agent

        An agent that knows your stack

      • Sandbox

        AI workflows in live environments

    • Core Platform
      • CI/CD

        Helping teams ship 6Ɨ faster

      • Content Delivery

        Fast, scalable, and reliable

      • Fluid Compute

        Servers, in serverless form

      • Observability

        Trace every step

    • Security
      • Bot Management

        Scalable bot protection

      • BotID

        Invisible CAPTCHA

      • Platform Security

        DDoS Protection, Firewall

      • Web Application Firewall

        Granular, custom protection

    • Company
      • Customers

        Trusted by the best teams

      • Blog

        The latest posts and changes

      • Changelog

        See what shipped

      • Press

        Read the latest news

      • Events

        Join us at an event

    • Learn
      • Docs

        Vercel documentation

      • Academy

        Linear courses to level up

      • Knowledge Base

        Find help quickly

      • Community

        Join the conversation

    • Open Source
      • Next.js

        The native Next.js platform

      • Nuxt

        The progressive web framework

      • Svelte

        The web’s efficient UI framework

      • Turborepo

        Speed with Enterprise scale

    • Use Cases
      • AI Apps

        Deploy at the speed of AI

      • Composable Commerce

        Power storefronts that convert

      • Marketing Sites

        Launch campaigns fast

      • Multi-tenant Platforms

        Scale apps with one codebase

      • Web Apps

        Ship features, not infrastructure

    • Tools
      • Marketplace

        Extend and automate workflows

      • Templates

        Jumpstart app development

      • Partner Finder

        Get help from solution partners

    • Users
      • Platform Engineers

        Automate away repetition

      • Design Engineers

        Deploy for every idea

  • Enterprise
  • Pricing
Log InContact
Sign Up
Sign Up
Back to Templates
DeployView Demo

Clean Next.js + Sanity App

A clean Next.js template with a native authoring experience
Clean Next.js + Sanity App
v0

Build applications with AI

AI SDK

The AI Toolkit for TypeScript

AI Gateway

One endpoint, all your models

Vercel Agent

An agent that knows your stack

Sandbox

AI workflows in live environments

CI/CD

Helping teams ship 6Ɨ faster

Content Delivery

Fast, scalable, and reliable

Fluid Compute

Servers, in serverless form

Observability

Trace every step

Bot Management

Scalable bot protection

BotID

Invisible CAPTCHA

Platform Security

DDoS Protection, Firewall

Web Application Firewall

Granular, custom protection

Customers

Trusted by the best teams

Blog

The latest posts and changes

Changelog

See what shipped

Press

Read the latest news

Events

Join us at an event

Docs

Vercel documentation

Academy

Linear courses to level up

Knowledge Base

Find help quickly

Community

Join the conversation

Next.js

The native Next.js platform

Nuxt

The progressive web framework

Svelte

The web’s efficient UI framework

Turborepo

Speed with Enterprise scale

AI Apps

Deploy at the speed of AI

Composable Commerce

Power storefronts that convert

Marketing Sites

Launch campaigns fast

Multi-tenant Platforms

Scale apps with one codebase

Web Apps

Ship features, not infrastructure

Marketplace

Extend and automate workflows

Templates

Jumpstart app development

Partner Finder

Get help from solution partners

Platform Engineers

Automate away repetition

Design Engineers

Deploy for every idea