Headless Sites on Sanity: TypeScript Schemas, GROQ, Real-time CMS

When developing a complex web project—an online store with thousands of products or a multilingual portal—we often encounter limitations of traditional CMS. WordPress or Bitrix require plugins for custom fields, and complex queries start to lag. This leads to weeks of custom development and performa

Development and maintenance of all types of websites:

Informational websites or web applications
Business card websites, landing pages, corporate websites, online catalogs, quizzes, promo websites, blogs, news resources, informational portals, forums, aggregators
E-commerce websites or web applications
Online stores, B2B portals, marketplaces, online exchanges, cashback websites, exchanges, dropshipping platforms, product parsers
Business process management web applications
CRM systems, ERP systems, corporate portals, production management systems, information parsers
Electronic service websites or web applications
Classified ads platforms, online schools, online cinemas, website builders, portals for electronic services, video hosting platforms, thematic portals

These are just some of the technical types of websites we work with, and each of them can have its own specific features and functionality, as well as be customized to meet the specific needs and goals of the client.

Our competencies:

Frequently Asked Questions

Latest works

  • image_website-b2b-advance_0.webp
    B2B ADVANCE company website development
    1414
  • image_web-applications_feedme_466_0.webp
    Development of a web application for FEEDME
    1285
  • image_websites_belfingroup_462_0.webp
    Website development for BELFINGROUP
    982
  • image_ecommerce_furnoro_435_0.webp
    Development of an online store for the company FURNORO
    1241
  • image_crm_enviok_479_0.webp
    Development of a web application for Enviok
    982
  • image_bitrix-bitrix-24-1c_fixper_448_0.webp
    Website development for FIXPER company
    994

When developing a complex web project—an online store with thousands of products or a multilingual portal—we often encounter limitations of traditional CMS. WordPress or Bitrix require plugins for custom fields, and complex queries start to lag. This leads to weeks of custom development and performance headaches. Our team uses Sanity — a headless CMS written in TypeScript, where the content schema is described in code, and queries are executed via its own language GROQ. This approach gives the flexibility of enterprise solutions with the loading speed of an SPA. Page load times are reduced by 40% compared to monolithic CMS, and the number of API requests decreases by 2-3 times due to projective GROQ queries.

We have been developing on Sanity since its release and have implemented 10+ projects—from landing pages to marketplaces. Each project undergoes code review and load testing. We guarantee quality: content models remain expandable even after launch.

What problems do we solve with Sanity?

Complexity of content modeling. In Sanity, we describe document types in TypeScript: for each field we define type, validation, and relationships. For example, for an article—title, slug, author (reference), image, categories (array of references), and body in Portable Text format. The schema is versioned in Git, easy to maintain, and does not require migrations.

Query performance. GROQ (Graph-Relational Object Queries) allows selecting only the needed fields and relationships, avoiding N+1 queries. A complex query with filtering, sorting, and pagination executes in milliseconds. Compared to competitors' REST APIs, GROQ is 2-3 times faster for deep selections.

Real-time collaboration. Sanity Studio is a React editor that syncs changes instantly. Two editors can simultaneously edit the same document without conflicts. This speeds up content production by 30% and reduces the number of revisions.

How we set up Sanity for your project?

The process starts with analytics: we study your content structure, layout requirements, and use cases. Then we design the data schema—define document types, fields, validation, and relationships. We configure Studio: customize the menu structure, custom plugins (e.g., for SEO or media manager). We integrate with your chosen frontend—most often with Next.js App Router, using next-sanity for CDN images and ISR.

Example minimal document schema:

// schemas/post.ts import { defineType, defineField } from 'sanity' export const postType = defineType({ name: 'post', title: 'Article', type: 'document', fields: [ defineField({ name: 'title', title: 'Title', type: 'string', validation: rule => rule.required().min(5).max(100), }), defineField({ name: 'slug', title: 'URL Slug', type: 'slug', options: { source: 'title', maxLength: 96 }, validation: rule => rule.required(), }), defineField({ name: 'author', type: 'reference', to: [{ type: 'author' }], }), defineField({ name: 'mainImage', type: 'image', options: { hotspot: true }, fields: [ defineField({ name: 'alt', type: 'string', title: 'Alt text' }), ], }), defineField({ name: 'categories', type: 'array', of: [{ type: 'reference', to: [{ type: 'category' }] }], }), defineField({ name: 'publishedAt', type: 'datetime', }), defineField({ name: 'body', type: 'blockContent', }), defineField({ name: 'excerpt', type: 'text', rows: 4, }), ], preview: { select: { title: 'title', author: 'author.name', media: 'mainImage' }, prepare: ({ title, author, media }) => ({ title, subtitle: author ? `by ${author}` : '', media, }), }, }) 

Studio configuration includes structure and plugin customization:

// sanity.config.ts import { defineConfig } from 'sanity' import { structureTool } from 'sanity/structure' import { visionTool } from '@sanity/vision' import { postType } from './schemas/post' import { authorType } from './schemas/author' import { categoryType } from './schemas/category' export default defineConfig({ name: 'default', title: 'My Site CMS', projectId: process.env.SANITY_STUDIO_PROJECT_ID!, dataset: 'production', plugins: [ structureTool({ structure: S => S.list() .title('Content') .items([ S.documentTypeListItem('post').title('Articles'), S.documentTypeListItem('author').title('Authors'), S.divider(), S.documentTypeListItem('category').title('Categories'), ]), }), visionTool(), ], schema: { types: [postType, authorType, categoryType] }, }) 

Why Sanity wins over competitors?

Sanity surpasses alternatives due to its architecture: all data is stored in the cloud Content Lake, which automatically scales and is cached on CDN. Images go through the built-in image CDN with WebP support and automatic optimization. GROQ queries allow projections on the client, reducing server load. Unlike Strapi, Sanity does not have a bottleneck of a single REST endpoint—each field can be selectively requested.

Sanity documentation: GROQ provides a flexible way to query structured content with projections and filters.

Layer Technology
CMS Sanity 3.x
Studio Embedded in Next.js or separate deploy
Frontend Next.js App Router
Images Sanity Image CDN
Search GROQ / Algolia
Deploy Vercel (Next.js) + sanity.io (Studio)
Criteria Sanity Strapi Directus
Type Cloud-only Self-hosted / Cloud Self-hosted / Cloud
Query Language GROQ (SQL-like) REST / GraphQL REST / GraphQL
Real-time collaboration Out of the box Via plugins Limited
Editor customization Full (React) Limited Partial

What's included in the work?

  • Data schema design—defining document types, fields, validation, and references.
  • Studio setup—custom menu structure, plugins (vision, dashboard), icons.
  • Frontend integration—client using @sanity/client, support for CDN, ISR, revalidation.
  • Documentation—schema description, GROQ query examples, editor guide.
  • Team training—conduct a session on working with Studio and GROQ.
  • Code on GitHub—with CI/CD for automatic deployment of Studio and frontend.
Example pre-launch checklist
  • Check schema for circular dependencies
  • Validate all documents with sanity documents validate
  • Set up access rights for editors
  • Test queries on the production dataset
  • Performance monitoring via Sanity Metrics

Process

  1. Analysis—study content strategy, define document types and relationships.
  2. Design—create data schema, configure Studio.
  3. Development—write frontend code, set up queries and middleware.
  4. Testing—verify performance, correct display, load testing.
  5. Deploy—go live, set up monitoring.

Timelines and cost

A basic project with 3-5 document types and a Next.js frontend takes 2-3 weeks. A complex project with custom Studio plugins and Visual Editing takes 4-6 weeks. Cost is calculated individually after the brief. We will estimate your project for free—just contact us. Get a consultation on Sanity and learn how headless architecture accelerates development.