Setup on macOS
This guide explains how to run website-nextjs locally on a MacBook.
1) Install required tools
Install Homebrew (see https://brew.sh/) if it is not already installed:
bash
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"Install project dependencies:
bash
brew install postgresql@18 nvm git gh pnpmInstall and use Node 22:
bash
nvm install 22
nvm use 222) Clone the repository
Authenticate GitHub CLI and clone the repo:
bash
gh auth login
gh repo clone prezly/website-nextjs
cd website-nextjs3) Configure environment variables
Create local environment file:
bash
cp .env.example .env.localSet database connection in .env.local (replace the password):
dotenv
POSTGRES_URL=postgres://website_user:change_me_strong_password@127.0.0.1:5432/website?sslmode=disableAlso set required secrets such as PAYLOAD_SECRET and WEBSITE_REVALIDATION_SECRET.
4) Prepare PostgreSQL
Make sure PostgreSQL is running:
bash
brew services start postgresql@18Create the local role and database:
bash
psql postgres <<'SQL'
CREATE ROLE website_user WITH LOGIN PASSWORD 'change_me_strong_password';
CREATE DATABASE website OWNER website_user;
GRANT ALL PRIVILEGES ON DATABASE website TO website_user;
SQLGrant schema permissions:
bash
psql postgres://website_user:change_me_strong_password@127.0.0.1:5432/website <<'SQL'
GRANT ALL ON SCHEMA public TO website_user;
ALTER SCHEMA public OWNER TO website_user;
ALTER DEFAULT PRIVILEGES IN SCHEMA public
GRANT ALL ON TABLES, SEQUENCES, FUNCTIONS TO website_user;
SQLRestore latest local DB dump:
bash
./scripts/db-restore-latest.shIf script execution fails with permissions, run:
bash
chmod +x ./scripts/*.sh5) Install dependencies and run the app
bash
pnpm install
pnpm devOpen http://localhost:3000. Payload admin is available at /admin.