Nextly is an open-source content platform for Next.js. It is MIT licensed and self-hosted. It runs inside your own Next.js app, on your own PostgreSQL or MySQL database, or SQLite for local work.
Nextly is in alpha. APIs may change before 1.0. Pin exact versions in production.
What "inside your app" means
Most content tools are a second system. You run a CMS somewhere, it exposes an API, and your Next.js app fetches from it over the network. That is one more deployment to run, and a network hop on every read.
Nextly is a dependency instead. You install it in your app and point it at your database. Your app then has an admin panel at /admin, and you can define content in code:
import { defineCollection, richText, text, upload } from "nextly/config";
export const Posts = defineCollection({
slug: "posts",
admin: { useAsTitle: "title" },
fields: [
text({ name: "title", required: true }),
text({ name: "slug", required: true, unique: true }),
richText({ name: "content" }),
upload({ name: "featuredImage", relationTo: "media" }),
],
// Built-in draft and published lifecycle.
status: true,
});Reading it back is a function call, not a fetch:
import { getNextly } from "nextly";
import config from "@/nextly.config";
export default async function BlogPage() {
const nextly = await getNextly({ config });
const { items: posts } = await nextly.find({
collection: "posts",
where: { status: { equals: "published" } },
sort: "-createdAt",
});
return (
<ul>
{posts.map((post) => (
<li key={String(post.id)}>{String(post.title)}</li>
))}
</ul>
);
}You read content straight from your database in your page code, with the Direct API. REST is there too, for a mobile client or a separate frontend.
Code or the Visual Schema Builder
You can model content in TypeScript or in the Visual Schema Builder. Both feed the same Nextly runtime, admin and APIs.
They differ in places. A collection made in the Visual Schema Builder cannot hold access rules or hooks written as functions, and it gets no generated types. Use the Visual Schema Builder on your development instance. The Visual Schema Builder docs describe what it writes.
Types come from code: nextly generate:types writes types for the collections, singles and field groups in your config.
What ships today
In Nextly 0.0.2-alpha.68:
- Sign-in for your team: email and password, sessions and API keys, stored in your own database.
- Role-based permissions for each collection and action, plus field-level read and write rules in code, on a collection's or single's own fields.
- A media library, stored on local disk by default, or on S3 (and R2 or MinIO), Vercel Blob or UploadThing.
- Working drafts with autosave. Turn on versions to keep a version history, compare two versions of the same language and restore an earlier one.
- Preview saved drafts beside the entry editor, and share a signed preview link that expires.
- Translate collections, singles and components, with a fallback language when a translation is missing.
- Group changes into a Content Release and publish them together at a time you choose, with a scheduler configured.
- Signed webhooks for content, media, user and form events, with retries, a delivery log, redelivery and secret rotation.
- Background jobs, run by calling one endpoint from your scheduler.
- An activity feed of who created, changed or deleted entries, and a security audit trail.
The established official plugins are the Visual Page Builder, SEO and Form Builder. Add the official Visual Page Builder when your project needs it. Twenty blocks out of the box, and the page renderer takes your own React blocks. Build forms and capture submissions with the official Form Builder plugin.
What we are working on next is on the roadmap.
Where your data lives
In your database. Nextly picks its adapter from your environment:
DB_DIALECT=postgresql
DATABASE_URL=postgresql://user:password@localhost:5432/mydbNextly supports PostgreSQL 15 or later, MySQL 8 or later, and SQLite 3.38 or later for local work.
Trying it
One command creates a project with the admin and a database:
npx create-nextly-app@alpha my-appThe fastest way to change the product is to tell us what is missing. Use GitHub Discussions for ideas and Discord for questions.
Nextly Team
Core Team