Skip to content

Payload CMS

Author: Cecilie Aagedal (https://github.com/caagedal)

og-image

Introduction

Payload CMS is a modern, headless content management system (CMS) built with the developer in mind. It provides full flexibility through a JavaScript/TypeScript-based structure and an intuitive setup that minimizes learning overhead. With its customizable features and straightforward authorization system, Payload allows developers to create secure, complex content models with full data control, making it ideal for developer-focused, powerful solutions

Brief History

Payload CMS was created to fill a gap and address the need for a modern CMS that focuses on the developer.

  • 2021: The initial version of Payload CMS was launched, quickly gaining traction within the developer community.
  • 2022: Payload was made open-source with several updates and improvements. The community grows rapidly, and Payload becomes a viable alternative to other popular CMS platforms.
  • 2023: Payload 2.0 was released, featuring support for PostgreSQL, Live Preview, Lexical Editor and more.
  • 2024: Payload 3.0 was introduced, bringing native support for Next.js, which simiplified integration with this popular framework.

Main Features

Payload CMS stands out due to its unique combination of features aimed at simplifying content management for developers. Some of its main features include:

FeatureDescription
Developer-FocusedPayload CMS is built specifically for developers, providing a highly customizable and JavaScript-friendly environment. It integrates seamlessly into existing JavaScript or TypeScript projects, making it easy to develop and maintain custom applications.
Self-HostedUnlike many other headless CMSs, Payload can be hosted on your own infrastructure, giving you complete control over your data. This self-hosting approach is ideal for developers and companies concerned with privacy and data security.
Extensible SchemaPayload CMS allows you to create flexible content schemas easily. The schema can be extended to accommodate a wide range of content structures, from simple blogs to complex e-commerce applications.
Built-in AuthenticationPayload includes built-in authentication with role-based access control, allowing secure, user-specific experiences without the need for external user management systems.
Rich Text EditorA powerful rich text editor lets content creators easily format and manage content. The editor is highly customizable, allowing developers to tailor it to their project’s specific needs.
GraphQL and REST APIsPayload provides both GraphQL and REST APIs, making it easy to query and interact with your content. This flexibility allows developers to choose the API that best suits their needs.
Media ManagementPayload CMS includes media management capabilities that allow developers and content creators to easily upload, organize, and manage images and other media assets.

Market Comparison

Payload CMS competes with several well-established content management solutions, both open-source and proprietary. Here’s a comparison with other popular CMS options:

Payload CMS vs. Strapi

  • Self-hosting and Control: Both Payload and Strapi allow self-hosting, giving developers control over their environments. Payload’s schema structure is often more intuitive for JavaScript developers, and its API design is highly flexible and developer-friendly.
  • Ease of Use: Strapi has a more user-friendly interface for non-developers, whereas Payload targets developers, offering more granular control and a streamlined developer experience.
  • Customizability: Payload provides extensive customizability, allowing developers to build content models without limitations that other CMSs may impose.

Payload CMS vs. WordPress (Headless Mode)

  • Developer Experience: WordPress in headless mode can carry overhead and unnecessary features, while Payload CMS is lightweight, focused, and tailored for JavaScript developers. This makes it a more efficient choice for developers.
  • Flexibility: Payload is built with flexibility in mind, allowing easy customization and integration with JavaScript codebases, whereas WordPress often requires plugins for similar flexibility.

Payload CMS vs. Sanity

  • Data Modeling: Sanity offers a collaborative editing experience with strong data modeling capabilities. Payload, however, provides more direct control and integrates better within custom Node.js projects. Payload’s schema is defined with code, giving developers full programmatic control over their content.
  • Pricing: Sanity’s pricing can increase with content growth, while Payload’s self-hosted model can be more cost-effective for content-heavy projects, with only hosting costs to consider.

Getting Started

To get started with Payload CMS, you need to have a compatibale database (MongoDB or Postgres) and NodeJS installed, then follow these simple steps:

  1. Installation:

    Terminal window
    npx create-payload-app my-project

    And follow the prompts.

  2. Configuration: Navigate to your project directory and configure your content schemas in payload.config.ts. Payload uses a code-first approach to define schemas, which means you can use JavaScript or TypeScript to create highly customized content models.

Inside the project folder, navigate to the file named payload.config.js.This is the main configuration file, here you will define with the use of javaScript or typeScript:

  • collections: to structure data (e.g. products, users, posts..).
  • Fields: for each collection, defining what data can be stored.
  • Hooks: ti add custom logic.
  • Authentication: to set up authentication and access control.

payloads API and admin interface is automatically generated baced on what is specified in here.

  1. Run Your Project: Start the Payload server:

    Terminal window
    npm run dev

    This will start it in development mode. By default, you will be able to open the admin panel at: http://localhost:3000/admin. The admin panel is intuitive and allows you to create, edit, and manage your content efficiently.

  2. Integrate with Your Application:

As mentioned in an earlier step, Payload automatocally generates both REST and GraphQL API’s based on your configuration in the config file. The API can be used to retrieve and manipulate data in your front-end application.

  • REST API endpoints: located under the /api route.
  • GraphQL API endpoints: located under the /api/graphql route.

With Payloads flexibility using hooks and custom functions, it is ideal for projects that require more tailored solutions.

Conclusion

Payload CMS offers a powerful, developer-focused content management system that emphasizes flexibility, self-hosting, and control. Here’s a summary of its key advantages and disadvantages:

Advantages: As it is highly customizable and developer-focused, there are many advantages to add to the list

  1. Developer-Friendly: Payload is designed with the developer in mind, with Flexible JavaScript/TypeScript-based configuration with extensive customizations through hooks.

  2. Headless and API-first: Being a headless CMS, means it can be used with any front-end technology via it’s API and it gives more control over content display without any extra to it.

  3. Flexible Data Modeling: Supports various data structures, including numbers, media, and relationships.

  4. Customizable admin UI: Admin userface, built with React, can be customized to fit whatever the project needs.

  5. Strong authentiation and access control: Payload offers built-in authentication and detailed access control enhancing security.

  6. Open Source: As and open-source software, developers can modify and extend Payload to suit specific requirements. The communtiy and contributors continously improve it, with an active discord channel where both Payload devs and followers discuss and post improvements and changes.

  7. Versioning and Drafting: Allows content tracking and draft editing.

Disadvantages: While there are a lot of advantages to Payload, there will always be disadvantages as well, here are a few:

  1. Not Beginner-Friendly: Payload is designed with developers in mind first-hand, so the learning curve might be very steep for non-developers.

  2. Database dependency Payload requires a hosting infrastructure/database to function. This can be challenging for beginners, and it can add setup and management overhead.

  3. No Built-in Front-End: Payload is a headless CMS, so it does not include any default front-end. You have to create your own front-end application, which will require more development time.

  4. Limited Ecosystem: Because Payload is so new on the marked, there can be limitations to integrations compared to more established CMSs.

  5. Limited Community: Smaller than other CMS communities, so troubleshooting can be more time-consuming, allthough the community is growing.

Payload is ideal for developers who are looking for a modern, highly flexible CMS that is easy to customize and work with. Its self-hosted nature, combined with its powerful features, makes it a competitive choice in the headless CMS market. While it may not be the most suitable option for non-developers, its focus on developer experience and customization makes it a standout option for those building complex, custom projects.

I’m looking forward to using Payload on future projects because I appreciate both its aesthetics and its customizable nature. I also like how modern it feels and how actively engaged and open the team is with the community. Rather than giving off a ‘corporate’ vibe, Payload feels like it was built by developers who genuinely saw a need in the market and wanted to create something useful.

References

Additional Resources