Back to Journal
한국어 번역이 아직 준비되지 않아 영어 원문을 표시합니다.
programming
August 13, 2025Next.js + Sanity Architecture Notes
Decisions on GROQ, ISR, and image pipelines with Cloudinary.
SK
Sean Kim
Music Producer

Next.js + Sanity architecture
High-level structure for a fast, resilient content platform.
Core pieces
- Next.js App Router
- Sanity Content Lake + GROQ
- ISR for public pages
- Edge image delivery via Cloudinary
Separate authoring concerns from presentation. Treat Sanity as the source of truth.
Data flow
- Author content in Sanity
- Fetch via GROQ
- Transform to MDX or HTML
- Cache with ISR and revalidate on webhooks
GROQ example
*[_type == "post" && slug.current == $slug][0]{
_title,
"slug": slug.current,
publishedAt,
tags[]->title,
category->title,
coverImage,
excerpt,
body
}javascript
Next.js fetch helper
import { createClient } from 'next-sanity';
export const client = createClient({
projectId: [process.env.NEXT](<http://process.env.NEXT>)_PUBLIC_SANITY_PROJECT_ID!,
dataset: [process.env.NEXT](<http://process.env.NEXT>)_PUBLIC_SANITY_DATASET!,
apiVersion: '2025-01-01',
useCdn: true,
});javascript
Open questions
- MDX vs serialized HTML rendering
- Where to place portable text components
Related Articles
programming
Building a Real-time Collaborative Audio Mixer with Web Audio API and WebRTC
Learn how to build a collaborative audio mixing application where multiple users can control effects and levels in real-time, using Web Audio API for processing and WebRTC for low-latency synchronization.
May 6, 2025