Home
Softono
payload-cms-boilerplate

payload-cms-boilerplate

Open source TypeScript
20
Stars
1
Forks
6
Issues
0
Watchers
2 weeks
Last Commit

About payload-cms-boilerplate

Hello world! πŸ‘‹ This is a super powerful boilerplate built with Payload CMS 3.64.0 and Next.js 16! Everything is ready to get started right away! ✨

Platforms

Web Self-hosted

Languages

TypeScript

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

Technology Version Description
Next.js 16.2.4 React framework
Payload CMS 3.84.1 Headless CMS
Tailwind CSS 3.4.17 CSS framework
PostgreSQL β€” Database (via pg adapter)
TypeScript 6.0.3 Type safety
React 19.2.5 UI library
Zod 4.x Schema validation
react-hook-form 7.x Form 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

Command Description
npm run dev Start development server
npm run build Build for production
npm run start Start production server
npm run lint Check code quality
npm run format Format code with Prettier
npm run seed Seed the database
npm run payload Payload 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

Endpoint Description
/api/graphql GraphQL API
/api/graphql-playground GraphQL Playground
/admin Payload 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