A modern, full-stack monorepo template built with Next.js App Router, Sanity CMS, Shadcn UI, and TurboRepo.
- Apps: web (Next.js frontend) and studio (Sanity Studio)
- Shared packages: UI components, TypeScript config, ESLint config
- Turborepo for build orchestration and caching
- Next.js App Router with TypeScript
- Shadcn UI components with Tailwind CSS
- Server Components and Server Actions
- SEO optimization with metadata
- Blog system with rich text editor
- Table of contents generation
- Responsive layouts
- Sanity Studio v3
- Custom document types (Blog, FAQ, Pages)
- Visual editing integration
- Structured content with schemas
- Live preview capabilities
- Asset management
Run the command in your Terminal to initialize this template on your local computer.
See the documentation if you are having issues with the CLI.
npm create sanity@latest -- --template robotostudio/turbo-start-sanity
Navigate to the template directory using cd <your app name>
, and start the development servers by running the following command
pnpm run dev
Open the Next.js app running locally in your browser on http://localhost:3000.
Open the Studio running locally in your browser on http://localhost:3333. You should now see a screen prompting you to log in to the Studio. Use the same service (Google, GitHub, or email) that you used when you logged in to the CLI.
The template comes pre-defined with a schema containing Author
, Blog
, BlogIndex
, FAQ
, Footer
, HomePage
, Navbar
, Page
, and Settings
document types.
From the Studio, click "+ Create" and select the Blog
document type. Go ahead and create and publish the document.
Your content should now appear in your Next.js app (http://localhost:3000) as well as in the Studio on the "Presentation" Tab
When you initialize the template using the Sanity CLI, sample content is automatically imported into your project. This includes example blog posts, authors, and other content types to help you get started quickly.
The schemas for all document types are defined in the studio/schemaTypes/documents
directory. You can add more document types to the schema to suit your needs.
Your Next.js frontend (/web
) and Sanity Studio (/studio
) are still only running on your local computer. It's time to deploy and get it into the hands of other content editors.
The template includes a GitHub Actions workflow deploy-sanity.yml
that automatically deploys your Sanity Studio whenever changes are pushed to the studio
directory.
Note: To use the GitHub Actions workflow, make sure to configure the following secrets in your repository settings:
SANITY_DEPLOY_TOKEN
SANITY_STUDIO_PROJECT_ID
SANITY_STUDIO_DATASET
SANITY_STUDIO_TITLE
SANITY_STUDIO_PRESENTATION_URL
Alternatively, you can manually deploy from your Studio directory (/studio
) using:
npx sanity deploy
You have the freedom to deploy your Next.js app to your hosting provider of choice. With Vercel and GitHub being a popular choice, we'll cover the basics of that approach.
- Create a GitHub repository from this project. Learn more.
- Create a new Vercel project and connect it to your Github repository.
- Set the
Root Directory
to your Next.js app (/apps/web
). - Configure your Environment Variables.
Now that you’ve deployed your Next.js application and Sanity Studio, you can optionally invite a collaborator to your Studio. Open up Manage, select your project and click "Invite project members"
They will be able to access the deployed Studio, where you can collaborate together on creating content.