2.4 KiB
Payload Auth Example Front-End
This is a Next.js app using the App Router. It was made explicitly for Payload's Auth Example.
This example uses the App Router, the latest API of Next.js. If your app is using the legacy Pages Router, check out the official Pages Router Example.
Getting Started
Payload
First you'll need a running Payload app. If you have not done so already, open up the cms folder and follow the setup instructions. Take note of your serverURL, you'll need this in the next step.
Next.js
- Clone this repo
cdinto this directory and runyarnornpm installcp .env.example .envto copy the example environment variablesyarn devornpm run devto start the serveropen http://localhost:3001to see the result
Once running you will find a couple seeded pages on your local environment with some basic instructions. You can also start editing the pages by modifying the documents within Payload. See the Auth Example for full details.
Learn More
To learn more about Payload and Next.js, take a look at the following resources:
- Payload Documentation - learn about Payload features and API.
- Next.js Documentation - learn about Next.js features and API.
- Learn Next.js - an interactive Next.js tutorial.
You can check out the Payload GitHub repository as well as the Next.js GitHub repository - your feedback and contributions are welcome!
Deployment
The easiest way to deploy your Next.js app is to use the Vercel Platform from the creators of Next.js. You could also combine this app into a single Express server and deploy in to Payload Cloud.
Check out our Payload deployment documentation or the Next.js deployment documentation for more details.