rsnext/examples/cms-payload
Steven 4466ba436b
chore(examples): use default prettier for examples/templates (#60530)
## Description
This PR ensures that the default prettier config is used for examples
and templates.

This config is compatible with `prettier@3` as well (upgrading prettier
is bigger change that can be a future PR).

## Changes
- Updated `.prettierrc.json` in root with `"trailingComma": "es5"` (will
be needed upgrading to prettier@3)
- Added `examples/.prettierrc.json` with default config (this will
change every example)
- Added `packages/create-next-app/templates/.prettierrc.json` with
default config (this will change every template)

## Related

- Fixes #54402
- Closes #54409
2024-01-11 16:01:44 -07:00
..
app chore(examples): use default prettier for examples/templates (#60530) 2024-01-11 16:01:44 -07:00
components chore(examples): use default prettier for examples/templates (#60530) 2024-01-11 16:01:44 -07:00
css chore(examples): use default prettier for examples/templates (#60530) 2024-01-11 16:01:44 -07:00
pages/api chore(examples): use default prettier for examples/templates (#60530) 2024-01-11 16:01:44 -07:00
payload chore(examples): use default prettier for examples/templates (#60530) 2024-01-11 16:01:44 -07:00
public
utilities chore(examples): use default prettier for examples/templates (#60530) 2024-01-11 16:01:44 -07:00
.env.example chore(next/image)!: mark domains as deprecated in favor remotePatterns (#57062) 2023-10-19 20:24:48 +00:00
.gitignore
.npmrc
cssVariables.js chore(examples): use default prettier for examples/templates (#60530) 2024-01-11 16:01:44 -07:00
next-env.d.ts
next-env.scss.d.ts chore(examples): use default prettier for examples/templates (#60530) 2024-01-11 16:01:44 -07:00
next.config.js chore(examples): use default prettier for examples/templates (#60530) 2024-01-11 16:01:44 -07:00
package.json
payload-types.ts chore(examples): use default prettier for examples/templates (#60530) 2024-01-11 16:01:44 -07:00
README.md chore: NextJS -> Next.js (#55961) 2023-09-25 14:53:11 +00:00
tsconfig.json

Next + Payload Serverless Demo

This is a demo showing how to utilize @payloadcms/next-payload to deploy Payload serverlessly, in the same repo alongside of a Next.js app.

Deploy your own

Deploy the example using Vercel:

Deploy with Vercel

How to use

Execute create-next-app with npm, Yarn, or pnpm to bootstrap the example:

npx create-next-app --example cms-payload cms-payload-app
yarn create next-app --example cms-payload cms-payload-app
pnpm create next-app --example cms-payload cms-payload-app

Deploy it to the cloud with Vercel (Documentation).

The only thing you need to do to deploy to Vercel is to ensure that you have a Mongo Atlas database connection string and an S3 bucket (if desired).

Fill out the same environment variables that are shown in the .env.example with your own values, and then you're good to go!

Developing locally

To develop with this package locally, make sure you have the following required software:

  1. MongoDB
  2. Node + NPM / Yarn
  3. An S3 bucket to store media (optional)

Getting started

Follow the steps below to spin up a local dev environment:

  1. Clone the repo
  2. Run yarn or npm install
  3. Run cp .env.example .env and fill out all ENV variables as shown
  4. Run yarn dev to start up the dev server

From there, you can visit your admin panel via navigating to http://localhost:3000/admin. Go ahead and start working!