Architecture
One pnpm workspace, two apps and four small packages. The site and the Studio share code only through those packages and never import from each other.
The two apps
web is a Next.js site on the App Router. It fetches content with GROQ queries and renders each module with its own React component.
studio is the Sanity Studio. It holds the schemas, the sidebar structure and the Presentation setup for live preview.
The four packages
sanity-dataset-resolvepicks the dataset for the site and the Studio from the deploy context.site-languagesholds the language rules both apps read.check-wiringfails CI when a module is registered in one place and missing in another.scaffold-moduleis the code behindpnpm gen:module.
Types come from the queries
Nobody writes a type for Sanity data by hand. Sanity TypeGen reads every query and generates the type of its result. A component asks for ModuleOf<"module.text"> and gets exactly the fields the query returns.
CI regenerates the types on every pull request and fails if they differ from the committed ones.
Two branches, two ways to translate
On main, one document holds every language, and each text field has one input per language. variant/document-level keeps one document per language. Everything else is the same on both branches. Document Level Translation shows what that means for editors on this demo.
Pick one before the first content goes in. Switching later means migrating every document.
Checks before every merge
CI runs four jobs: formatting and type checks, schema typegen, and one build per app. The web build also measures the JavaScript each route loads and fails above a set budget.
Locally, a Git hook formats staged files on every commit, and another runs lint and type checks before every push.



