Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/auth/.env.example
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Database connection string
DATABASE_URL=mongodb://127.0.0.1/payload-draft-preview-example
DATABASE_URL=mongodb://127.0.0.1/payload-example-auth

# Used to encrypt JWT tokens
PAYLOAD_SECRET=YOUR_SECRET_HERE
Expand Down
13 changes: 10 additions & 3 deletions examples/auth/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,20 @@ To spin up this example locally, follow the steps below:

- `npx create-payload-app --example auth`

2. Start the server:
2. Ensure MongoDB is running:

- This example uses the MongoDB adapter and requires an accessible MongoDB instance.
- Configure `DATABASE_URL` in your `.env` (you can start from `.env.example`), for example:
- `DATABASE_URL=mongodb://127.0.0.1/payload-example-auth`
- If your MongoDB instance requires authentication, include your credentials in `DATABASE_URL`.

3. Start the server:
- Depending on your package manager, run `pnpm dev`, `yarn dev` or `npm run dev`
- When prompted, type `y` then `enter` to seed the database with sample data
3. Access the application:
4. Access the application:
- Open your browser and navigate to `http://localhost:3000` to access the homepage.
- Open `http://localhost:3000/admin` to access the admin panel.
4. Login:
5. Login:

- Use the following credentials to log into the admin panel:
> `Email: demo@payloadcms.com` > `Password: demo`
Expand Down
2 changes: 1 addition & 1 deletion examples/custom-components/.env.example
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
DATABASE_URL=mongodb://127.0.0.1/payload-example-custom-fields
DATABASE_URL=mongodb://127.0.0.1/payload-example-custom-components
PAYLOAD_SECRET=PAYLOAD_CUSTOM_FIELDS_EXAMPLE_SECRET_KEY
PAYLOAD_PUBLIC_SERVER_URL=http://localhost:3000
13 changes: 10 additions & 3 deletions examples/custom-components/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,20 @@ To spin up this example locally, follow the steps below:

- `npx create-payload-app --example custom-components`

2. Start the server:
2. Ensure MongoDB is running:

- This example uses the MongoDB adapter and requires an accessible MongoDB instance.
- Configure `DATABASE_URL` in your `.env` (you can start from `.env.example`), for example:
- `DATABASE_URL=mongodb://127.0.0.1/payload-example-custom-components`
- If your MongoDB instance requires authentication, include your credentials in `DATABASE_URL`.

3. Start the server:
- Depending on your package manager, run `pnpm dev`, `yarn dev` or `npm run dev`
- When prompted, type `y` then `enter` to seed the database with sample data
3. Access the application:
4. Access the application:
- Open your browser and navigate to `http://localhost:3000` to access the homepage.
- Open `http://localhost:3000/admin` to access the admin panel.
4. Login:
5. Login:

- Use the following credentials to log into the admin panel:
> `Email: demo@payloadcms.com` > `Password: demo`
Expand Down
2 changes: 2 additions & 0 deletions examples/custom-server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ Run the following command to create a project from the example:

- `npx create-payload-app --example custom-server`

Before starting the server, ensure MongoDB is running and `DATABASE_URL` points to it (for example `mongodb://127.0.0.1/payload-example-custom-server`).

Uses a [Next.js Custom Server](https://nextjs.org/docs/pages/building-your-application/configuring/custom-server) with express.

Made from official [examples/custom-server](https://github.com/vercel/next.js/tree/canary/examples/custom-server) from Next.js repository.
2 changes: 1 addition & 1 deletion examples/draft-preview/.env.example
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Database connection string
DATABASE_URL=mongodb://127.0.0.1/payload-draft-preview-example
DATABASE_URL=mongodb://127.0.0.1/payload-example-draft-preview

# Used to encrypt JWT tokens
PAYLOAD_SECRET=YOUR_SECRET_HERE
Expand Down
7 changes: 4 additions & 3 deletions examples/draft-preview/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@ To spin up this example locally, follow these steps:
- `npx create-payload-app --example draft-preview`

2. `cp .env.example .env` to copy the example environment variables
3. `pnpm dev`, `yarn dev` or `npm run dev` to start the server
4. `open http://localhost:3000/admin` to access the admin panel
5. Login with email `demo@payloadcms.com` and password `demo`
3. Ensure MongoDB is running and `DATABASE_URL` points to it (for example `mongodb://127.0.0.1/payload-example-draft-preview`)
4. `pnpm dev`, `yarn dev` or `npm run dev` to start the server
5. `open http://localhost:3000/admin` to access the admin panel
6. Login with email `demo@payloadcms.com` and password `demo`

That's it! Changes made in `./src` will be reflected in your app. See the [Development](#development) section for more details.

Expand Down
7 changes: 4 additions & 3 deletions examples/email/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@ To spin up this example locally, follow these steps:
- `npx create-payload-app --example email`

2. `cp .env.example .env` to copy the example environment variables
3. `pnpm install && pnpm dev` to install dependencies and start the dev server
4. open `http://localhost:3000/admin` to access the admin panel
5. Create your first user
3. Ensure MongoDB is running and `DATABASE_URL` points to it (for example `mongodb://127.0.0.1/payload-example-email`)
4. `pnpm install && pnpm dev` to install dependencies and start the dev server
5. open `http://localhost:3000/admin` to access the admin panel
6. Create your first user

## How it works

Expand Down
2 changes: 1 addition & 1 deletion examples/form-builder/.env.example
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
DATABASE_URL=mongodb://127.0.0.1/payload-form-builder-example
DATABASE_URL=mongodb://127.0.0.1/payload-example-form-builder
PAYLOAD_SECRET=YOUR_SECRET_HERE
NEXT_PUBLIC_PAYLOAD_URL=http://localhost:3000
7 changes: 4 additions & 3 deletions examples/form-builder/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@ The [Payload Form Builder Example](https://github.com/payloadcms/payload/tree/ma
- `npx create-payload-app --example form-builder`

2. `cp .env.example .env` to copy the example environment variables
3. Ensure MongoDB is running and `DATABASE_URL` points to it (for example `mongodb://127.0.0.1/payload-example-form-builder`)

3. `pnpm dev`, `yarn dev` or `npm run dev` to start the server
4. `pnpm dev`, `yarn dev` or `npm run dev` to start the server
- Press `y` when prompted to seed the database
4. `open http://localhost:3000` to access the home page
5. `open http://localhost:3000/admin` to access the admin panel
5. `open http://localhost:3000` to access the home page
6. `open http://localhost:3000/admin` to access the admin panel
- Login with email `demo@payloadcms.com` and password `demo`

That's it! Changes made in `./src` will be
Expand Down
7 changes: 4 additions & 3 deletions examples/live-preview/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@ The [Payload Live Preview Example](https://github.com/payloadcms/payload/tree/ma
- `npx create-payload-app --example live-preview`

2. `cp .env.example .env` to copy the example environment variables
3. Ensure MongoDB is running and `DATABASE_URL` points to it (for example `mongodb://127.0.0.1/payload-example-live-preview`)

3. `pnpm dev`, `yarn dev` or `npm run dev` to start the server
4. `pnpm dev`, `yarn dev` or `npm run dev` to start the server
- Press `y` when prompted to seed the database
4. `open http://localhost:3000` to access the home page
5. `open http://localhost:3000/admin` to access the admin panel
5. `open http://localhost:3000` to access the home page
6. `open http://localhost:3000/admin` to access the admin panel
- Login with email `demo@payloadcms.com` and password `demo`

That's it! Changes made in `./src` will be reflected in your app. See the [Development](#development) section for more details.
Expand Down
2 changes: 1 addition & 1 deletion examples/localization/.env.example
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Database connection string
DATABASE_URL=mongodb://127.0.0.1/payload-template-website
DATABASE_URL=mongodb://127.0.0.1/payload-example-localization

# Used to encrypt JWT tokens
PAYLOAD_SECRET=YOUR_SECRET_HERE
Expand Down
7 changes: 4 additions & 3 deletions examples/localization/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@ To facilitate the localization process, this example uses the next-intl library.
- `npx create-payload-app --example localization`

2. `cp .env.example .env` (copy the .env.example file to .env)
3. `pnpm install`
4. `pnpm run dev`
5. Seed your database in the admin panel (see below)
3. Ensure MongoDB is running and `DATABASE_URL` points to it (for example `mongodb://127.0.0.1/payload-example-localization`)
4. `pnpm install`
5. `pnpm run dev`
6. Seed your database in the admin panel (see below)

## Seed

Expand Down
2 changes: 1 addition & 1 deletion examples/tailwind-shadcn-ui/.env.example
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
DATABASE_URL=mongodb://127.0.0.1/payload-template-blank-3-0
DATABASE_URL=mongodb://127.0.0.1/payload-example-tailwind-shadcn-ui
PAYLOAD_SECRET=YOUR_SECRET_HERE
8 changes: 5 additions & 3 deletions examples/tailwind-shadcn-ui/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@ To spin up this example locally, follow these steps:

> Adjust `PAYLOAD_PUBLIC_SITE_URL` in the `.env` if your front-end is running on a separate domain or port.

3. `pnpm dev`, `yarn dev` or `npm run dev` to start the server
3. Ensure MongoDB is running and `DATABASE_URL` points to it (for example `mongodb://127.0.0.1/payload-example-tailwind-shadcn-ui`)

4. `pnpm dev`, `yarn dev` or `npm run dev` to start the server
- Press `y` when prompted to seed the database
4. `open http://localhost:3000` to access the home page
5. `open http://localhost:3000/admin` to access the admin panel
5. `open http://localhost:3000` to access the home page
6. `open http://localhost:3000/admin` to access the admin panel

That's it! Changes made in `./src` will be reflected in your app. See the [Development](#development) section for more details.
7 changes: 4 additions & 3 deletions examples/whitelabel/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@ To spin up this example locally, follow these steps:
- `npx create-payload-app --example whitelabel`

2. `cp .env.example .env` to copy the example environment variables
3. `pnpm install && pnpm dev` to install dependencies and start the dev server
4. `open http://localhost:3000/admin` to access the admin panel
5. Login with email `dev@payloadcms.com` and password `test`
3. Ensure MongoDB is running and `DATABASE_URL` points to it (for example `mongodb://127.0.0.1/payload-example-whitelabel`)
4. `pnpm install && pnpm dev` to install dependencies and start the dev server
5. `open http://localhost:3000/admin` to access the admin panel
6. Login with email `dev@payloadcms.com` and password `test`

## Re-branding walkthrough

Expand Down