← Back to archive

Repo of the Day

SuddenDev/TenonCMS

Published: Nov 29, 2026

Open repository ↗

The CMS that lives inside your app. The admin, the API and your content run in the app you already deploy

Summary

TenonCMS is an MIT-licensed headless CMS that runs inside an existing Vite-based application instead of as a separate service. It defines content in TypeScript, stores data in the application's own database, and exposes the admin and HTTP API as routes of the same deployment.

What it is useful for

Tenon is useful for teams that need an editor interface but want to avoid operating a second CMS service. The admin, API, and content can live in one repository and deployment, while server-side code reads documents through a function call instead of an internal HTTP request. Schema-derived types also flow into page code, allowing the type checker to catch misspelled field names.

It covers editorial workflows beyond basic posts, including drafts, scheduled publishing, version history, localization, nested pages, SEO fields, menus, live preview, and media libraries. Access controls include roles, invites, access rules, and API keys. A REST API and typed browser client are also available for frontends hosted on another origin.

The documented starting points are Astro, Nuxt, TanStack Start, and standalone applications. Supported databases include SQLite, Turso, Postgres, PGlite, and Cloudflare Durable Objects, with local disk, S3-compatible storage, and Cloudflare R2 available for media.

How engineers can use it

A new project requires Node.js 24 or newer and a server runtime. The admin and API are server routes, so a purely static host cannot run them, although application pages can still be prerendered.

The README documents this setup:

npm create tenoncms@latest
cd my-site
npm run dev

The wizard asks for a framework, database, and media storage. Open the printed URL, append /admin, and create the first account; it becomes the admin. After that, sign-up closes and admins invite other users. The starter includes a Posts collection, so creating and publishing a post adds it to the home page.

Collections are defined with defineCollection. For example, a post can require a title, derive a unique slug from it, and store a rich-text body. tenon.config.ts then connects the collection to a database and secret:

export default defineCms({
  collections: { posts },
  database: sqlite("./cms.db"),
  secret: process.env.TENON_SECRET!,
});

Server code can read content directly with cms.find("posts", { where: { slug: "hello" }, limit: 1 }). Operational tasks also have documented CLI commands such as npx tenon backup, npx tenon restore <archive>, and npx tenon users create [email protected].

For an existing application, follow the README’s “Add to an existing site” guide. One important limitation is that Tenon remains in version 0.x and is not yet in beta; the README warns that minor releases may contain breaking changes, so consult the release notes before upgrading.