
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
Project Directory
Repository Info
- Repository-payloadcms/payload
- Stars-28k+
- License-MIT
- Last Analyzed-December 2025
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
withPayloadconfig 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.