Use Cases / Blog Platform

Blog Platform.

Define your post schema in code, or build it visually. Either way, your editors get a Lexical-powered rich text editor, categories and authors as proper relational collections, and a media library for images. No plugin marketplace required.

Key capabilities

  • Lexical Rich Text — Slash commands, drag-and-drop blocks, tables, code blocks, and custom React embeds. Your writers get a proper editor.
  • Relational Taxonomy — Categories and authors are real collections with relationships. Query all posts in a category or by an author in a single call.
  • Media Library — Upload and organize images with automatic Sharp processing. Responsive sizes generated at upload time.
  • Code-first or Visual — Define the schema in TypeScript for full version control, or use the visual builder. Both produce the same admin experience.

Every blog setup is the same compromise.

Managed blog platforms lock you into their editor and their data model. Headless CMS tools give you flexibility but add another subscription and deployment. Building it yourself means reinventing slug generation, rich text storage, and image uploads every time.

Nextly gives you a production-ready blog schema in minutes, with full TypeScript control over every field, hook, and access rule.

Blog schema in under 30 lines

Posts collection

import {
  defineCollection, text, richText,
  relationship, select, upload, date,
} from "nextly/config";

export default defineCollection({
  slug: "posts",
  fields: [
    text({ name: "title", required: true }),
    text({ name: "slug", unique: true }),
    richText({ name: "content" }),
    upload({ name: "featuredImage", relationTo: "media" }),
    relationship({ name: "author", relationTo: "users" }),
    relationship({
      name: "categories",
      relationTo: "categories",
      hasMany: true,
    }),
    date({ name: "publishedAt" }),
  ],
  // Built-in Draft / Published lifecycle (Save Draft / Publish in admin)
  status: true,
  hooks: {
    beforeChange: [
      async ({ data }) => ({
        ...data,
        slug: data.title?.toLowerCase().replace(/\s+/g, "-"),
      }),
    ],
  },
});

Categories collection

import { defineCollection, text } from "nextly/config";

export default defineCollection({
  slug: "categories",
  fields: [
    text({ name: "name", required: true }),
    text({ name: "slug", unique: true }),
  ],
});

Start building with Nextly

Free, open source, and yours to own. No sign-up required.

Terminal