Skip to content

Getting Started

Prerequisites

  • Node.js 18+ and pnpm
  • MongoDB database (local or cloud)
  • Git

Quick Start

To spin up this project locally, follow these steps:

Installation & Setup

  1. Clone the repository (or fork it for easier updates in the future):

    Note this is a private repo, to get access you need to buy the Payblocks addon from Shadcn Blocks

  2. Install dependencies:

    Terminal window
    corepack enable
    pnpm install
  3. Copy the environment variables:

    Terminal window
    cp .env.example .env
  4. Set up your MongoDB database:

    • Install MongoDB locally or use a hosted service such as Atlas MongoDB Cloud Account
    • If you used a cloud host make sure you update your .env file with the connection string:
      MONGODB_URI=your_connection_string
      Make sure to also include the database name in the connection URL (e.g., payload-template-website as shown in .env.example).
  5. Start the development server:

    Terminal window
    pnpm dev
  6. Visit your application:

  7. Seed the database (optional):

    • Click on the “Seed DB” button in the Admin panel home page to create some starter pages.
    • This step is recommended for those not familiar with Payload CMS.
    • If seeding was successfull, you will see some new content on the homepage http://localhost:3000/
    • You can now visit the admin panel pages collection to edit the new demo pages http://localhost:3000/admin/collections/pages
  8. Change all secrets (optional but recommended):

    • Open your .env file and change all secrets. Create some random string for all these secrets: PAYLOAD_SECRET, PAYLOAD_PUBLIC_DRAFT_SECRET, NEXT_PRIVATE_DRAFT_SECRET, REVALIDATION_KEY, NEXT_PRIVATE_REVALIDATION_KEY, CRON_SECRET