A bare bones example of a Vercel-deployable project with a Next.js frontend and a Sanity Studio on /studio
- Clone repo
git clone https://github.com/sanity-io/sanity-nextjs-examle
- Install dependencies
yarn install
- Setup Sanity
This will prompt you if you want to reconfigure the project. Answer yes and follow instructions to create a new project.
cd studio && sanity init
- Setup Vercel deployment
When asked about build settings, make sure to use
vercel
yarn run dev
as the development command
In development (using yarn run dev
)
- The Next.js application will run on https://localhost:3000
- The Sanity Studio dev server will run on http://localhost:3333/studio
In production (using vercel
)
- The Next.js application will be available on
https://<your-domain>
- The Sanity Studio will be accessible on
https://<your-domain>/studio