---
title: "Architecting Websites with Sanity"
description: "Learn how the SanityPress starter template uses modular architecture, custom schemas and data types to build scalable websites with Sanity CMS."
---

# Architecting Websites with Sanity

![ancient prehistoric neanderthal cavemen yellow blue hard hats, pointing towards stonehenge getting constructed in the background](https://cdn.sanity.io/images/cyu7k2r0/production/c2c40e57b21b31b2a2c3f40678af73702ab18570-1232x928.jpg)

When I set out to build the original and new **SanityPress starter templates** I wanted more than just a Next.js + Sanity boilerplate. I wanted a foundation that developers could understand, extend, and rely on for production-ready websites that developers could use as a foundation for client and enterprise projects, or portfolio sites and personal blogs.

At its core, this approach relies on **modular architecture**—schemas and data types that are structured for clarity, flexibility, and reusability.

## Core Document Types

The architecture starts with a few **main document types** that form the backbone of the site:

- **[Site](https://github.com/nuotsu/sanitypress/blob/main/src/sanity/schemaTypes/documents/site.ts)**: stores global data like header/footer menus, social links, and the site logo.
- **[Page](https://github.com/nuotsu/sanitypress/blob/main/src/sanity/schemaTypes/documents/page.ts)**: each site route is a page, composed of modular "sections" that can be reordered and customized.
- **[Navigation](https://github.com/nuotsu/sanitypress/blob/main/src/sanity/schemaTypes/documents/navigation.ts)**: a reusable collection of links, perfect for menus, dropdowns, and megamenus.

This separation ensures clean data management while keeping content editors focused on meaningful building blocks.

## Primitive Data Types

Next, I define **primitive data types** to keep content consistent across the site. These act like reusable building blocks:

- **[Metadata](https://github.com/nuotsu/sanitypress/blob/main/src/sanity/schemaTypes/objects/metadata.tsx)**: title, description, slug, and a `noindex` boolean for SEO control.
- **[Link](https://github.com/nuotsu/sanitypress/blob/main/src/sanity/schemaTypes/objects/link.ts)**: a reference to page documents, ensuring routes stay consistent even if slugs change.
- **[CTA (Call-to-action)](https://github.com/nuotsu/sanitypress/blob/main/src/sanity/schemaTypes/objects/cta.ts)**: either an internal link reference or an external URL, with styling options for buttons or text links.

By standardizing these types, developers reduce redundancy and enforce consistency, while giving editors a familiar content structure.

## Additional Data Types

Beyond the essentials, I introduce **additional document and object types** that enhance site flexibility:

- **[Link list](https://github.com/nuotsu/sanitypress/blob/main/src/sanity/schemaTypes/objects/link.list.ts)**: a list of link objects, mainly used in the navigation data type (e.g. for dropdowns or megamenus).
- **[Blog post](https://github.com/nuotsu/sanitypress/blob/main/src/sanity/schemaTypes/documents/blog.post.ts)**: functions like a page, but dedicated to the `/blog/` route.
- **[Blog category](https://github.com/nuotsu/sanitypress/blob/main/src/sanity/schemaTypes/documents/blog.category.ts)**: categories that can be assigned to blog posts for improved organization and filtering.
- **[Redirect](https://github.com/nuotsu/sanitypress/blob/main/src/sanity/schemaTypes/documents/redirect.ts)**: handles page-to-page or external redirects.
- **Miscellaneous objects**: Site-specific data and content such as:
  - **[Testimonial](https://github.com/nuotsu/sanitypress/blob/main/src/sanity/schemaTypes/documents/testimonial.ts)**: client quotes and success stories, etc.
  - **[Person](https://github.com/nuotsu/sanitypress/blob/main/src/sanity/schemaTypes/documents/person.ts)**: for employee listings and blog authors, etc.
  - **[Logo](https://github.com/nuotsu/sanitypress/blob/main/src/sanity/schemaTypes/documents/logo.ts)**: for the site logo or a [logo list module](/modules/logo-list), etc.

This structure gives each project a flexible set of schemas while still being extendable for unique business needs.

![modern construction works with hard hats, unsafely balancing massive slabs of egyptian rock on their arms by hand](https://cdn.sanity.io/images/cyu7k2r0/production/c55ec37c21969a9d11805bf2ffda1963761306cb-1232x928.jpg)

## Why Modular Architecture Matters

For developers, this architecture solves several pain points:

### 1. Scalability Without Chaos

As a site grows, schema definitions can quickly become unmanageable. By breaking the system into **core documents, primitives, and extensions** each piece stays focused. You don’t end up with a single bloated `page` schema that tries to do everything.

### 2. Editor Empowerment

Content editors can manage global settings, reorder page modules, and update navigation without needing a developer. This leads to **fewer support tickets** and more independence for non-technical users.

### 3. Reuse and Consistency

Primitive types like `metadata`, `link`, and `cta` guarantee that SEO, routing, and CTAs behave consistently everywhere. Developers **avoid "reinventing the wheel,"** and editors see the same patterns across different contexts.

### 4. Extensibility for Unique Needs

The architecture is opinionated but not restrictive. Need a `testimonial` type? Add it. Want a custom case study page? Extend the `page` model as a `page.case-study` document. The structure anticipates change rather than resisting it.

### 5. Reduced Technical Debt

A clear modular architecture makes onboarding new developers smoother and ensures that projects remain maintainable months—or years—later.

## Wrapping Up

**TLDR;** a solid schema design upfront leads to efficient development, happier editors, and maintainable & scalable codebases.

Good schema design isn’t just about storing data—it’s about creating a **sustainable system** that developers and editors can both thrive in. With SanityPress, I’ve distilled my approach into a starter template that balances flexibility with clarity.

👉 Ready to see this approach in action? Explore **[SanityPress](https://github.com/nuotsu/sanitypress)** and start building with the template today.
