Go to file
tobias 5e74f45855
Some checks failed
continuous-integration/drone/push Build is failing
Always restart
2024-07-13 15:39:31 +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 Bump combo x2 2024-07-11 21:40:18 +02:00
types Add posts 2024-06-24 01:22:01 +02:00
.dockerignore Optimize docker image size 2024-06-14 22:35:28 +02:00
.drone.yml Align image names 2024-07-05 16:02:31 -04: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.db.yml Add standalone db script 2024-06-25 11:50:12 +02:00
docker-compose.prod.yml Fix uploads volume path in the correct file this time 2024-07-11 21:35:24 +02:00
docker-compose.yml Always restart 2024-07-13 15:39:31 +02:00
docker-entrypoint.sh Add urlencoding for mongo_password 2024-06-19 12:08:41 +02:00
Dockerfile Revert bogus change to CMD syntax 2024-07-05 16:13:32 -04:00
next.config.mjs Disable code obfuscation 2024-07-05 22:24:10 +02:00
package.json Add standalone db script 2024-06-25 11:50:12 +02:00
payload.config.ts Revert "Remove baseURL from preview url" 2024-07-06 22:19:52 +02:00
pnpm-lock.yaml fix build errors 2024-06-24 17:34:40 +02:00
postcss.config.js Add paystro visual components 2024-06-24 00:05:41 +02:00
README.md Bump 2024-07-11 21:26:16 +02:00
start-database.sh feat(postgres): add postgres docker script 2024-04-09 15:45:41 +03:00
tailwind.config.js Only target frontned for TW 2024-06-24 13:52:25 +02:00
tsconfig.json Target dockerfile prod step in prod 2024-06-24 18:00:44 +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?