Payload CMS Project Structure

The headless CMS that is also an application framework. Payload 3.0 is built natively on Next.js, allowing you to build the backend and frontend in a single repository.

Updated 2025-12-30

#payload #nextjs #cms #typescript #monorepo #turborepo #headless
PNGPDF

Project Directory

payload/
packages/
Core framework packages
payload/
Core logic and types
src/
package.json
next/
Next.js integration adapter
ui/
Admin UI components
db-postgres/
PostgreSQL adapter (Drizzle)
richtext-lexical/
Lexical editor adapter
templates/
Starter templates
blank/
Minimal starter
ecommerce/
Full e-commerce demo
website/
Standard website demo
test/
Integration tests
e2e/
int/
turbo.json
Monorepo config
pnpm-workspace.yaml
Workspace config

Repository Info

Tech Stack

  • Framework-Next.js 15 (App Router)
  • Language-TypeScript
  • Database-Postgres / MongoDB / SQLite
  • ORM-Drizzle (SQL) / Mongoose (NoSQL)
  • Monorepo-Turborepo + pnpm
  • Editor-Lexical (Facebook)

Architecture Notes

Payload 3.0 represents a major shift to a 'Next.js Native' architecture. Instead of running a separate Express server, Payload now runs directly within the Next.js request lifecycle. This means the Admin UI is built with React Server Components, and the API routes are Next.js Route Handlers. The repo is organized as a monorepo to manage the core framework (packages/payload), database adapters (packages/db-*), and plugins.

Key Directories

  • packages/payload/-The core logic. It defines the 'Config' system, auth, access control, and the Local API.
  • packages/next/-The bridge between Payload and Next.js. It provides the withPayload config wrapper and the necessary route handlers.
  • templates/-A collection of reference implementations. The 'ecommerce' template is particularly robust.

Why This Structure?

Payload is the best example of a 'Code-First' CMS in the Next.js ecosystem. Its structure shows how to build a complex library that integrates deeply with a meta-framework (Next.js) while maintaining modularity through a plugin-based architecture.

Share this template

Related Templates

© 2025 FolderStructure.dev