Payload CMS Architecture
Document: 15-payload-cms-architecture.md
Version: 1.0.0
Purpose
This document defines the architecture, responsibilities, and implementation standards for Payload CMS within Rundown projects.
Payload CMS is the official content management system used across all Rundown applications. It serves as the central platform for managing structured content while integrating seamlessly with the frontend and supporting services.
This document establishes how Payload should be used, what responsibilities it owns, and how it interacts with the rest of the application architecture.
Payload Philosophy
Payload is the source of truth for all client-managed content.
Content should be authored, validated, and managed within Payload before being consumed by the frontend.
The frontend is responsible for presenting content.
Payload is responsible for managing content.
Responsibilities
Payload owns:
-
Content management
-
Collections
-
Globals
-
Rich text content
-
Media references
-
Administrative interface
-
User authentication (where applicable)
-
Editorial workflows
-
Content validation
-
API access to managed content
Non-Responsibilities
Payload should not own:
-
Frontend rendering
-
Styling
-
Animations
-
Business calculations
-
Media file storage
-
Infrastructure configuration
-
SEO presentation logic
Payload manages data, not presentation.
Collections
Collections represent repeatable content.
Examples include:
-
Posts
-
Products
-
Categories
-
Team Members
-
Testimonials
-
Portfolio Projects
-
FAQs
Collections should be:
-
Clearly named
-
Independently maintainable
-
Focused on a single content type
Avoid combining unrelated content into a single collection.
Globals
Globals represent singleton content shared across the application.
Typical globals include:
-
Navigation
-
Footer
-
Site Settings
-
SEO Defaults
-
Company Information
Globals should only be used when exactly one instance of the content exists.
Blocks
Blocks provide modular content construction.
Examples:
-
Hero
-
Gallery
-
Features
-
Pricing
-
Testimonials
-
FAQ
-
CTA
-
Logo Cloud
-
Statistics
Each Payload block should correspond to a reusable frontend component.
A one-to-one relationship between Payload blocks and React components should be maintained wherever practical.
Fields
Field definitions should:
-
Use appropriate data types.
-
Include validation.
-
Provide helpful labels.
-
Include descriptions where useful.
-
Minimize unnecessary complexity.
Fields should model business requirements rather than frontend implementation details.
Relationships
Relationships should be used to avoid duplicated data.
Examples:
-
Products → Categories
-
Posts → Authors
-
Portfolio Projects → Services
-
Testimonials → Clients
Relationships improve consistency and simplify content management.
Media
Payload stores references to media.
Actual media files are stored in Cloudflare R2.
This separation improves scalability and reduces database size.
Access Control
Payload should implement role-based permissions.
Typical roles include:
-
Administrator
-
Editor
-
Content Manager
-
Client
Each role should receive the minimum permissions required to perform its responsibilities.
Hooks
Hooks should be used to automate predictable content workflows.
Appropriate examples include:
-
Slug generation
-
Timestamp updates
-
Data normalization
-
Validation
-
Audit logging
Hooks should remain deterministic and avoid complex business logic.
API Usage
Payload APIs should be treated as the canonical source for managed content.
The frontend should consume Payload through well-defined queries rather than duplicating business rules.
Avoid exposing unnecessary data through public endpoints.
Drafts & Publishing
Projects requiring editorial workflows should use:
-
Drafts
-
Scheduled publishing
-
Version history (where appropriate)
Publishing workflows should support non-technical content editors.
Content Modelling Principles
Every content model should be:
-
Focused
-
Extensible
-
Normalized
-
Reusable
Content structures should reflect business concepts rather than page layouts.
For example:
Use:
-
Services
-
Team Members
-
Projects
Instead of:
-
Homepage Cards
-
About Page Sections
-
Landing Page Blocks
Business entities remain reusable across multiple pages.
Payload Directory Structure
Standard structure:
payload/
collections/
globals/
blocks/
fields/
hooks/
access/
plugins/
Each directory should have a single responsibility.
Engineering Decision
Content Source of Truth
Status: Accepted
Decision
Payload CMS is the single source of truth for all client-managed content across Rundown applications.
Reasoning
Using Payload as the central content platform:
-
Eliminates duplicated content.
-
Simplifies editorial workflows.
-
Improves maintainability.
-
Supports structured content modelling.
-
Integrates naturally with Next.js.
Payload Checklist
Before implementing a new collection or global, verify:
-
Does this represent a real business entity?
-
Should it be a Collection or a Global?
-
Are relationships modelled correctly?
-
Is validation sufficient?
-
Are permissions appropriate?
-
Can the content be reused elsewhere?
-
Does a corresponding frontend component exist?
Summary
Payload CMS serves as the content engine for every Rundown application.
By separating content management from presentation, Payload enables flexible, reusable, and maintainable content structures while providing clients with a powerful yet intuitive editing experience.
Related Documents
Related ADRs
- ADR-001: Repository Structure