Opinionated monorepo starter based on Nuxt 3 and Sanity.
The Sanity Nuxt 3 Starter is a monorepo starter based on Nuxt 3 and Sanity v3. It provides a streamlined setup for developing web projects with a Sanity-powered backend. The starter includes features such as monorepo using PNPM Workspaces, Sanity Studio v3 React Backend, Nuxt 3 Frontend, live previews, progressive image loading, linting with ESLint, code formatting with Prettier, and configuration for Netlify Hosting.
To quickly get started with the Sanity Nuxt 3 Starter, follow these steps:
Install the project as a Nuxt template:
npx degit sanity-io/sanity-nuxt-3-starter my-project
Install the Sanity CLI if not already installed:
npm install -g @sanity/cli
Create a new Sanity project and dataset:
cd my-project
sanity init --template sanity/template-advanced
Skip the installation of a new studio by using the --bare flag:
sanity install --bare
Copy the new project ID and dataset from the console.
Create a .env file from .env.template in both the /studio and /web directories, and fill in the project ID and dataset.
Rename the project in package.json and the studio in studio/sanity.config.js to customize the project name.
Add http://localhost:3000 to the CORS origins in the Sanity project settings to allow credentials for previews.
Install the dependencies from the root directory:
pnpm install
Start development on localhost:3000 for the Nuxt frontend and localhost:3333 for the Sanity studio:
pnpx pm2 start
The Sanity Nuxt 3 Starter is a comprehensive solution for building web projects with a Sanity-powered backend. It offers a range of features including a monorepo structure, live previews, progressive image loading, linting, code formatting, and Netlify hosting configuration. With easy installation steps and a set of powerful tools, developers can quickly set up and start developing their projects with ease.