tobias cb0a2f77a8
Some checks failed
continuous-integration/drone/push Build is failing
fix build errors
2024-06-24 17:34:40 +02:00
2024-03-08 00:11:00 -05:00
2024-04-15 16:19:08 -04:00
2024-06-24 17:34:40 +02:00
2024-06-24 01:22:01 +02:00
2024-06-14 22:35:28 +02:00
2024-06-23 15:01:05 +02:00
2024-06-19 22:46:17 +02:00
2024-06-23 10:31:42 +02:00
2024-03-10 01:46:54 -05:00
2024-06-23 15:01:05 +02:00
2024-06-19 22:02:09 +02:00
2024-06-24 17:34:40 +02:00
2024-06-24 17:34:40 +02:00
2024-06-23 10:32:36 +02:00
2024-06-24 13:52:25 +02:00
2024-06-24 17:34:40 +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?

Description
No description provided
Readme 3.6 MiB
Languages
TypeScript 84.9%
Makefile 3.8%
CSS 3.8%
Shell 2.9%
JavaScript 2.8%
Other 1.8%