Skip to content
This repository was archived by the owner on Mar 27, 2026. It is now read-only.
absolutegravitasPublic archive

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

Repository files navigation

# Start Docker service
sudo systemctl start docker

# Stop current Docker container and start a fresh one
sudo docker stop payload-postgresdb && sudo docker rm payload-postgresdb && sudo ./start-postgres-db.sh

sudo docker stop payload-mongodb && sudo docker rm payload-mongodb && sudo ./start-mongodb.sh

# Update Payload types, build, and run locally
pnpm generate:types && pnpm build && pnpm dev

# Update types, create DB migrations, build, and run locally
pnpm generate:types && pnpm payload migrate && pnpm build && pnpm dev

# Update types and run locally
pnpm generate:types && pnpm dev

# Update types, create DB migrations
pnpm generate:types && pnpm payload migrate:create

# List running containers
sudo docker ps

# stop all docker
sudo docker stop $(sudo docker ps -q)

# Stop and remove payload container
sudo docker stop payload-postgresdb
sudo docker rm payload-postgresdb
sudo docker stop payload-mongodb
sudo docker rm payload-mongodb

# Purge all Docker data and pull new image
sudo docker volume rm payload-postgresdb_data
sudo docker volume rm payload-mongodb_data
sudo docker volume rm postgres-dev_data
sudo docker volume rm postgres-website_data
sudo docker system prune -a --volumes

var collectionsToKeep = [ "users" // Example: Keep a 'users' collection // IMPORTANT: Add all other collection names you want to KEEP here. // Any collection not listed here (and not a system collection) will be DROPPED. ];

db.getCollectionNames().forEach(function(collectionName) { // 1. Skip MongoDB's internal system collections (e.g., "system.indexes") if (collectionName.startsWith("system.")) { print(Skipping system collection: ${collectionName}); return; }

// 2. Check if the current collection name is in our 'collectionsToKeep' array
if (collectionsToKeep.includes(collectionName)) {
    print(`Skipping protected collection: ${collectionName}`);
} else {
    // 3. If it's not a system collection and not in the 'collectionsToKeep' list, drop it
    print(`Dropping collection: ${collectionName}`);
    // CORRECTED LINE: Using db.getCollection()
    db.getCollection(collectionName).drop();
}

});

print("Finished dropping collections.");

merge main branch changes to local branch

git checkout main
git fetch origin main
git merge origin/main

Connecting to PostgreSQL

psql -h localhost -p 5432 -U payload -d payload-website

Optional: Drop all tables in PostgreSQL

DO $$
DECLARE
    table_record RECORD;
BEGIN
    FOR table_record IN
        SELECT table_name
        FROM information_schema.tables
        WHERE table_schema = 'public' AND table_type = 'BASE TABLE'
    LOOP
        EXECUTE 'DROP TABLE IF EXISTS ' || quote_ident(table_record.table_name) || ' CASCADE';
    END LOOP;
END $$;

Check if there are any tables

SELECT table_schema, table_name
FROM information_schema.tables
WHERE table_schema NOT IN ('pg_catalog', 'information_schema')
ORDER BY table_schema, table_name;

Payload Website

This is the repository for Payload's official website. It was built completely in public using Payload itself, more on that here.

Payload headless CMS website

This site showcases lots of cool stuff like how to use Payload's GraphQL API to its fullest extent, how to build a super dynamic light / dark mode into a Next site without any first-load flickering, how to render remotely stored docs from MDX to Next.js pages, how to use Stripe to build a custom SaaS integration, and much more.

✨ Tech stack

  • Payload (obviously)
  • TypeScript
  • Next.js 13 and its new App Router
  • SCSS Modules
  • GraphQL
  • MDX for docs
  • Stripe for Payload Cloud

⭐ The CMS

Payload is leveraged for everything that this site does, outside of its documentation which is all stored as Markdown in the Payload repo on GitHub. The CMS powering this site is completely open-source and can be found here.

Both this repo and the CMS repo can be used as great examples to learn how to build Payload projects at scale.

☁️ Payload Cloud

Payload Cloud is out! This is a one-click integration to deploy production-ready instances of your Payload apps directly from your GitHub repo, read the blog post to get all the details. The entire frontend of Payload Cloud has been built in public and is included within this repo 😱.

🚀 Running the project locally

To get started with this repo locally, follow the steps below:

  • Clone the repo
  • yarn
  • Run cp .env.example .env to create an .env
  • Fill out the values within your new .env, corresponding to your own environment
  • Run yarn dev
  • Bam

Hosts file

The locally running app must run on local.payloadcms.com:3000 because of http-only cookie policies and how the GitHub App redirects the user back to the site after authenticating. To do this, you'll need to add the following to your hosts file:

127.0.0.1 local.payloadcms.com

On Mac you can find the hosts file at /etc/hosts. On Windows, it's at C:\Windows\System32\drivers\etc\hosts:

Documentation

The documentation for this site is stored in the Payload repo as Markdown files. These are fetched at build time and rendered as pages on the site.

You can also specify a beta version and legacy version to render different versions of the docs:

  • Set the environment variable NEXT_PUBLIC_ENABLE_BETA_DOCS to true to enable the beta docs.
  • Specify a branch, commit, or tag with NEXT_PUBLIC_BETA_DOCS_REF. The default for the beta docs is beta.
  • Set the environment variable NEXT_PUBLIC_ENABLE_LEGACY_DOCS to true to enable the legacy docs.
  • Specify a branch, commit, or tag with NEXT_PUBLIC_LEGACY_DOCS_REF. The default for the legacy docs is null, and will fallback to the main branch.

Working on docs locally:

To work on the docs locally you will need to have the payload repo cloned down (it is easier if you have 2 versions, one per payload version):

// .env
DOCS_DIR_V2=path-to-local-payload-v2-repo
DOCS_DIR_V3=path-to-local-payload-v3-repo

To generate the docs locally you can run pnpm fetchDocs:local, then you can boot up the website repo and view them at http://localhost:3000/docs. Any time you make changes to the v2/v3 docs then you will need to re-run the pnpm fetchDocs:local command.

License

The Payload website is available as open source under the terms of the MIT license.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages