Go to file
2024-06-23 15:01:05 +02:00
.idea chore: improve editor configuration 2024-03-08 00:11:00 -05:00
.vscode chore: improve editor configuration 2024-03-08 00:11:00 -05:00
public chore: restyles start page (#114) 2024-04-15 16:19:08 -04:00
src Add missing type declaration for isEditor 2024-06-23 11:21:50 +02:00
types Push base file for payload types 2024-06-23 10:46:29 +02:00
.dockerignore Optimize docker image size 2024-06-14 22:35:28 +02:00
.drone.yml Clean up 2024-06-23 15:01:05 +02:00
.env.local.example Update env example 2024-06-19 22:46:17 +02:00
.eslintrc.json Initial commit from Create Next App 2024-02-27 14:10:20 -05:00
.gitignore Move payload-types dir 2024-06-23 10:31:42 +02:00
.prettierrc.json chore: add .prettierrc.json 2024-03-10 01:46:54 -05:00
CHANGELOG.md chore: adds static files to public folder 2024-03-10 18:07:02 -04:00
docker-compose.prod.yml Remove drone token from docker-compose 2024-06-19 22:28:30 +02:00
docker-compose.yml Use bind mount for dev container 2024-06-23 10:32:27 +02:00
docker-entrypoint.sh Add urlencoding for mongo_password 2024-06-19 12:08:41 +02:00
Dockerfile Clean up 2024-06-23 15:01:05 +02:00
next.config.mjs Remove silly little typo 2024-06-19 22:02:09 +02:00
package.json Clean up 2024-06-23 15:01:05 +02:00
payload.config.ts Add admin role for base user 2024-06-23 10:52:32 +02:00
pnpm-lock.yaml Optimize docker image size 2024-06-14 22:35:28 +02:00
README.md Update readme 2024-06-23 10:32:36 +02:00
start-database.sh feat(postgres): add postgres docker script 2024-04-09 15:45:41 +03:00
tsconfig.json Move payload-types dir 2024-06-23 10:31:42 +02:00

Get started with nextload

Prerequisites:

node Using a version manager for installing node is recommended, see nvm or fnm

pnpm corepack enable pnpm

docker get docker script:

curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh

Start developing

  1. Copy the environment variables

cp .env.local.example .env.example

  1. Install dependencies

pnpm install

  1. Run dev container

pnpm dev or docker compose up

Notes

  • payload-types.ts file will be generated when starting the dev container, but can also be generated manually with pnpm generate:types
  • Dev container will use node_modules, so make sure to run pmpm install prior to pnpm dev

Technical details

Nextload is a fork of payload 3 demo

The app folder You'll see that Payload requires a few files to be present in your /app folder. There are files for the admin UI as well as files for all route handlers. We've consolidated all admin views into a single page.tsx and consolidated most of the REST endpoints into a single route.ts file for simplicity, but also for development performance. With this pattern, you only have to compile the admin UI / REST API / GraphQL API a single time - and from there, it will be lightning-fast.

The next.config.js withPayload function You'll see in the Next.js config that we have a withPayload function installed. This function is required for Payload to operate, and it ensures compatibility with packages that Payload needs such as drizzle-kit, sharp, pino, and mongodb.

Using a TypeScript alias to point to your Payload config In the tsconfig.json within this repo, you'll see that we have paths set up to point @payload-config to the Payload config, which is located in the root. You can put your config wherever you want. By default, the page.tsx files and route.ts files within the /app folder use this alias. In the future, we might make it optional to use paths - and by default, we might just hard-code relative path imports to the config. We would like to hear your feedback on this part. What do you prefer? Use paths or just use relative imports?