A plugin to integrate PayloadCMS with BigCommerce Catalyst framework using the Pluginizr system.
BETA Notice: This package is currently in beta. While stable and functional, it may undergo changes before the final release.
This plugin requires:
- A working Catalyst project
- Pluginizr to be installed in your Catalyst project
- A Postgres database for storing PayloadCMS data
- (Optional) A Vercel Blob storage for storing media files on Vercel
Clone as submodule this repository into your Catalyst project's plugins directory:
cd /path-to-catalyst
git submodule add https://github.com/thebigrick/catalyst-payloadcms.git plugins/catalyst-payloadcms
pnpm installModify your .env.local file and add the following required environment variables:
PAYLOAD_SECRET=my-super-complex-secret # Please modify
PAYLOAD_CMS_FRONTEND_TOKEN=my-super-complex-secret # Please modify
PAYLOAD_PREVIEW_SECRET=my-super-complex-secret # Please modify
NEXT_PUBLIC_URL=https://your-catalyst-project.vercel.app # Modify accordingly to your project URL
PAYLOADCMS_DB_ADAPTER=... # Modify accordingly to your database adapter (see below)if NEXT_PUBLIC_URL is not set, the plugin will use http://localhost:3000 as the default URL.
PAYLOADCMS_DB_ADAPTER=postgres
POSTGRES_URL=postgres://user:password@localhost:5432/database # Modify accordingly to your Postgres database URLPAYLOADCMS_DB_ADAPTER=vercel-postgres
POSTGRES_URL=postgres://user:password@localhost:5432/database # Modify accordingly to your Postgres database URLNote: this variable is automatically provided by Vercel when using their Postgres/Neon database service.
PAYLOADCMS_DB_ADAPTER=mongodb
MONGODB_URI=mongodb://localhost:27017/database # Modify accordingly to your MongoDB database URLIf no storage adapter is set, the plugin will use the default local storage adapter.
If you want to use Vercel Blob storage for storing media files, you need to set the following environment variables:
PAYLOADCMS_STORAGE_ADAPTER=vercel-blob
BLOB_READ_WRITE_TOKEN=... # Modify accordingly to your Vercel Blob storage read/write tokenNote: this variable is automatically provided by Vercel when using their Blob storage service.
After setting up the environment variables, you can open the PayloadCMS admin by visiting /payload/admin on your Catalyst project.
The plugin can be extended with additional components using Catalyst Pluginizr (https://github.com/thebigrick/catalyst-pluginizr) through three main registry files:
src/registry/components-registry.ts: Used for simple componentssrc/registry/containers-registry.ts: Used for layout components or components that can contain simple componentssrc/registry/fc-registry.ts: Maps PayloadCMS components to React components based on their "interfaceName"
Example of extending a registry:
//...
export default valuePlugin<typeof componentsRegistry>({
name: 'add-my-component',
resourceId: '@thebigrick/catalyst-payloadcms/registry/components-registry',
wrap: (source) => ({
...source,
myAdditionalPlugin
}),
});For more details on creating plugins, refer to the Pluginizr documentation.
We welcome contributions to improve this plugin! Here's how you can help:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Follow TypeScript best practices
- Include appropriate tests for new features
- Update documentation as needed
- Ensure your code passes all existing tests
This project is licensed under the MIT License - see the LICENSE file for details.
If you encounter any issues or have questions, please:
- Check the existing issues in the repository
- Create a new issue if your problem hasn't been reported
- Provide as much detail as possible about your setup and the problem you're encountering