This is the code that powers the official public demo of Payload CMS.
It's deployed at https://demo.payloadcms.com. Go check it out!
This demo showcases many of the powerful features that Payload is capable, including:
- Collections and Globals
- Use of Payload's Local Node API to seed and reset initial demo data each time the app starts
- Access Control to restrict who can do what to the public demo's data
- Versions and Drafts functionality
- A great pattern for how to create reusable fields that can be used and re-used easily
- Field-based localization
- Many advanced field types, including the relationship, blocks, array, and many more
- The official Payload SEO plugin
- The official Payload Form Builder plugin
- The official Payload Nested Docs plugin
- Custom React admin panel components
- Auto-generated TypeScript types
Each time you fire up the server—either in development or production, this demo will clear out your database and populate it with new records. If you're planning to use this for production purposes, make sure you remove the included code that's responsible for this, otherwise you will lose your data each time you restart your server!
You can clone this repo to your own computer and play around super easily.
To do so, you'll need the following software:
- Yarn or NPM
- NodeJS version 10+
- A Mongo Database - IMPORTANT: you need to either have MongoDB running locally, or have signed up for a free MongoDB Atlas server in order to test this repo locally.
1. Clone the repo by running the following command at your terminal:
git clone git@github.com:payloadcms/public-demo.git
Navigate to folder and install dependencies
Type cd ./public-demo
and then yarn
or npm install --legacy-peer-deps
to add all required dependencies.
Duplicate the example .env
file and fill in your own values
Type cp .env.example .env
in your terminal to make a copy of the example .env
file, and then edit that file to fill in your own values.
Typically, the only line that you'll need to change within your new .env
for local development is the MONGO_URL
value. If you have MongoDB running locally, then you can use the example connection string, but if you are using Mongo Atlas or similar, you'll want to fill this value in with your own connection string.
Fire up the development server
Finally, type yarn dev
to start up the server and see it in action!