VDBC / CASE
[ MANIFEST ]
- ROLEARCHITECT
- STACKNEXT.JS / SANITY
- TYPEPLATFORM
Architecting a multilingual digital infrastructure.
VDBC required a high-availability content delivery network capable of serving both English and Vietnamese markets. The objective was to engineer a headless solution that decoupled the content modelling (Sanity) from the presentation layer (Next.js), enabling varying teams to operate independently.
SYSTEM CONSTRAINTS
Synchronizing content schema across en/vi locales without duplicating the entire database structure.
Granting content editors real-time visual previews while keeping the draft environment strictly gated.
Ensuring <200ms TTFB globally, despite heavy image assets and dynamic localization logic.
INFRASTRUCTURE MAP
Flow of data from CMS to Edge
SANITY CMS
DATA ORIGINTRANSFORM
TYPE VALIDATIONNEXT.JS
BUILD & RENDEREDGE CDN
DISTRIBUTIONEmbedded Studio Bridge
Implemented a secure tunnel for `next-sanity/draft-mode`. By verifying the `SANITY_VIEWER_TOKEN` server-side, we allow authenticated editors to bypass the static cache and view live draft content without compromising the public build.
export const { GET } = defineEnableDraftMode({
client: client.withConfig({
token: process.env.SANITY_VIEWER_TOKEN,
}),
});Strict Localization
To prevent runtime i18n crashes, we engineered a rigorous mapped type system. The `TranslationKey` type is inferred directly from the source JSON, making it impossible to request a missing translation key in the UI components.
type TranslationKey = keyof (typeof en & typeof vi);
const t = (key: TranslationKey): string => {
return translations[language][key] ?? String(key);
};