payload-cms-boilerplate

Blank Payload 3 and Next.js 16 starter with Postgres, Tailwind, shadcn/ui primitives and a built-in SEO module

payload-cms-boilerplate preview

Overview

Summary generated from the README

A general-purpose Payload CMS 3 starter built on Next.js 16 with a PostgreSQL adapter, Tailwind CSS and Radix-based UI primitives. It includes Users and Media collections, a Lexical rich text renderer, and the official SEO, Redirects and Live Preview plugins. S3 and Vercel Blob storage adapters are installed and can be enabled in the config. It requires a PostgreSQL database and a Payload secret.

Features

  • Users and Media collections with a seed script
  • SEO module with metadata builders, Open Graph merging and JSON-LD generators
  • Generated robots and sitemap routes
  • Lexical rich text with a React renderer
  • Custom image and video media field components
  • Pre-installed S3 and Vercel Blob storage adapters

Good for

  • Starting a custom Payload and Next.js project with PostgreSQL and a Tailwind UI foundation
  • Building SEO-focused content sites that need structured data out of the box

From the author

A blank template to get started with Payload 3.84.1

Get started

This repository is a GitHub template: create your own copy of it in one click.

Create a repository from this template

README

Payload CMS Boilerplate

Modern, production-ready CMS starter built with Payload CMS 3.84.1 and Next.js 16.

Features

  • Modern UI/UX — Tailwind CSS, Radix UI, shadcn/ui primitives
  • Responsive Design — Mobile-first layout with header/footer components
  • Dark/Light Mode — CSS variable-based theme system
  • Rich Text Editor — Lexical-powered rich text with React renderer
  • Media Management — Image & video field components with S3 / Vercel Blob storage adapters
  • SEO Module — buildMetadata, mergeOpenGraph, JSON-LD generators, robots.ts, sitemap.ts
  • Official Payload Plugins — SEO, Redirects, Live Preview, Payload Cloud
  • Forms — react-hook-form + Zod validation
  • Vercel Analytics — Built-in with zero config
  • GraphQL API — Endpoint + Playground included
  • TypeScript — Strict typing throughout

Technologies

TechnologyVersionDescription
Next.js16.2.4React framework
Payload CMS3.84.1Headless CMS
Tailwind CSS3.4.17CSS framework
PostgreSQL—Database (via pg adapter)
TypeScript6.0.3Type safety
React19.2.5UI library
Zod4.xSchema validation
react-hook-form7.xForm handling

Quick Start

1. Clone the Project

git clone https://github.com/Xjectro/payload-cms-boilerplate.git
cd payload-cms-boilerplate

2. Install Dependencies

npm install
# or
yarn install
# or
pnpm install

3. Environment Setup

Copy .env.example to .env and fill in the required variables:

cp .env.example .env
# Database Configuration
DATABASE_URL=postgres://postgres:<password>@127.0.0.1:5432/payload_cms_boilerplate

# Application Secrets
PAYLOAD_SECRET=YOUR_SECRET_HERE

# Site
APP_URL=http://localhost:3000
APP_TITLE=Your Site Name

# Environment Variables for Next.js
NEXT_PUBLIC_URL=${APP_URL}
NEXT_PUBLIC_TITLE=${APP_TITLE}

4. Database Setup

# Run database migrations
npm run payload migrate

5. Seed the Database (optional)

npm run seed

6. Start the Development Server

npm run dev

Open http://localhost:3000 in your browser.

Project Structure

payload-cms-boilerplate/
├── src/
│   ├── app/
│   │   ├── (payload)/
│   │   │   ├── admin/
│   │   │   │   ├── [[...segments]]/
│   │   │   │   │   ├── not-found.tsx
│   │   │   │   │   └── page.tsx
│   │   │   │   └── importMap.js
│   │   │   ├── api/
│   │   │   │   ├── [...slug]/
│   │   │   │   │   └── route.ts
│   │   │   │   ├── graphql/
│   │   │   │   │   └── route.ts
│   │   │   │   └── graphql-playground/
│   │   │   │       └── route.ts
│   │   │   ├── custom.scss
│   │   │   └── layout.tsx
│   │   ├── (public)/
│   │   │   ├── layout.tsx
│   │   │   ├── page.tsx
│   │   │   └── template.tsx
│   │   ├── robots.ts
│   │   └── sitemap.ts
│   ├── collections/
│   │   ├── Media/
│   │   │   └── index.ts
│   │   └── Users/
│   │       └── index.ts
│   ├── features/
│   │   └── example/
│   │       ├── components/
│   │       ├── hooks/
│   │       └── utils/
│   ├── payload/
│   │   ├── components/
│   │   │   ├── fields/
│   │   │   │   └── media/
│   │   │   │       ├── image-media/
│   │   │   │       │   └── index.tsx
│   │   │   │       ├── video-media/
│   │   │   │       │   └── index.tsx
│   │   │   │       ├── index.tsx
│   │   │   │       └── types.ts
│   │   │   └── rich-text.tsx
│   │   ├── utils/
│   │   │   └── payload-hooks/
│   │   │       └── access.ts
│   │   ├── payload.config.ts
│   │   ├── payload-types.ts
│   │   └── seed.ts
│   ├── shared/
│   │   ├── lib/
│   │   │   └── utils.ts
│   │   ├── providers/
│   │   │   ├── client-provider.tsx
│   │   │   └── server-provider.tsx
│   │   ├── seo/
│   │   │   ├── components/
│   │   │   │   └── home-structured-data.tsx
│   │   │   ├── utils/
│   │   │   │   ├── json-ld/
│   │   │   │   │   ├── article.ts
│   │   │   │   │   ├── breadcrumb.ts
│   │   │   │   │   ├── event.ts
│   │   │   │   │   ├── faq.ts
│   │   │   │   │   ├── helpers.ts
│   │   │   │   │   ├── how-to.ts
│   │   │   │   │   ├── index.ts
│   │   │   │   │   ├── item-list.ts
│   │   │   │   │   ├── local-business.ts
│   │   │   │   │   ├── organization.ts
│   │   │   │   │   ├── person.ts
│   │   │   │   │   ├── product.ts
│   │   │   │   │   ├── types.ts
│   │   │   │   │   ├── video.ts
│   │   │   │   │   ├── webpage.ts
│   │   │   │   │   └── website.ts
│   │   │   │   ├── metadata.ts
│   │   │   │   └── open-graph.ts
│   │   │   └── index.ts
│   │   └── ui/
│   │       ├── layout/
│   │       │   ├── header.tsx
│   │       │   └── footer.tsx
│   │       ├── primitives/
│   │       │   ├── alert.tsx
│   │       │   ├── badge.tsx
│   │       │   ├── button.tsx
│   │       │   ├── checkbox.tsx
│   │       │   ├── form.tsx
│   │       │   ├── input.tsx
│   │       │   └── label.tsx
│   │       └── react/
│   │           └── design-system.tsx
│   ├── styles/
│   │   ├── globals.css
│   │   └── themes.css
│   └── css.d.ts
├── public/
│   ├── favicon.ico
│   └── opengraph-image.webp
├── .env.example
├── .prettierrc.json
├── components.json
├── eslint.config.mjs
├── next-env.d.ts
├── next.config.ts
├── package.json
├── postcss.config.mjs
├── tailwind.config.ts
└── tsconfig.json

Available Commands

CommandDescription
npm run devStart development server
npm run buildBuild for production
npm run startStart production server
npm run lintCheck code quality
npm run formatFormat code with Prettier
npm run seedSeed the database
npm run payloadPayload CLI (migrate, generate…)

SEO Module

The SEO module lives in src/shared/seo/ and is ready to use out of the box:

  • buildMetadata — generates Metadata objects for Next.js pages
  • mergeOpenGraph — merges Open Graph tags with site defaults
  • JSON-LD generators — Article, BreadcrumbList, Event, FAQ, HowTo, ItemList, LocalBusiness, Organization, Person, Product, VideoObject, WebPage, WebSite
  • HomeStructuredData — drop-in component for the home page
  • robots.ts / sitemap.ts — auto-generated at build time

Storage Adapters

Two storage adapters are pre-installed and can be activated in payload.config.ts:

  • AWS S3 — @payloadcms/storage-s3
  • Vercel Blob — @payloadcms/storage-vercel-blob

API Endpoints

EndpointDescription
/api/graphqlGraphQL API
/api/graphql-playgroundGraphQL Playground
/adminPayload Admin Panel

Deployment

Vercel

vercel deploy

Or connect the GitHub repository in the Vercel dashboard for automatic deploys on push.

Set all environment variables from .env.example in your Vercel project settings before deploying.

Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Support

License

MIT — see the LICENSE file for details.


Made with love by Xjectro

Claim this template

More Starters & boilerplates templates

payload-starter screenshot

payload-starter

Next.js 16 and Payload 3 starter with PostgreSQL, role-based admin access, shadcn/ui and SEO helpers

100
v3
Next.js
Updated 4 months ago
payload-v4-admin-starter screenshot

payload-v4-admin-starter

Payload v4 beta website starter with configurable admin dashboard widgets and a custom semantic admin theme

1
v4
Next.js
Updated Yesterday
payload-template-project screenshot

payload-template-project

Next.js 16 and Payload starter with Clerk auth, Postgres, S3 media storage and Resend email

0
v3
Next.js
Updated 3 weeks ago