Staging EnvironmentConnected to the staging D1, KV, and R2 stack in Narew CMS (demo-staging.narew.io).
← All articlesEdge Architecture

Hello from Narew CMS: Content That Lives Inside Your Database

Why modern editorial teams are ditching brittle sync pipelines and editing their own Cloudflare D1 tables directly with typed schemas and instant edge previews.

Minimalist architectural editorial desk with warm sunlight casting geometric shadows across textured paper and dark stone
Minimalist architectural editorial desk with warm sunlight casting geometric shadows across textured paper and dark stone.

Every publishing team eventually hits the same wall: the website lives in one stack, the database lives in another, and a third-party headless CMS sits between them demanding webhooks, rebuild queues, and duplicated schemas. Narew CMS flips that relationship. Instead of renting a remote JSON API, the studio connects straight to the Cloudflare D1 database your application already owns.

Your tables, your queries, zero middleman

On this live site, every article, author bio, category badge, and showcase project is queried with standard Drizzle ORM joins inside a single Cloudflare Worker. There is no GraphQL gateway to warm up, no nightly sync script that silently drops drafts, and no vendor-specific SDK locking your schema into proprietary JSON blobs.

When your CMS speaks the exact language of your SQL migrations, content stops feeling like an external payload and becomes a first-class part of the product.

What this live journal demonstrates

  • Typed Drizzle collections: posts, authors, categories, and showcase projects declared once in TypeScript and compiled into Narew metadata.

  • Signed draft previews: ECDSA-authenticated Durable Object sessions let editors inspect unpublished changes on the real production layout.

  • Instant cache invalidation: every committed edit bumps a version key in Workers KV so fresh HTML reaches readers in under a second.

  • First-class R2 media library: cover photography, author portraits, and project galleries are verified on upload and served straight from Cloudflare R2.

From schema file to live editorial desk

Defining a new field takes two minutes: add the column in src/db/schema.ts, describe its studio widget in narew.config.ts, and run narew-cms generate. Once the migration runs against D1, the studio updates automatically—no manual dashboard clicking required.

const postCollection = defineCollection(posts, (field) => ({
  label: "Posts",
  website: { path: "/{slug}" },
  fields: {
    title: field.title.text({ label: "Title" }),
    coverImage: field.coverImage.image({ label: "Cover image", aspectRatio: "16:9" }),
    content: field.content.richText({ label: "Content" }),
  },
}));

Explore the essays below or browse the Showcase to see how a lightweight Worker, SQLite at the edge, and thoughtful typography come together without a single client-side bundle.

More from Narew Journal

All articles →