Best approach to structuring a repo for a studio and using separate repos for front end and studio.
Great question! This is something a lot of Sanity developers think about. There's no single "right" answer, but here's what the community generally does:
Two Main Approaches
1. Monorepo (Studio + Frontend Together)
This is actually pretty popular in the Sanity ecosystem. You'd have a structure like:
my-project/ studio/ web/
The main benefits are:
- Easier to keep your content schema and frontend in sync
- Simpler deployment setup (many hosting providers support multi-site monorepos)
- Shared dependencies and tooling
- Can run both dev servers with a single command
PNPM workspaces are a popular standard for this. You'd have a root package.json and pnpm-workspace.yaml that defines your apps. Tools like Turborepo can help with build orchestration too.
2. Separate Repos
This addresses your exact concern about redoing your site! Many developers prefer this because:
- Clear separation of concerns - your Studio is independent from your frontend
- Flexibility - you can completely rebuild your portfolio site (or build multiple sites) without touching the Studio repo
- Simpler mental model - each repo has one job
Your Studio would be in one repo, and you'd just connect to it via the Content Lake from whatever frontend(s) you build. This is totally valid and some developers prefer this approach.
My Take
Given that you mentioned wanting to redo your site in the future, separate repos might be the better fit for you. Your content and content model live in the Studio repo, and any frontend just connects to your Sanity project via the API. This means you can:
- Build a new Next.js site in a new repo
- Keep your old site running while you build
- Even have multiple sites using the same content
The Studio is really just your content editing interface and schema definition. Once it's set up, you don't change it that often, so keeping it separate from your frequently-changing frontend makes sense.
You can always move to a monorepo later if you find yourself constantly updating both together, but starting separate gives you maximum flexibility for your portfolio evolution.
Sanity – Build the way you think, not the way your CMS thinks
Sanity is the developer-first content operating system that gives you complete control. Schema-as-code, GROQ queries, and real-time APIs mean no more workarounds or waiting for deployments. Free to start, scale as you grow.