This is a monorepo containing a template setup for Payload CMS and a corresponding NextJS website.
Unlike the official Payload-Next repo, the two applications in this repo are intended to be hosted separately.
- NodeJS & npm - this repo was created using Node 20.9.0 and npm 10.2.4 but any versions supported by both PayloadCMS and NextJS shuold work just fine.
- Docker & Docker Compose - these are required for Azurite and MongoDB to run Payload locally.
- Typescript - Both projects are configured to use TypeScript
- ESLint
- TailwindCSS - The website project uses Tailwind CSS
To run Payload locally:
- Open your terminal and navigate to the directory
cms
in the root of the repo. - Run
docker compose up -d
- Run
npm run dev
Payload is now running. You can access the CMS admin at http://localhost:3001.
Copy the .env.example
file to create a .env
file.
You will need to add your own DATABASE_URI
and PAYLOAD_SECRET
values.
The AZURE_STORAGE_*
variables are preconfigured to use the dockerized Azurite instance locally. In production it is expected that these variables will be configured with an Azure blob Storage account.
The email variables (MAILER_TRANSPORT
, SMTP_*
and SENDGRID_API_KEY
) are preconfigured to use a localhost mail server. I recommend using Papercut SMTP locally. These settings will need to be configured for a production mail server in other environments.
To run the NextJS website locally:
- Open your terminal and navigate to the directory
website
in the root of the repo. - Run
npm run dev
NextJS is now running. You can access the website at http://localhost:3000.