Payload CMS — Open Source Fullstack Next.js Headless CMS
Payload is the open-source headless CMS and app framework built on Next.js. TypeScript-first, code-configured, with instant admin panel, auth, and file uploads.
Agent 可直接安装
这个资产可安装;Agent 先选择当前运行时、检查安装计划,再运行匹配命令。
npx -y tokrepo@latest install f40e26c8-349e-11f1-9bc6-00163e2b0d79 --target codex先 dry-run 确认安装计划,再运行此命令。
What it is
Payload is an open-source, fullstack Next.js framework that gives you an instant backend with a headless CMS, admin panel, authentication, file uploads, and more, all configured in TypeScript code. Unlike traditional CMS platforms that are GUI-configured, Payload uses a code-first approach where your content schema is your source of truth.
Version 3.0 is built directly into Next.js, eliminating the traditional backend/frontend separation. MIT licensed.
How it saves time or tokens
Payload generates the entire admin UI and API from your TypeScript configuration. Define a collection with fields, and Payload gives you a CRUD admin panel, REST API, GraphQL API, access control, and hooks without writing any frontend or API code. Built-in authentication with email/password, magic links, and OAuth removes the need for a separate auth system. Version history and draft/publish workflow are included, not add-ons.
How to use
- Create a new Payload project:
npx create-payload-app@latest my-project
cd my-project
npm run dev
- Open http://localhost:3000/admin, create your admin user, and start building.
- Define a collection in your Payload config:
import { CollectionConfig } from 'payload';
const Posts: CollectionConfig = {
slug: 'posts',
admin: { useAsTitle: 'title' },
access: {
read: () => true,
create: ({ req }) => !!req.user,
},
fields: [
{ name: 'title', type: 'text', required: true },
{ name: 'content', type: 'richText' },
{ name: 'status', type: 'select',
options: ['draft', 'published'] },
{ name: 'author', type: 'relationship',
relationTo: 'users' },
],
};
Example
Using Payload's Local API in a Next.js page:
import { getPayload } from 'payload';
import config from '@payload-config';
export default async function BlogPage() {
const payload = await getPayload({ config });
const posts = await payload.find({
collection: 'posts',
where: { status: { equals: 'published' } },
sort: '-createdAt',
limit: 10,
});
return (
<div>
{posts.docs.map((post) => (
<article key={post.id}>
<h2>{post.title}</h2>
</article>
))}
</div>
);
}
Related on TokRepo
- Coding tools — More fullstack frameworks on TokRepo.
- Content tools — Browse CMS and content management tools.
Common pitfalls
- Running Payload with SQLite in production causes performance issues with concurrent users. Use PostgreSQL or MongoDB for production.
- Not configuring access control on collections exposes data publicly. Define read/create/update/delete access functions for every collection.
- Overusing richText fields when structured fields (text, number, select) would be better. Structured fields enable typed queries and validation.
常见问题
Payload 3.0 supports PostgreSQL and MongoDB as primary databases. SQLite is available for local development. The database adapter is configured in your Payload config.
Yes. Payload exposes REST and GraphQL APIs automatically for all collections. You can build any frontend (React, Vue, mobile apps) that consumes these APIs. The admin panel is optional for content editors.
Payload is code-first (TypeScript config) while Strapi is GUI-first (content types built in admin). Payload 3.0 is built into Next.js while Strapi is a standalone backend. Payload includes more built-in features (access control, versions, hooks).
Yes. Payload supports multi-language content with field-level translations. Configure locales in your Payload config and each localizable field stores content per language.
Yes. Payload is MIT licensed and fully open source. There are no feature restrictions in the open-source version. Payload Cloud is an optional hosted service.
引用来源 (3)
- Payload GitHub— Payload CMS open-source headless CMS
- Payload Docs— Payload documentation and guides
- Next.js Documentation— Next.js App Router for fullstack React
来源与感谢
- GitHub: payloadcms/payload — 41.7K+ ⭐ | MIT
- Website: payloadcms.com
讨论
相关资产
OpenSSF Scorecard — Security Health Metrics for Open Source
OpenSSF Scorecard automatically assesses open source projects against a set of security best practices, producing a score that helps maintainers and consumers understand supply chain risk.
Kepler.gl — Open Source Geospatial Data Visualization
A powerful open-source tool for large-scale geospatial data visualization built on deck.gl and Mapbox GL.
draw.io — Free Open-Source Diagramming Tool for Any Platform
draw.io is a free, browser-based diagramming application that supports flowcharts, UML, network diagrams, and more. Works offline as a desktop app on Windows, macOS, and Linux with no account required.
Babylon.js — Powerful 3D Game and Rendering Engine
Babylon.js is a powerful, beautiful, simple, open 3D game and rendering engine for the web. WebGL + WebGPU, Playground IDE, Node Material Editor, GUI system, physics, and VR/AR support. Microsoft-backed with enterprise polish.