@next-friday/create-app 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +94 -2
- package/dist/main.mjs +414 -0
- package/package.json +84 -3
- package/templates/base/.agents/hooks/agent-shell-gate.sh +355 -0
- package/templates/base/.agents/hooks/agent-suppression-gate.sh +45 -0
- package/templates/base/.agents/rules/automation-owned-checks.md +5 -0
- package/templates/base/.agents/rules/code-comments.md +3 -0
- package/templates/base/.agents/rules/current-state-authority.md +17 -0
- package/templates/base/.agents/rules/demand-driven-configuration.md +7 -0
- package/templates/base/.agents/rules/dependency-security.md +5 -0
- package/templates/base/.agents/rules/deterministic-testing.md +15 -0
- package/templates/base/.agents/rules/diagnostics-and-error-handling.md +7 -0
- package/templates/base/.agents/rules/git-workflow.md +10 -0
- package/templates/base/.agents/rules/no-suppression.md +7 -0
- package/templates/base/.agents/rules/script-driven-changes.md +7 -0
- package/templates/base/.agents/rules/single-author-style.md +7 -0
- package/templates/base/.claude/rules/agents-guide.md +1 -0
- package/templates/base/.claude/rules/automation-owned-checks.md +1 -0
- package/templates/base/.claude/rules/code-comments.md +1 -0
- package/templates/base/.claude/rules/current-state-authority.md +1 -0
- package/templates/base/.claude/rules/demand-driven-configuration.md +1 -0
- package/templates/base/.claude/rules/dependency-security.md +12 -0
- package/templates/base/.claude/rules/diagnostics-and-error-handling.md +1 -0
- package/templates/base/.claude/rules/git-workflow.md +1 -0
- package/templates/base/.claude/rules/no-suppression.md +1 -0
- package/templates/base/.claude/rules/script-driven-changes.md +1 -0
- package/templates/base/.claude/rules/single-author-style.md +1 -0
- package/templates/base/.claude/settings.json +61 -0
- package/templates/base/.commitlintrc.json +3 -0
- package/templates/base/.cursor/BUGBOT.md +17 -0
- package/templates/base/.cursor/hooks/agent-constitution-gate.sh +32 -0
- package/templates/base/.cursor/hooks.json +26 -0
- package/templates/base/.cursor/rules/automation-owned-checks.mdc +10 -0
- package/templates/base/.cursor/rules/code-comments.mdc +8 -0
- package/templates/base/.cursor/rules/current-state-authority.mdc +22 -0
- package/templates/base/.cursor/rules/demand-driven-configuration.mdc +12 -0
- package/templates/base/.cursor/rules/dependency-security.mdc +11 -0
- package/templates/base/.cursor/rules/diagnostics-and-error-handling.mdc +12 -0
- package/templates/base/.cursor/rules/git-workflow.mdc +15 -0
- package/templates/base/.cursor/rules/no-suppression.mdc +12 -0
- package/templates/base/.cursor/rules/script-driven-changes.mdc +12 -0
- package/templates/base/.cursor/rules/single-author-style.mdc +12 -0
- package/templates/base/.editorconfig +13 -0
- package/templates/base/.gitattributes +1 -0
- package/templates/base/.github/CODEOWNERS +2 -0
- package/templates/base/.github/ISSUE_TEMPLATE/config.yml +1 -0
- package/templates/base/.github/dependabot.yml +77 -0
- package/templates/base/.github/file-filters.yml +19 -0
- package/templates/base/.github/labeler.yml +25 -0
- package/templates/base/.github/requirements/diff-cover.txt +213 -0
- package/templates/base/.github/workflows/deploy.yml +124 -0
- package/templates/base/.github/workflows/osv-scanner.yml +34 -0
- package/templates/base/.github/workflows/pr-triage.yml +29 -0
- package/templates/base/.github/workflows/secret-scan.yml +50 -0
- package/templates/base/.github/workflows/validate-pr-title.yml +48 -0
- package/templates/base/.github/workflows/zizmor.yml +62 -0
- package/templates/base/.github/zizmor.yml +4 -0
- package/templates/base/.gitleaks.toml +14 -0
- package/templates/base/.husky/commit-msg +3 -0
- package/templates/base/.husky/pre-commit +17 -0
- package/templates/base/.husky/pre-merge-commit +7 -0
- package/templates/base/.husky/pre-push +15 -0
- package/templates/base/.nvmrc +1 -0
- package/templates/base/SECURITY.md +15 -0
- package/templates/base/knip.json +3 -0
- package/templates/base/pnpm-workspace.yaml +17 -0
- package/templates/base/railway.json +9 -0
- package/templates/base/scripts/check-agent-gates.ts +252 -0
- package/templates/base/scripts/sync-agent-rules.ts +121 -0
- package/templates/nestjs/.agents/rules/typescript-first.md +7 -0
- package/templates/nestjs/.agents/rules.json +41 -0
- package/templates/nestjs/.claude/rules/deterministic-testing.md +20 -0
- package/templates/nestjs/.claude/rules/typescript-first.md +13 -0
- package/templates/nestjs/.cursor/rules/deterministic-testing.mdc +21 -0
- package/templates/nestjs/.cursor/rules/typescript-first.mdc +13 -0
- package/templates/nestjs/.dependency-cruiser.json +28 -0
- package/templates/nestjs/.dockerignore +9 -0
- package/templates/nestjs/.env.example +1 -0
- package/templates/nestjs/.github/ISSUE_TEMPLATE/bug.yml +66 -0
- package/templates/nestjs/.github/ISSUE_TEMPLATE/feature.yml +50 -0
- package/templates/nestjs/.github/pull_request_template.md +25 -0
- package/templates/nestjs/.github/workflows/ci.yml +181 -0
- package/templates/nestjs/.github/workflows/sast.yml +45 -0
- package/templates/nestjs/.lintstagedrc.json +10 -0
- package/templates/nestjs/.prettierignore +2 -0
- package/templates/nestjs/.prettierrc.json +1 -0
- package/templates/nestjs/AGENTS.md +8 -0
- package/templates/nestjs/CONTRIBUTING.md +57 -0
- package/templates/nestjs/Dockerfile +27 -0
- package/templates/nestjs/README.md +78 -0
- package/templates/nestjs/_gitignore +47 -0
- package/templates/nestjs/eslint.config.ts +7 -0
- package/templates/nestjs/nest-cli.json +8 -0
- package/templates/nestjs/package.json +81 -0
- package/templates/nestjs/src/app.controller.test.ts +23 -0
- package/templates/nestjs/src/app.controller.ts +13 -0
- package/templates/nestjs/src/app.module.ts +12 -0
- package/templates/nestjs/src/app.service.ts +10 -0
- package/templates/nestjs/src/health/health.controller.test.ts +17 -0
- package/templates/nestjs/src/health/health.controller.ts +14 -0
- package/templates/nestjs/src/health/health.module.ts +10 -0
- package/templates/nestjs/src/main.ts +25 -0
- package/templates/nestjs/src/port.test.ts +29 -0
- package/templates/nestjs/src/port.ts +20 -0
- package/templates/nestjs/test/app.e2e.test.ts +40 -0
- package/templates/nestjs/tsconfig.build.json +9 -0
- package/templates/nestjs/tsconfig.json +20 -0
- package/templates/nestjs/vitest.config.ts +13 -0
- package/templates/nestjs/vitest.e2e.config.ts +8 -0
- package/templates/nextjs/.agents/rules/typescript-first.md +7 -0
- package/templates/nextjs/.agents/rules.json +41 -0
- package/templates/nextjs/.claude/rules/deterministic-testing.md +21 -0
- package/templates/nextjs/.claude/rules/typescript-first.md +15 -0
- package/templates/nextjs/.cursor/rules/deterministic-testing.mdc +21 -0
- package/templates/nextjs/.cursor/rules/typescript-first.mdc +13 -0
- package/templates/nextjs/.dependency-cruiser.json +34 -0
- package/templates/nextjs/.dockerignore +10 -0
- package/templates/nextjs/.env.example +1 -0
- package/templates/nextjs/.github/ISSUE_TEMPLATE/bug.yml +66 -0
- package/templates/nextjs/.github/ISSUE_TEMPLATE/feature.yml +50 -0
- package/templates/nextjs/.github/pull_request_template.md +25 -0
- package/templates/nextjs/.github/workflows/ci.yml +187 -0
- package/templates/nextjs/.github/workflows/sast.yml +46 -0
- package/templates/nextjs/.lintstagedrc.json +10 -0
- package/templates/nextjs/.prettierignore +2 -0
- package/templates/nextjs/AGENTS.md +18 -0
- package/templates/nextjs/CONTRIBUTING.md +57 -0
- package/templates/nextjs/Dockerfile +23 -0
- package/templates/nextjs/README.md +74 -0
- package/templates/nextjs/_gitignore +51 -0
- package/templates/nextjs/app/favicon.ico +0 -0
- package/templates/nextjs/app/globals.css +26 -0
- package/templates/nextjs/app/health/route.test.ts +20 -0
- package/templates/nextjs/app/health/route.ts +23 -0
- package/templates/nextjs/app/layout.tsx +29 -0
- package/templates/nextjs/app/page.test.ts +11 -0
- package/templates/nextjs/app/page.tsx +8 -0
- package/templates/nextjs/eslint.config.ts +32 -0
- package/templates/nextjs/knip.json +4 -0
- package/templates/nextjs/next.config.ts +35 -0
- package/templates/nextjs/package.json +78 -0
- package/templates/nextjs/playwright.config.ts +27 -0
- package/templates/nextjs/postcss.config.mjs +7 -0
- package/templates/nextjs/prettier.config.ts +11 -0
- package/templates/nextjs/test/home.e2e.test.ts +11 -0
- package/templates/nextjs/tsconfig.json +33 -0
- package/templates/nextjs/vitest.config.ts +12 -0
- package/templates/nodejs/.agents/rules/typescript-first.md +7 -0
- package/templates/nodejs/.agents/rules.json +41 -0
- package/templates/nodejs/.claude/rules/deterministic-testing.md +20 -0
- package/templates/nodejs/.claude/rules/typescript-first.md +13 -0
- package/templates/nodejs/.cursor/rules/deterministic-testing.mdc +21 -0
- package/templates/nodejs/.cursor/rules/typescript-first.mdc +13 -0
- package/templates/nodejs/.dependency-cruiser.json +28 -0
- package/templates/nodejs/.dockerignore +8 -0
- package/templates/nodejs/.env.example +1 -0
- package/templates/nodejs/.github/ISSUE_TEMPLATE/bug.yml +66 -0
- package/templates/nodejs/.github/ISSUE_TEMPLATE/feature.yml +50 -0
- package/templates/nodejs/.github/pull_request_template.md +25 -0
- package/templates/nodejs/.github/workflows/ci.yml +179 -0
- package/templates/nodejs/.github/workflows/sast.yml +45 -0
- package/templates/nodejs/.lintstagedrc.json +10 -0
- package/templates/nodejs/.prettierignore +2 -0
- package/templates/nodejs/.prettierrc.json +1 -0
- package/templates/nodejs/AGENTS.md +8 -0
- package/templates/nodejs/CONTRIBUTING.md +56 -0
- package/templates/nodejs/Dockerfile +27 -0
- package/templates/nodejs/README.md +74 -0
- package/templates/nodejs/_gitignore +47 -0
- package/templates/nodejs/eslint.config.ts +7 -0
- package/templates/nodejs/package.json +66 -0
- package/templates/nodejs/src/main.ts +22 -0
- package/templates/nodejs/src/port.test.ts +30 -0
- package/templates/nodejs/src/port.ts +20 -0
- package/templates/nodejs/src/server.test.ts +60 -0
- package/templates/nodejs/src/server.ts +37 -0
- package/templates/nodejs/tsconfig.build.json +9 -0
- package/templates/nodejs/tsconfig.json +19 -0
- package/templates/nodejs/vitest.config.ts +12 -0
- package/templates/payload/.agents/rules/typescript-first.md +7 -0
- package/templates/payload/.agents/rules.json +41 -0
- package/templates/payload/.claude/rules/deterministic-testing.md +21 -0
- package/templates/payload/.claude/rules/typescript-first.md +15 -0
- package/templates/payload/.cursor/rules/deterministic-testing.mdc +21 -0
- package/templates/payload/.cursor/rules/typescript-first.mdc +13 -0
- package/templates/payload/.dependency-cruiser.json +34 -0
- package/templates/payload/.dockerignore +9 -0
- package/templates/payload/.editorconfig-checker.json +3 -0
- package/templates/payload/.env.example +4 -0
- package/templates/payload/.github/ISSUE_TEMPLATE/bug.yml +66 -0
- package/templates/payload/.github/ISSUE_TEMPLATE/feature.yml +50 -0
- package/templates/payload/.github/pull_request_template.md +25 -0
- package/templates/payload/.github/workflows/ci.yml +204 -0
- package/templates/payload/.github/workflows/sast.yml +46 -0
- package/templates/payload/.lintstagedrc.json +10 -0
- package/templates/payload/.prettierignore +5 -0
- package/templates/payload/.prettierrc.json +1 -0
- package/templates/payload/AGENTS.md +19 -0
- package/templates/payload/CONTRIBUTING.md +58 -0
- package/templates/payload/Dockerfile +26 -0
- package/templates/payload/README.md +98 -0
- package/templates/payload/_gitignore +52 -0
- package/templates/payload/eslint.config.ts +35 -0
- package/templates/payload/next.config.ts +43 -0
- package/templates/payload/package.json +86 -0
- package/templates/payload/playwright.config.ts +27 -0
- package/templates/payload/src/app/(frontend)/layout.tsx +18 -0
- package/templates/payload/src/app/(frontend)/page.test.ts +14 -0
- package/templates/payload/src/app/(frontend)/page.tsx +14 -0
- package/templates/payload/src/app/(frontend)/styles.css +15 -0
- package/templates/payload/src/app/(payload)/admin/[[...segments]]/not-found.tsx +24 -0
- package/templates/payload/src/app/(payload)/admin/[[...segments]]/page.tsx +24 -0
- package/templates/payload/src/app/(payload)/admin/importMap.ts +6 -0
- package/templates/payload/src/app/(payload)/api/[...slug]/route.ts +19 -0
- package/templates/payload/src/app/(payload)/api/graphql/route.ts +8 -0
- package/templates/payload/src/app/(payload)/api/graphql-playground/route.ts +7 -0
- package/templates/payload/src/app/(payload)/custom.scss +0 -0
- package/templates/payload/src/app/(payload)/layout.tsx +31 -0
- package/templates/payload/src/app/health/route.test.ts +20 -0
- package/templates/payload/src/app/health/route.ts +23 -0
- package/templates/payload/src/collections/media.test.ts +27 -0
- package/templates/payload/src/collections/media.ts +18 -0
- package/templates/payload/src/collections/users.test.ts +10 -0
- package/templates/payload/src/collections/users.ts +10 -0
- package/templates/payload/src/environment.test.ts +32 -0
- package/templates/payload/src/environment.ts +14 -0
- package/templates/payload/src/migrations/20261030_005055_initial.json +969 -0
- package/templates/payload/src/migrations/20261030_005055_initial.ts +134 -0
- package/templates/payload/src/migrations/index.ts +9 -0
- package/templates/payload/src/payload-types.ts +339 -0
- package/templates/payload/src/payload.config.ts +47 -0
- package/templates/payload/test/home.e2e.test.ts +16 -0
- package/templates/payload/tsconfig.json +34 -0
- package/templates/payload/vitest.config.ts +19 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"@next-friday/prettier-config-friday"
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Agent guide
|
|
2
|
+
|
|
3
|
+
Payload CMS on Next.js App Router and PostgreSQL, on pnpm. Source lives in `src/`: the site in `src/app/(frontend)/`, collections in `src/collections/`, and the Payload config in `src/payload.config.ts`.
|
|
4
|
+
|
|
5
|
+
- Follow the rules in `.agents/rules/`; `.agents/rules.json` gives each rule's scope. Claude Code and Cursor load them automatically.
|
|
6
|
+
- Rule files, agent hooks, and agent settings are company policy: propose a change to the user, who edits them.
|
|
7
|
+
- Put unit tests next to the code as `*.test.ts`; put Playwright end-to-end tests in `test/` as `*.e2e.test.ts`. Component tests need a DOM test environment, which is not set up yet; ask the user before adding one.
|
|
8
|
+
- Payload generates `src/app/(payload)/`, `src/payload-types.ts`, and `src/migrations/`. After changing a collection, regenerate them with `pnpm generate:types`, `pnpm generate:importmap`, and `pnpm migrate:create <name>`, and commit the results.
|
|
9
|
+
- Read configuration through `requireEnvironment` in `src/environment.ts`; document each variable in `.env.example`.
|
|
10
|
+
|
|
11
|
+
<!-- BEGIN:nextjs-agent-rules -->
|
|
12
|
+
|
|
13
|
+
## This is NOT the Next.js you know
|
|
14
|
+
|
|
15
|
+
This version has breaking changes — APIs, conventions, and file structure may all differ from your training data. Read the relevant guide in `node_modules/next/dist/docs/` (resolved from this file's directory; in monorepos the `next` package may not be visible from the repo root) before writing any code. Heed deprecation notices.
|
|
16
|
+
|
|
17
|
+
This block is written and re-added by `next dev` — verify at `node_modules/next/dist/server/lib/generate-agent-files.js`. Removing it from a diff only re-creates the uncommitted change; committing it with your work keeps the tree clean.
|
|
18
|
+
|
|
19
|
+
<!-- END:nextjs-agent-rules -->
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# Contributing
|
|
2
|
+
|
|
3
|
+
Use this guide to prepare changes to this repository.
|
|
4
|
+
|
|
5
|
+
## Prerequisites
|
|
6
|
+
|
|
7
|
+
- Use the Node.js version declared by `.nvmrc` and `package.json#engines`.
|
|
8
|
+
- Change the Node.js version in `.nvmrc` and the `Dockerfile` together. Dependabot updates only the `Dockerfile`.
|
|
9
|
+
- Install pnpm once with `npm install --global pnpm`. It switches to the version declared by `package.json#packageManager` automatically.
|
|
10
|
+
- Use Claude Code v2.1.295 or later. It reads `AGENTS.md` directly and supports the `onFailure` field the agent hooks use.
|
|
11
|
+
- Install gitleaks 8.19 or later, which the `pre-commit` hook runs, and jq, which the agent hooks and the `pre-push` hook (`pnpm gates:check`) need: `brew install gitleaks jq` on macOS, or install them from each project's releases on Linux.
|
|
12
|
+
|
|
13
|
+
From the repository root:
|
|
14
|
+
|
|
15
|
+
```sh
|
|
16
|
+
npm install --global pnpm
|
|
17
|
+
pnpm install
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Quality standards
|
|
21
|
+
|
|
22
|
+
- Fix lint, type, and test failures at their root cause.
|
|
23
|
+
- Put unit tests next to the code as `*.test.ts` and Playwright end-to-end tests in `test/` as `*.e2e.test.ts`.
|
|
24
|
+
- Change the database schema only through collections, then run `pnpm generate:types`, `pnpm generate:importmap`, and `pnpm migrate:create <name>` and commit the generated files. Production applies pending migrations when the server starts.
|
|
25
|
+
- Treat `coverage/` as generated output.
|
|
26
|
+
- Do not commit `.env` files or credentials.
|
|
27
|
+
|
|
28
|
+
## Verification
|
|
29
|
+
|
|
30
|
+
Run the narrowest check that covers the change while you work. Git hooks run these checks:
|
|
31
|
+
|
|
32
|
+
| Hook | Checks |
|
|
33
|
+
| :----------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
34
|
+
| `pre-commit` | blocks commits on `main` except the first commit of a new repository, gitleaks on staged changes, `pnpm rules:check`, and lint-staged on staged files |
|
|
35
|
+
| `commit-msg` | commitlint |
|
|
36
|
+
| `pre-merge-commit` | blocks merge commits on `main` |
|
|
37
|
+
| `pre-push` | blocks pushes to `main` except the push that creates it, then `pnpm check`: the static checks and the unit tests related to your changes |
|
|
38
|
+
|
|
39
|
+
- **Scans:** CI also runs coverage, the build, the container image, and the secret, SAST, and OSV scans. Dependabot and OSV-Scanner report vulnerable dependencies.
|
|
40
|
+
- **End-to-end tests:** run `pnpm test:e2e` when you change pages or the admin panel. It starts the development server unless one is already running, and needs `DATABASE_URL` and `PAYLOAD_SECRET` from `.env`. Run `pnpm exec playwright install chromium` once before the first run. CI runs it against the production build and a PostgreSQL service on every pull request that is ready for review and changes code.
|
|
41
|
+
- **Coverage:** CI requires 95% branch coverage on changed lines in `src/`, except layouts, the Payload config, and generated files.
|
|
42
|
+
|
|
43
|
+
Run `pnpm verify` for repository changes.
|
|
44
|
+
|
|
45
|
+
Agent rules live in `.agents/rules/` with their scope in `.agents/rules.json`. After you change either, run `pnpm rules:sync` to regenerate `.claude/rules/` and `.cursor/rules/`.
|
|
46
|
+
|
|
47
|
+
## Pull requests
|
|
48
|
+
|
|
49
|
+
We use trunk-based development. `main` is the only long-lived branch, and every deploy promotes a commit from `main` (see the Deploy section in the README).
|
|
50
|
+
|
|
51
|
+
- Branch from `main` and merge back within a day or two. Do not create `develop` or release branches.
|
|
52
|
+
- Merge unfinished work behind a feature flag or keep it unreachable instead of holding a long-lived branch.
|
|
53
|
+
- Pull requests are squash-merged, so the pull request title becomes the commit on `main`.
|
|
54
|
+
- Write commit messages in the format that `@next-friday/commitlint-config-friday` defines. Pull request titles use `<type>(<scope>): <subject>`, which `.github/workflows/validate-pr-title.yml` checks.
|
|
55
|
+
- Keep each pull request focused on one cohesive change.
|
|
56
|
+
- Describe observable page, collection, API, or configuration effects.
|
|
57
|
+
- Report only checks that actually ran and include their results.
|
|
58
|
+
- Add or update tests only when they protect a distinct observable contract.
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# Runs on any OCI platform (Railway, Fly.io, Cloud Run). On Vercel, deploy without it. The platform sets `PORT`.
|
|
2
|
+
FROM node:24.22.1-alpine@sha256:06d7adf3e0ef61a13f1d28682726366f97a15aa1888c934d3ecec86c33918b53 AS build
|
|
3
|
+
ENV NEXT_TELEMETRY_DISABLED=1
|
|
4
|
+
WORKDIR /app
|
|
5
|
+
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
|
|
6
|
+
RUN npm install --global "pnpm@$(node --print 'require("./package.json").packageManager.split("+")[0].split("@")[1]')"
|
|
7
|
+
RUN pnpm install --frozen-lockfile --ignore-scripts
|
|
8
|
+
COPY next.config.ts tsconfig.json ./
|
|
9
|
+
COPY src ./src
|
|
10
|
+
# `next build` loads the Payload config, which requires these variables. The values are placeholders for the build only;
|
|
11
|
+
# the platform sets the real ones at runtime, and the build never connects to the database.
|
|
12
|
+
RUN PAYLOAD_SECRET=build-only DATABASE_URL=postgres://build-only@localhost/build-only APP_URL=http://localhost:3000 pnpm build
|
|
13
|
+
|
|
14
|
+
FROM node:24.22.1-alpine@sha256:06d7adf3e0ef61a13f1d28682726366f97a15aa1888c934d3ecec86c33918b53
|
|
15
|
+
ENV NODE_ENV=production NEXT_TELEMETRY_DISABLED=1 HOSTNAME=0.0.0.0
|
|
16
|
+
WORKDIR /app
|
|
17
|
+
# Apply Alpine security fixes released after the base image, and drop npm, corepack, and yarn: the app never runs them, and their bundled dependencies carry their own CVEs.
|
|
18
|
+
RUN apk upgrade --no-cache \
|
|
19
|
+
&& rm -rf /usr/local/lib/node_modules /usr/local/bin/npm /usr/local/bin/npx /usr/local/bin/corepack /usr/local/bin/yarn /usr/local/bin/yarnpkg /opt/yarn-* \
|
|
20
|
+
&& install -d -o node -g node media
|
|
21
|
+
# Next.js writes .next/cache at runtime. Add `COPY --from=build --chown=node:node /app/public ./public` when the app has a public/ folder, and allow it in .dockerignore. Uploads go to the container filesystem, which is lost on redeploy; use a storage adapter or a mounted volume in production.
|
|
22
|
+
COPY --from=build --chown=node:node /app/.next/standalone ./
|
|
23
|
+
COPY --from=build --chown=node:node /app/.next/static ./.next/static
|
|
24
|
+
USER 1000
|
|
25
|
+
HEALTHCHECK --interval=30s --timeout=5s CMD ["node", "-e", "fetch('http://127.0.0.1:' + (process.env.PORT || 3000) + '/health').then(response => process.exit(response.ok ? 0 : 1), () => process.exit(1))"]
|
|
26
|
+
CMD ["node", "server.js"]
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
# next-friday-template-payload
|
|
2
|
+
|
|
3
|
+
Next Friday starter for Payload CMS on Next.js and PostgreSQL.
|
|
4
|
+
|
|
5
|
+
## Getting started
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
npm install --global pnpm
|
|
9
|
+
pnpm install
|
|
10
|
+
pnpm dev
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
The CLI created `.env` from `.env.example` and set `PAYLOAD_SECRET` to a random secret. Before `pnpm dev`, set in `.env`:
|
|
14
|
+
|
|
15
|
+
- `DATABASE_URL`: a PostgreSQL database.
|
|
16
|
+
- `APP_URL`: the URL you open the app at, such as `http://localhost:3000`.
|
|
17
|
+
- `PAYLOAD_SECRET`, only if you recreate `.env` from `.env.example`: generate one with `openssl rand -hex 32`.
|
|
18
|
+
|
|
19
|
+
Then open `http://localhost:3000/admin` to create the first user.
|
|
20
|
+
|
|
21
|
+
**Warning:** until the first user exists, anyone who can reach `/admin` can create it. Create the first user in each deployed environment right after its first deploy, before you share the URL.
|
|
22
|
+
|
|
23
|
+
In development, Payload applies collection changes to the database directly. In production, the server applies the migrations in `src/migrations/` when it starts.
|
|
24
|
+
|
|
25
|
+
## After creating a project from this template
|
|
26
|
+
|
|
27
|
+
1. Install gitleaks and jq (see [CONTRIBUTING.md](CONTRIBUTING.md)). Make the first commit on `main` and push it. The Git hooks allow only this first commit and push on `main`; work on branches after that.
|
|
28
|
+
|
|
29
|
+
```sh
|
|
30
|
+
git add --all
|
|
31
|
+
git commit -m "chore(repo): start from template"
|
|
32
|
+
git push --set-upstream origin main
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
2. Add your team as the owner of every file in `.github/CODEOWNERS`, and replace the owner placeholder in `.github/zizmor.yml`.
|
|
36
|
+
3. Replace the template's description and owner: `package.json#description`, `repository.url`, and `author`, and the `Next Friday Payload template` text in `src/app/(frontend)/layout.tsx`, `src/app/(frontend)/page.tsx`, and their tests. Change `license` from `UNLICENSED` if the project is open source.
|
|
37
|
+
4. In the repository settings:
|
|
38
|
+
- **Actions → General → Workflow permissions:** select **Read repository contents and packages permissions**. Every workflow requests the extra permissions it needs.
|
|
39
|
+
- **Advanced Security:** enable private vulnerability reporting, Dependabot alerts, Dependabot security updates, secret scanning, and push protection. `SECURITY.md` sends reporters to private vulnerability reporting.
|
|
40
|
+
- **Cursor Bugbot:** enable the repository at [Bugbot](https://cursor.com/automations/from-cursor/bugbot). Bugbot reviews pull requests against the rules linked from `.cursor/BUGBOT.md`.
|
|
41
|
+
- **Rules → Rulesets:** protect `main` with squash merges only, a linear history, no force pushes or deletion, and the required checks `All Checks` and `Validate pull request title`. Rulesets in a private repository need GitHub Pro, Team, or Enterprise; on GitHub Free, make the repository public or upgrade.
|
|
42
|
+
- Create the `needs triage` label, which the issue forms apply: `gh label create "needs triage"`.
|
|
43
|
+
|
|
44
|
+
## Scripts
|
|
45
|
+
|
|
46
|
+
| Script | Purpose |
|
|
47
|
+
| :------------------------ | :---------------------------------------------------------------------------------------------------------------- |
|
|
48
|
+
| `pnpm dev` | Start the development server |
|
|
49
|
+
| `pnpm build` | Build for production |
|
|
50
|
+
| `pnpm start` | Serve the standalone production build after `pnpm build`. The build copies `.env`, so rebuild after you change it |
|
|
51
|
+
| `pnpm test` | Run unit tests |
|
|
52
|
+
| `pnpm test:e2e` | Run Playwright end-to-end tests (`test/**/*.e2e.test.ts`) against the database in `DATABASE_URL` |
|
|
53
|
+
| `pnpm generate:types` | Regenerate `src/payload-types.ts` after a collection change |
|
|
54
|
+
| `pnpm generate:importmap` | Regenerate the admin import map after adding a custom component |
|
|
55
|
+
| `pnpm migrate:create` | Create a migration from collection changes, for example `pnpm migrate:create add-posts` |
|
|
56
|
+
| `pnpm migrate` | Apply pending migrations to the database in `DATABASE_URL` |
|
|
57
|
+
| `pnpm check` | Run the static checks and the unit tests for changed code (the `pre-push` hook) |
|
|
58
|
+
| `pnpm verify` | Run the static checks and all unit tests with coverage |
|
|
59
|
+
|
|
60
|
+
CI also runs the build, the end-to-end tests, the container image scan, and the security scans.
|
|
61
|
+
|
|
62
|
+
## Container
|
|
63
|
+
|
|
64
|
+
The `Dockerfile` builds a standalone production image that runs as the `node` user, for platforms such as Railway. The server listens on `PORT`, or 3000 when it is unset, and needs `DATABASE_URL`, `PAYLOAD_SECRET`, and `APP_URL`, the public URL that Payload accepts cookie-authenticated and cross-origin requests from.
|
|
65
|
+
|
|
66
|
+
```sh
|
|
67
|
+
docker build -t app .
|
|
68
|
+
docker run --publish 3000:3000 --env DATABASE_URL --env PAYLOAD_SECRET --env APP_URL app
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Uploaded images, up to 10 MB each, are written to the container filesystem, which a redeploy discards. Add a Payload storage adapter, for example `@payloadcms/storage-s3`, before storing media in production.
|
|
72
|
+
|
|
73
|
+
On Vercel, deploy without the image; the Next.js preset takes precedence over the `Dockerfile`.
|
|
74
|
+
|
|
75
|
+
## Deploy
|
|
76
|
+
|
|
77
|
+
`.github/workflows/deploy.yml` deploys the `Dockerfile` to Railway and promotes one commit through `dev`, `uat`, and `prod`. `railway.json` sets the Railway health check to `/health`. The workflow stays off until you configure it:
|
|
78
|
+
|
|
79
|
+
1. In Railway, create a project with one service for this repository, one PostgreSQL database, and the environments `dev`, `uat`, and `prod`. The workflow passes these names to `railway up --environment`. In each environment, set the service variables:
|
|
80
|
+
- `DATABASE_URL` to `${{Postgres.DATABASE_URL}}`;
|
|
81
|
+
- `PAYLOAD_SECRET` to a separate long random string;
|
|
82
|
+
- `APP_URL` to that environment's public `https://` URL.
|
|
83
|
+
|
|
84
|
+
Create one project token per environment under **Project Settings → Tokens**. CI tests against PostgreSQL 17; change the image in `ci.yml` if the database runs another major version.
|
|
85
|
+
|
|
86
|
+
2. In GitHub, create the `dev`, `uat`, and `prod` environments under **Settings → Environments**, and add to each:
|
|
87
|
+
- the `RAILWAY_TOKEN` secret: that environment's project token;
|
|
88
|
+
- the `RAILWAY_SERVICE` variable: the service name;
|
|
89
|
+
- the `APP_URL` variable: the public `https://` URL.
|
|
90
|
+
|
|
91
|
+
Limit `prod` to the `main` branch and add required reviewers. Environment secrets and variables in a private repository need GitHub Pro, Team, or Enterprise; required reviewers in a private repository need GitHub Enterprise.
|
|
92
|
+
|
|
93
|
+
3. Set the repository variable `DEPLOY_ENABLED` to `true`. Each push to `main` that passes CI then deploys to `dev`.
|
|
94
|
+
4. Promote with **Actions → Deploy → Run workflow**, giving the environment and the full commit SHA. The workflow requires a successful CI run on `main` for that commit and a successful deployment to the previous environment, then waits for `/health`.
|
|
95
|
+
|
|
96
|
+
Remove the workflow, `railway.json`, and the `deploy-dev` job in `ci.yml` if the project deploys elsewhere.
|
|
97
|
+
|
|
98
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md) for the contribution workflow.
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
node_modules
|
|
2
|
+
.pnpm-store
|
|
3
|
+
|
|
4
|
+
coverage
|
|
5
|
+
playwright-report
|
|
6
|
+
test-results
|
|
7
|
+
*.tsbuildinfo
|
|
8
|
+
|
|
9
|
+
.cache
|
|
10
|
+
|
|
11
|
+
*.pem
|
|
12
|
+
|
|
13
|
+
npm-debug.log*
|
|
14
|
+
pnpm-debug.log*
|
|
15
|
+
*.log
|
|
16
|
+
|
|
17
|
+
**/.env*
|
|
18
|
+
!.env.example
|
|
19
|
+
|
|
20
|
+
.eslintcache
|
|
21
|
+
|
|
22
|
+
.vscode/*
|
|
23
|
+
!.vscode/settings.json
|
|
24
|
+
!.vscode/extensions.json
|
|
25
|
+
/.idea
|
|
26
|
+
|
|
27
|
+
logs
|
|
28
|
+
.temp
|
|
29
|
+
.tmp
|
|
30
|
+
|
|
31
|
+
.DS_Store
|
|
32
|
+
.DS_Store?
|
|
33
|
+
._*
|
|
34
|
+
.Spotlight-V100
|
|
35
|
+
.Trashes
|
|
36
|
+
ehthumbs.db
|
|
37
|
+
Thumbs.db
|
|
38
|
+
**/.DS_Store
|
|
39
|
+
|
|
40
|
+
*.key
|
|
41
|
+
*.p12
|
|
42
|
+
*.pfx
|
|
43
|
+
id_rsa*
|
|
44
|
+
id_ed25519*
|
|
45
|
+
|
|
46
|
+
/.claude/settings.local.json
|
|
47
|
+
/.claude/worktrees/
|
|
48
|
+
|
|
49
|
+
/.next
|
|
50
|
+
/media
|
|
51
|
+
/out
|
|
52
|
+
next-env.d.ts
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import {defineConfig, globalIgnores} from "eslint/config";
|
|
2
|
+
import friday from "@next-friday/eslint-config-friday";
|
|
3
|
+
import nextPlugin, {configs as nextConfigs} from "@next/eslint-plugin-next";
|
|
4
|
+
|
|
5
|
+
export default defineConfig(
|
|
6
|
+
globalIgnores([
|
|
7
|
+
".agents/**",
|
|
8
|
+
".claude/**",
|
|
9
|
+
".cursor/**",
|
|
10
|
+
".next/**",
|
|
11
|
+
"out/**",
|
|
12
|
+
"next-env.d.ts",
|
|
13
|
+
"coverage/**",
|
|
14
|
+
"playwright-report/**",
|
|
15
|
+
"test-results/**",
|
|
16
|
+
"src/app/(payload)/**",
|
|
17
|
+
"src/migrations/**",
|
|
18
|
+
"src/payload-types.ts",
|
|
19
|
+
]),
|
|
20
|
+
friday({
|
|
21
|
+
react: true,
|
|
22
|
+
}),
|
|
23
|
+
{
|
|
24
|
+
plugins: {
|
|
25
|
+
"@next/next": nextPlugin,
|
|
26
|
+
},
|
|
27
|
+
rules: nextConfigs["core-web-vitals"].rules,
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
rules: {
|
|
31
|
+
"friday/component-module": "off",
|
|
32
|
+
},
|
|
33
|
+
files: ["src/app/**/{page,layout}.tsx"],
|
|
34
|
+
},
|
|
35
|
+
);
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import {withPayload} from "@payloadcms/next/withPayload";
|
|
2
|
+
import type {NextConfig} from "next";
|
|
3
|
+
|
|
4
|
+
const nextConfig: NextConfig = {
|
|
5
|
+
output: "standalone",
|
|
6
|
+
poweredByHeader: false,
|
|
7
|
+
images: {
|
|
8
|
+
localPatterns: [
|
|
9
|
+
{
|
|
10
|
+
pathname: "/api/media/file/**",
|
|
11
|
+
},
|
|
12
|
+
],
|
|
13
|
+
},
|
|
14
|
+
async headers() {
|
|
15
|
+
return [
|
|
16
|
+
{
|
|
17
|
+
source: "/:path*",
|
|
18
|
+
headers: [
|
|
19
|
+
{
|
|
20
|
+
key: "Strict-Transport-Security",
|
|
21
|
+
value: "max-age=63072000; includeSubDomains",
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
key: "X-Content-Type-Options",
|
|
25
|
+
value: "nosniff",
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
key: "X-Frame-Options",
|
|
29
|
+
value: "SAMEORIGIN",
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
key: "Referrer-Policy",
|
|
33
|
+
value: "strict-origin-when-cross-origin",
|
|
34
|
+
},
|
|
35
|
+
],
|
|
36
|
+
},
|
|
37
|
+
];
|
|
38
|
+
},
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export default withPayload(nextConfig, {
|
|
42
|
+
devBundleServerPackages: false,
|
|
43
|
+
});
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "next-friday-template-payload",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"private": true,
|
|
5
|
+
"description": "Next Friday Payload CMS template.",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/next-friday/next-friday-template-payload.git"
|
|
9
|
+
},
|
|
10
|
+
"license": "UNLICENSED",
|
|
11
|
+
"author": "Next Friday",
|
|
12
|
+
"type": "module",
|
|
13
|
+
"scripts": {
|
|
14
|
+
"build": "next build",
|
|
15
|
+
"check": "pnpm verify:static && pnpm test:changed",
|
|
16
|
+
"clean": "rm -rf .next coverage *.tsbuildinfo .eslintcache node_modules/.cache",
|
|
17
|
+
"depcruise": "depcruise --config .dependency-cruiser.json src test eslint.config.ts next.config.ts playwright.config.ts vitest.config.ts",
|
|
18
|
+
"dev": "next dev",
|
|
19
|
+
"format": "prettier --write --cache .",
|
|
20
|
+
"format:check": "prettier --check --cache . && editorconfig-checker",
|
|
21
|
+
"gates:check": "node scripts/check-agent-gates.ts",
|
|
22
|
+
"generate:importmap": "payload generate:importmap",
|
|
23
|
+
"generate:types": "payload generate:types",
|
|
24
|
+
"knip": "node --env-file-if-exists=.env node_modules/knip/bin/knip.js",
|
|
25
|
+
"lint": "eslint . --fix --cache --max-warnings=0 --no-inline-config",
|
|
26
|
+
"lint:check": "eslint . --cache --max-warnings=0 --no-inline-config",
|
|
27
|
+
"migrate": "payload migrate",
|
|
28
|
+
"migrate:create": "payload migrate:create",
|
|
29
|
+
"payload": "payload",
|
|
30
|
+
"peers:check": "pnpm peers check",
|
|
31
|
+
"prepare": "husky && next typegen",
|
|
32
|
+
"rules:check": "node scripts/sync-agent-rules.ts --check",
|
|
33
|
+
"rules:sync": "node scripts/sync-agent-rules.ts",
|
|
34
|
+
"sort-package-json": "sort-package-json package.json",
|
|
35
|
+
"sort-package-json:check": "sort-package-json --check package.json",
|
|
36
|
+
"start": "cp -R .next/static .next/standalone/.next/ && (test ! -d public || cp -R public .next/standalone/) && node .next/standalone/server.js",
|
|
37
|
+
"suppressions:check": "bash .agents/hooks/agent-suppression-gate.sh --repo",
|
|
38
|
+
"test": "vitest run --passWithNoTests",
|
|
39
|
+
"test:changed": "if git rev-parse --quiet --verify origin/main > /dev/null && git diff --quiet \"$(git merge-base origin/main HEAD)\" -- pnpm-lock.yaml pnpm-workspace.yaml \"*package.json\" \"*tsconfig.json\" .husky; then vitest run --changed origin/main --passWithNoTests; else vitest run --passWithNoTests; fi",
|
|
40
|
+
"test:coverage": "vitest run --coverage --passWithNoTests",
|
|
41
|
+
"test:e2e": "playwright test",
|
|
42
|
+
"test:watch": "vitest",
|
|
43
|
+
"typecheck": "next typegen && tsc --noEmit -p tsconfig.json",
|
|
44
|
+
"verify": "pnpm verify:static && pnpm test:coverage",
|
|
45
|
+
"verify:static": "pnpm suppressions:check && pnpm rules:check && pnpm gates:check && pnpm lint:check && pnpm format:check && pnpm sort-package-json:check && pnpm peers:check && pnpm typecheck && pnpm knip && pnpm depcruise"
|
|
46
|
+
},
|
|
47
|
+
"dependencies": {
|
|
48
|
+
"@payloadcms/db-postgres": "3.92.1",
|
|
49
|
+
"@payloadcms/next": "3.92.1",
|
|
50
|
+
"@payloadcms/richtext-lexical": "3.92.1",
|
|
51
|
+
"graphql": "16.14.2",
|
|
52
|
+
"next": "16.4.3",
|
|
53
|
+
"payload": "3.92.1",
|
|
54
|
+
"react": "19.3.1",
|
|
55
|
+
"react-dom": "19.3.1",
|
|
56
|
+
"sharp": "0.35.5"
|
|
57
|
+
},
|
|
58
|
+
"devDependencies": {
|
|
59
|
+
"@commitlint/cli": "21.2.4",
|
|
60
|
+
"@next-friday/commitlint-config-friday": "4.0.0",
|
|
61
|
+
"@next-friday/eslint-config-friday": "5.0.0",
|
|
62
|
+
"@next-friday/prettier-config-friday": "4.0.0",
|
|
63
|
+
"@next/eslint-plugin-next": "16.4.3",
|
|
64
|
+
"@playwright/test": "1.64.1",
|
|
65
|
+
"@types/node": "24.19.2",
|
|
66
|
+
"@types/react": "19.3.0",
|
|
67
|
+
"@types/react-dom": "19.3.0",
|
|
68
|
+
"@vitest/coverage-v8": "5.0.5",
|
|
69
|
+
"dependency-cruiser": "18.7.0",
|
|
70
|
+
"editorconfig-checker": "7.0.0",
|
|
71
|
+
"eslint": "10.13.0",
|
|
72
|
+
"fast-check": "4.10.2",
|
|
73
|
+
"husky": "9.1.7",
|
|
74
|
+
"jiti": "2.7.0",
|
|
75
|
+
"knip": "6.43.0",
|
|
76
|
+
"lint-staged": "17.6.0",
|
|
77
|
+
"prettier": "3.9.10",
|
|
78
|
+
"sort-package-json": "4.1.0",
|
|
79
|
+
"typescript": "6.0.3",
|
|
80
|
+
"vitest": "5.0.5"
|
|
81
|
+
},
|
|
82
|
+
"packageManager": "pnpm@12.6.0+sha512.3ef68f951cb111ac204b4a5a16f0b2ddf0da56a96e0413e81d855d9f0b55ef926714709028e1cd00c405c2c5fb7b9e8ec4dc46777c805d0373c2f2ff00fd20ec",
|
|
83
|
+
"engines": {
|
|
84
|
+
"node": ">=24.22.1 <25"
|
|
85
|
+
}
|
|
86
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import {defineConfig, devices} from "@playwright/test";
|
|
2
|
+
|
|
3
|
+
const isCi = Boolean(process.env.CI);
|
|
4
|
+
|
|
5
|
+
export default defineConfig({
|
|
6
|
+
forbidOnly: isCi,
|
|
7
|
+
testDir: "test",
|
|
8
|
+
projects: [
|
|
9
|
+
{
|
|
10
|
+
name: "chromium",
|
|
11
|
+
use: devices["Desktop Chrome"],
|
|
12
|
+
},
|
|
13
|
+
],
|
|
14
|
+
use: {
|
|
15
|
+
baseURL: "http://localhost:3000",
|
|
16
|
+
trace: "on-first-retry",
|
|
17
|
+
},
|
|
18
|
+
webServer: {
|
|
19
|
+
url: "http://localhost:3000",
|
|
20
|
+
command: isCi
|
|
21
|
+
? "cp -R .next/static .next/standalone/.next/ && (test ! -d public || cp -R public .next/standalone/) && node .next/standalone/server.js"
|
|
22
|
+
: "next dev",
|
|
23
|
+
reuseExistingServer: !isCi,
|
|
24
|
+
},
|
|
25
|
+
reporter: isCi ? "github" : "list",
|
|
26
|
+
retries: isCi ? 2 : 0,
|
|
27
|
+
});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type {Metadata} from "next";
|
|
2
|
+
|
|
3
|
+
import "./styles.css";
|
|
4
|
+
|
|
5
|
+
export const metadata: Metadata = {
|
|
6
|
+
title: "Next Friday Payload template",
|
|
7
|
+
description: "Starter application for Next Friday Payload projects.",
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export default function RootLayout(props: LayoutProps<"/">) {
|
|
11
|
+
const {children} = props;
|
|
12
|
+
|
|
13
|
+
return (
|
|
14
|
+
<html lang="en">
|
|
15
|
+
<body>{children}</body>
|
|
16
|
+
</html>
|
|
17
|
+
);
|
|
18
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import {createElement} from "react";
|
|
2
|
+
import {describe, expect, it} from "vitest";
|
|
3
|
+
import {renderToStaticMarkup} from "react-dom/server";
|
|
4
|
+
|
|
5
|
+
import Page from "./page";
|
|
6
|
+
|
|
7
|
+
describe("Page", () => {
|
|
8
|
+
it("renders the template heading and the admin link", () => {
|
|
9
|
+
const html = renderToStaticMarkup(createElement(Page));
|
|
10
|
+
|
|
11
|
+
expect(html).toContain("Next Friday Payload template");
|
|
12
|
+
expect(html).toContain('href="/admin"');
|
|
13
|
+
});
|
|
14
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import Link from "next/link";
|
|
2
|
+
|
|
3
|
+
export default function Page() {
|
|
4
|
+
return (
|
|
5
|
+
<main>
|
|
6
|
+
<h1>Next Friday Payload template</h1>
|
|
7
|
+
|
|
8
|
+
<p>
|
|
9
|
+
Edit <code>src/app/(frontend)/page.tsx</code> to get started, or open the{" "}
|
|
10
|
+
<Link href="/admin">admin panel</Link>.
|
|
11
|
+
</p>
|
|
12
|
+
</main>
|
|
13
|
+
);
|
|
14
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
font-family: system-ui, sans-serif;
|
|
3
|
+
color-scheme: light dark;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
main {
|
|
7
|
+
display: flex;
|
|
8
|
+
flex-direction: column;
|
|
9
|
+
gap: 1rem;
|
|
10
|
+
align-items: center;
|
|
11
|
+
justify-content: center;
|
|
12
|
+
min-height: 100vh;
|
|
13
|
+
padding: 4rem;
|
|
14
|
+
text-align: center;
|
|
15
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/* THIS FILE WAS GENERATED AUTOMATICALLY BY PAYLOAD. */
|
|
2
|
+
/* DO NOT MODIFY IT BECAUSE IT COULD BE REWRITTEN AT ANY TIME. */
|
|
3
|
+
import type { Metadata } from 'next'
|
|
4
|
+
|
|
5
|
+
import config from '@payload-config'
|
|
6
|
+
import { NotFoundPage, generatePageMetadata } from '@payloadcms/next/views'
|
|
7
|
+
import { importMap } from '../importMap'
|
|
8
|
+
|
|
9
|
+
type Args = {
|
|
10
|
+
params: Promise<{
|
|
11
|
+
segments: string[]
|
|
12
|
+
}>
|
|
13
|
+
searchParams: Promise<{
|
|
14
|
+
[key: string]: string | string[]
|
|
15
|
+
}>
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export const generateMetadata = ({ params, searchParams }: Args): Promise<Metadata> =>
|
|
19
|
+
generatePageMetadata({ config, params, searchParams })
|
|
20
|
+
|
|
21
|
+
const NotFound = ({ params, searchParams }: Args) =>
|
|
22
|
+
NotFoundPage({ config, params, searchParams, importMap })
|
|
23
|
+
|
|
24
|
+
export default NotFound
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/* THIS FILE WAS GENERATED AUTOMATICALLY BY PAYLOAD. */
|
|
2
|
+
/* DO NOT MODIFY IT BECAUSE IT COULD BE REWRITTEN AT ANY TIME. */
|
|
3
|
+
import type { Metadata } from 'next'
|
|
4
|
+
|
|
5
|
+
import config from '@payload-config'
|
|
6
|
+
import { RootPage, generatePageMetadata } from '@payloadcms/next/views'
|
|
7
|
+
import { importMap } from '../importMap'
|
|
8
|
+
|
|
9
|
+
type Args = {
|
|
10
|
+
params: Promise<{
|
|
11
|
+
segments: string[]
|
|
12
|
+
}>
|
|
13
|
+
searchParams: Promise<{
|
|
14
|
+
[key: string]: string | string[]
|
|
15
|
+
}>
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export const generateMetadata = ({ params, searchParams }: Args): Promise<Metadata> =>
|
|
19
|
+
generatePageMetadata({ config, params, searchParams })
|
|
20
|
+
|
|
21
|
+
const Page = ({ params, searchParams }: Args) =>
|
|
22
|
+
RootPage({ config, params, searchParams, importMap })
|
|
23
|
+
|
|
24
|
+
export default Page
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { CollectionCards as CollectionCards_f9c02e79a4aed9a3924487c0cd4cafb1 } from '@payloadcms/next/rsc'
|
|
2
|
+
|
|
3
|
+
/** @type import('payload').ImportMap */
|
|
4
|
+
export const importMap = {
|
|
5
|
+
"@payloadcms/next/rsc#CollectionCards": CollectionCards_f9c02e79a4aed9a3924487c0cd4cafb1
|
|
6
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/* THIS FILE WAS GENERATED AUTOMATICALLY BY PAYLOAD. */
|
|
2
|
+
/* DO NOT MODIFY IT BECAUSE IT COULD BE REWRITTEN AT ANY TIME. */
|
|
3
|
+
import config from '@payload-config'
|
|
4
|
+
import '@payloadcms/next/css'
|
|
5
|
+
import {
|
|
6
|
+
REST_DELETE,
|
|
7
|
+
REST_GET,
|
|
8
|
+
REST_OPTIONS,
|
|
9
|
+
REST_PATCH,
|
|
10
|
+
REST_POST,
|
|
11
|
+
REST_PUT,
|
|
12
|
+
} from '@payloadcms/next/routes'
|
|
13
|
+
|
|
14
|
+
export const GET = REST_GET(config)
|
|
15
|
+
export const POST = REST_POST(config)
|
|
16
|
+
export const DELETE = REST_DELETE(config)
|
|
17
|
+
export const PATCH = REST_PATCH(config)
|
|
18
|
+
export const PUT = REST_PUT(config)
|
|
19
|
+
export const OPTIONS = REST_OPTIONS(config)
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/* THIS FILE WAS GENERATED AUTOMATICALLY BY PAYLOAD. */
|
|
2
|
+
/* DO NOT MODIFY IT BECAUSE IT COULD BE REWRITTEN AT ANY TIME. */
|
|
3
|
+
import config from '@payload-config'
|
|
4
|
+
import { GRAPHQL_POST, REST_OPTIONS } from '@payloadcms/next/routes'
|
|
5
|
+
|
|
6
|
+
export const POST = GRAPHQL_POST(config)
|
|
7
|
+
|
|
8
|
+
export const OPTIONS = REST_OPTIONS(config)
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/* THIS FILE WAS GENERATED AUTOMATICALLY BY PAYLOAD. */
|
|
2
|
+
/* DO NOT MODIFY IT BECAUSE IT COULD BE REWRITTEN AT ANY TIME. */
|
|
3
|
+
import config from '@payload-config'
|
|
4
|
+
import '@payloadcms/next/css'
|
|
5
|
+
import { GRAPHQL_PLAYGROUND_GET } from '@payloadcms/next/routes'
|
|
6
|
+
|
|
7
|
+
export const GET = GRAPHQL_PLAYGROUND_GET(config)
|
|
File without changes
|