dd-starter

Payload starter with Puck visual page editing, a page tree and Better Auth sign-in on Next.js and Postgres

dd-starter preview

Overview

Summary generated from the README

Sets up a Payload 3 site on Next.js with the Puck drag-and-drop page builder, a hierarchical page tree with auto-generated slugs, and Better Auth for authentication. It uses PostgreSQL via Vercel Postgres and Vercel Blob storage, with Tailwind CSS v4 styling. Requires Node.js 20+, pnpm and a Postgres database, with secrets for Payload and Better Auth.

Features

  • Puck visual page builder with prebuilt components and multiple page layouts
  • Page tree view with folder-based URLs and auto-generated slugs
  • Better Auth with email/password, passkeys, TOTP two-factor and API keys
  • Admin and user roles where the first account becomes admin
  • Redirects, search, SEO, live preview and admin bar plugins
  • Vitest integration tests and Playwright, with a Vercel deploy button

Good for

  • Building marketing sites where editors lay out pages visually
  • Launching hierarchical content sites on Vercel with Postgres
  • Starting projects that need passkey or two-factor authentication for admins

From the author

Delmare Digital starter template for Payload CMS

Get started

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

Create a repository from this template

README

DD Starter

A modern Payload CMS starter template featuring visual page editing, hierarchical content management, and enhanced authentication. Built and maintained by Delmare Digital.

This template serves as a working demonstration of the @delmaredigital plugin ecosystem for Payload CMS.

Deploy with Vercel

Included Plugins

@delmaredigital/payload-puck

Visual page builder powered by Puck. Create pages with a drag-and-drop interface instead of traditional block-based editing.

  • Visual WYSIWYG page editing
  • Pre-built components (Section, Flex, Grid, Heading, Text, Button, etc.)
  • Multiple page layouts (Default, Full Width, Landing)
  • Live preview in editor
  • Server-side rendering support

@delmaredigital/payload-page-tree

Hierarchical content organization with automatic slug generation.

  • Visual tree view for content hierarchy
  • Folder-based URL structure
  • Auto-generated slugs from path segments
  • Works with Pages and Posts collections

@delmaredigital/payload-better-auth

Enhanced authentication using Better Auth.

  • Email/password authentication
  • Passkey/WebAuthn support
  • Two-factor authentication (TOTP)
  • API key management
  • Role-based access control

Tech Stack

Getting Started

Prerequisites

  • Node.js 20+
  • pnpm
  • PostgreSQL database

Installation

  1. Clone the repository
  2. Copy environment variables:
    cp .env.example .env.local
    
  3. Configure your environment variables (see below)
  4. Install dependencies:
    pnpm install
    
  5. Start the development server:
    pnpm dev
    
    The database schema is automatically synced in development mode (push mode).

Environment Variables

Required:

  • POSTGRES_URL - PostgreSQL connection string
  • PAYLOAD_SECRET - Secret for JWT signing (min 32 chars)
  • BETTER_AUTH_SECRET - Secret for Better Auth (min 32 chars)

Optional:

  • BLOB_READ_WRITE_TOKEN - Vercel Blob storage token
  • PUCK_API_KEY - For Puck AI page generation (from puckeditor.com)

Project Structure

src/
├── app/(frontend)/     # Next.js frontend routes
├── app/(payload)/      # Payload admin routes
├── collections/        # Payload collections (Posts, Media, Users)
├── components/         # React components
├── lib/
│   ├── auth/          # Better Auth configuration
│   └── puck/          # Puck layouts and options
├── puck/              # Puck editor configuration
└── plugins/           # Payload plugin configuration

Usage

Creating Pages

  1. Navigate to /admin/page-tree
  2. Click "New Page" to create a page
  3. Use the Puck visual editor to build your page layout
  4. Publish when ready

Managing Content Hierarchy

The Page Tree view (/admin/page-tree) provides a visual interface for organizing your content. Drag pages to reorder or nest them within folders.

Authentication and roles

Better Auth handles sign-in; Payload's admin panel manages users. Public sign-up is enabled, so the role model is deliberately strict:

RoleAdmin panelAuthor content (pages, posts, media, globals, redirects, templates, folders)Read published content
adminyesyesyes
usernonoyes
anonymousnonoyes

The first account created becomes admin; every later sign-up is a user and cannot set its own role. Drafts, version history, the Page Tree endpoints, the job runner and draft preview are all admin-only. The access helpers live in src/access/ and the integration tests in tests/int/cms-access.int.spec.ts pin this matrix.

Development

# Start dev server
pnpm dev

# Type check + lint
pnpm check

# Integration tests (needs POSTGRES_URL; CI runs them against a Postgres service)
pnpm test:int

# Build for production
pnpm build

# Run production build
pnpm start

Deploying to Vercel

This template is ready to deploy to Vercel:

  1. Push your repository to GitHub
  2. Import the project in Vercel
  3. Configure environment variables in Vercel dashboard
  4. Important: Override the build command to pnpm run ci

The ci script runs migrations before building, which is required for production deployments.

Database Migrations

The project uses push mode in development, which automatically syncs schema changes.

For production, migrations are created once and included in the repository. If you make schema changes:

# Create a new migration
pnpm payload migrate:create

License

MIT


Built by Delmare Digital

More Landing pages templates

payload-cms screenshot

payload-cms

Payload 3 and Next.js website starter with a layout builder, live preview, SEO tools and Postgres

80
v3
Next.js
Updated 6 days ago
payload-site-starter screenshot

payload-site-starter

Next.js website template with a layout builder, blog, search, SEO and live preview on Postgres

20
v?
Next.js
Updated 1 years ago
payloadcms-website screenshot

payloadcms-website

Block-based website builder on Payload 3.0 with Next.js, Tailwind CSS and the form builder plugin

11
v?
Next.js
Updated 2 years ago