payload-cms-boilerplate
Blank Payload 3 and Next.js 16 starter with Postgres, Tailwind, shadcn/ui primitives and a built-in SEO module
Next.js 16 and Payload starter with Clerk auth, MongoDB, S3 media storage, Resend email and shadcn/ui
A general-purpose starter for customer websites, landing pages and SaaS apps built on Next.js 16, Payload 3 and MongoDB. Authentication is handled by Clerk, media uploads go to S3-compatible storage, and transactional email uses Resend. The UI uses Tailwind CSS 4 and shadcn/ui. It needs a MongoDB connection string, Clerk keys and storage credentials, and includes an optional Docker Compose file for local MongoDB.
Get started quickly with Next.js, Clerk Auth, Payload CMS and MongoDB.
This repository is a GitHub template: create your own copy of it in one click.
Create a repository from this templateInternal starter template for building customer websites, landing pages, and SaaS applications on a consistent stack. Bootstrap new projects from this repo instead of starting from scratch — auth, CMS, storage, and UI conventions are already wired up.
^18.20.2 or >=20.9.0^9, ^10, or ^11Clone the repo and install dependencies:
pnpm install
Copy the environment file and fill in the values:
cp .env.example .env
| Variable | Purpose |
|---|---|
DATABASE_URL | MongoDB connection string |
PAYLOAD_SECRET | Payload's signing secret |
PREVIEW_SECRET | Secret used for live preview links |
CRON_SECRET | Secret for authenticating scheduled/cron jobs |
NEXT_PUBLIC_SERVER_URL | Public URL the app is served from |
CLERK_SECRET_KEY / NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY | Clerk API keys |
CLERK_WEBHOOK_SIGNING_SECRET | Verifies incoming Clerk webhooks |
NEXT_PUBLIC_CLERK_SIGN_IN_URL, ..._SIGN_IN_FALLBACK_REDIRECT_URL, ..._SIGN_UP_FALLBACK_REDIRECT_URL | Clerk auth flow routing |
S3_BUCKET, S3_ACCESS_KEY_ID, S3_ACCESS_KEY_SECRET, S3_REGION, S3_ENDPOINT | Media storage (S3-compatible) |
RESEND_API_KEY, RESEND_FROM_EMAIL, RESEND_FROM_NAME | Transactional email |
Start the dev server:
pnpm dev
Open http://localhost:3000. Follow the on-screen instructions to log in via
Clerk and complete first-run setup.
To run MongoDB locally via Docker instead of a standalone instance or Atlas:
DATABASE_URL in .env to mongodb://127.0.0.1/<dbname>.<dbname> in docker-compose.yml.docker-compose up (add -d to run in the background).| Script | Purpose |
|---|---|
pnpm dev | Start the Next.js dev server |
pnpm build | Production build |
pnpm start | Serve the production build |
pnpm lint | Run ESLint |
pnpm payload | Run the Payload CLI |
pnpm generate:types | Regenerate Payload's TypeScript types from the config |
pnpm generate:importmap | Regenerate Payload's admin import map |
Run pnpm generate:types after changing any collection, global, or field config so
generated types stay in sync.
src/ — application code (Next.js routes, Payload config, collections, components)context/ — living documentation (architecture, UI tokens/rules, code standards,
build plan, progress tracker) used to keep new projects built from this template
consistentdocker-compose.yml — local MongoDB for Docker-based developmentSee the Payload Collections docs to extend either.
When bootstrapping a new internal project from this template:
package.json name/description and this README's title.context/ and update it to describe the new project's purpose, scope, and
architecture — it should not still describe this template once customized.Internal questions: ask in the team channel. For upstream framework issues, see the Payload Discord or Payload GitHub discussions.
Blank Payload 3 and Next.js 16 starter with Postgres, Tailwind, shadcn/ui primitives and a built-in SEO module
Next.js 16, Payload 3, Clerk auth, Postgres and S3 storage wired up as a baseline for new projects
Payload 3 starter with Better Auth, Postgres, S3 storage, a blog and composable layout and motion components