Skip to content

Commit 55806bd

Browse files
committed
feat: initial commit
0 parents  commit 55806bd

32 files changed

+9578
-0
lines changed

.env.example

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
DATABASE_URI=file:./your-database-name.db
2+
PAYLOAD_SECRET=YOUR_SECRET_HERE

.gitignore

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
/.pnp
6+
.pnp.js
7+
.yarn/install-state.gz
8+
9+
/.idea/*
10+
!/.idea/runConfigurations
11+
12+
# testing
13+
/coverage
14+
15+
# next.js
16+
/.next/
17+
/out/
18+
19+
# production
20+
/build
21+
22+
# misc
23+
.DS_Store
24+
*.pem
25+
26+
# debug
27+
npm-debug.log*
28+
yarn-debug.log*
29+
yarn-error.log*
30+
31+
# local env files
32+
.env*.local
33+
34+
# vercel
35+
.vercel
36+
37+
# typescript
38+
*.tsbuildinfo
39+
next-env.d.ts
40+
41+
.env
42+
43+
/media

.npmrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
legacy-peer-deps=true

.prettierrc.json

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"singleQuote": true,
3+
"trailingComma": "all",
4+
"printWidth": 100,
5+
"semi": false
6+
}

.vscode/extensions.json

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"recommendations": ["dbaeumer.vscode-eslint", "esbenp.prettier-vscode"]
3+
}

.vscode/launch.json

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
7+
{
8+
"name": "Next.js: debug full stack",
9+
"type": "node",
10+
"request": "launch",
11+
"program": "${workspaceFolder}/node_modules/next/dist/bin/next",
12+
"runtimeArgs": ["--inspect"],
13+
"skipFiles": ["<node_internals>/**"],
14+
"serverReadyAction": {
15+
"action": "debugWithChrome",
16+
"killOnServerStop": true,
17+
"pattern": "- Local:.+(https?://.+)",
18+
"uriFormat": "%s",
19+
"webRoot": "${workspaceFolder}"
20+
},
21+
"cwd": "${workspaceFolder}"
22+
}
23+
]
24+
}

.vscode/settings.json

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
"npm.packageManager": "pnpm",
3+
"editor.defaultFormatter": "esbenp.prettier-vscode",
4+
"[typescript]": {
5+
"editor.defaultFormatter": "esbenp.prettier-vscode",
6+
"editor.formatOnSave": true,
7+
"editor.codeActionsOnSave": {
8+
"source.fixAll.eslint": "explicit"
9+
}
10+
},
11+
"[typescriptreact]": {
12+
"editor.defaultFormatter": "esbenp.prettier-vscode",
13+
"editor.formatOnSave": true,
14+
"editor.codeActionsOnSave": {
15+
"source.fixAll.eslint": "explicit"
16+
}
17+
},
18+
"[javascript]": {
19+
"editor.defaultFormatter": "esbenp.prettier-vscode",
20+
"editor.formatOnSave": true,
21+
"editor.codeActionsOnSave": {
22+
"source.fixAll.eslint": "explicit"
23+
}
24+
},
25+
"[json]": {
26+
"editor.defaultFormatter": "esbenp.prettier-vscode",
27+
"editor.formatOnSave": true
28+
},
29+
"[jsonc]": {
30+
"editor.defaultFormatter": "esbenp.prettier-vscode",
31+
"editor.formatOnSave": true
32+
},
33+
"editor.formatOnSaveMode": "file",
34+
"typescript.tsdk": "node_modules/typescript/lib",
35+
"[javascript][typescript][typescriptreact]": {
36+
"editor.codeActionsOnSave": {
37+
"source.fixAll.eslint": "explicit"
38+
}
39+
}
40+
}

.yarnrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
--install.ignore-engines true

Dockerfile

+71
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# To use this Dockerfile, you have to set `output: 'standalone'` in your next.config.mjs file.
2+
# From https://github.com/vercel/next.js/blob/canary/examples/with-docker/Dockerfile
3+
4+
FROM node:22.12.0-alpine AS base
5+
6+
# Install dependencies only when needed
7+
FROM base AS deps
8+
# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed.
9+
RUN apk add --no-cache libc6-compat
10+
WORKDIR /app
11+
12+
# Install dependencies based on the preferred package manager
13+
COPY package.json yarn.lock* package-lock.json* pnpm-lock.yaml* ./
14+
RUN \
15+
if [ -f yarn.lock ]; then yarn --frozen-lockfile; \
16+
elif [ -f package-lock.json ]; then npm ci; \
17+
elif [ -f pnpm-lock.yaml ]; then corepack enable pnpm && pnpm i --frozen-lockfile; \
18+
else echo "Lockfile not found." && exit 1; \
19+
fi
20+
21+
22+
# Rebuild the source code only when needed
23+
FROM base AS builder
24+
WORKDIR /app
25+
COPY --from=deps /app/node_modules ./node_modules
26+
COPY . .
27+
28+
# Next.js collects completely anonymous telemetry data about general usage.
29+
# Learn more here: https://nextjs.org/telemetry
30+
# Uncomment the following line in case you want to disable telemetry during the build.
31+
# ENV NEXT_TELEMETRY_DISABLED 1
32+
33+
RUN \
34+
if [ -f yarn.lock ]; then yarn run build; \
35+
elif [ -f package-lock.json ]; then npm run build; \
36+
elif [ -f pnpm-lock.yaml ]; then corepack enable pnpm && pnpm run build; \
37+
else echo "Lockfile not found." && exit 1; \
38+
fi
39+
40+
# Production image, copy all the files and run next
41+
FROM base AS runner
42+
WORKDIR /app
43+
44+
ENV NODE_ENV production
45+
# Uncomment the following line in case you want to disable telemetry during runtime.
46+
# ENV NEXT_TELEMETRY_DISABLED 1
47+
48+
RUN addgroup --system --gid 1001 nodejs
49+
RUN adduser --system --uid 1001 nextjs
50+
51+
# Remove this line if you do not have this folder
52+
COPY --from=builder /app/public ./public
53+
54+
# Set the correct permission for prerender cache
55+
RUN mkdir .next
56+
RUN chown nextjs:nodejs .next
57+
58+
# Automatically leverage output traces to reduce image size
59+
# https://nextjs.org/docs/advanced-features/output-file-tracing
60+
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
61+
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
62+
63+
USER nextjs
64+
65+
EXPOSE 3000
66+
67+
ENV PORT 3000
68+
69+
# server.js is created by next build from the standalone output
70+
# https://nextjs.org/docs/pages/api-reference/next-config-js/output
71+
CMD HOSTNAME="0.0.0.0" node server.js

README.md

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# blank
2+
3+
blank
4+
5+
## Attributes
6+
7+
- **Database**: mongodb
8+
- **Storage Adapter**: localDisk

docker-compose.yml

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
version: '3'
2+
3+
services:
4+
payload:
5+
image: node:18-alpine
6+
ports:
7+
- '3000:3000'
8+
volumes:
9+
- .:/home/node/app
10+
- node_modules:/home/node/app/node_modules
11+
working_dir: /home/node/app/
12+
command: sh -c "corepack enable && corepack prepare pnpm@latest --activate && pnpm install && pnpm dev"
13+
depends_on:
14+
- mongo
15+
# - postgres
16+
env_file:
17+
- .env
18+
19+
# Ensure your DATABASE_URI uses 'mongo' as the hostname ie. mongodb://mongo/my-db-name
20+
mongo:
21+
image: mongo:latest
22+
ports:
23+
- '27017:27017'
24+
command:
25+
- --storageEngine=wiredTiger
26+
volumes:
27+
- data:/data/db
28+
logging:
29+
driver: none
30+
31+
# Uncomment the following to use postgres
32+
# postgres:
33+
# restart: always
34+
# image: postgres:latest
35+
# volumes:
36+
# - pgdata:/var/lib/postgresql/data
37+
# ports:
38+
# - "5432:5432"
39+
40+
volumes:
41+
data:
42+
# pgdata:
43+
node_modules:

eslint.config.mjs

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import { dirname } from 'path'
2+
import { fileURLToPath } from 'url'
3+
import { FlatCompat } from '@eslint/eslintrc'
4+
5+
const __filename = fileURLToPath(import.meta.url)
6+
const __dirname = dirname(__filename)
7+
8+
const compat = new FlatCompat({
9+
baseDirectory: __dirname,
10+
})
11+
12+
const eslintConfig = [
13+
...compat.extends('next/core-web-vitals', 'next/typescript'),
14+
{
15+
rules: {
16+
'@typescript-eslint/ban-ts-comment': 'warn',
17+
'@typescript-eslint/no-empty-object-type': 'warn',
18+
'@typescript-eslint/no-explicit-any': 'warn',
19+
'@typescript-eslint/no-unused-vars': [
20+
'warn',
21+
{
22+
vars: 'all',
23+
args: 'after-used',
24+
ignoreRestSiblings: false,
25+
argsIgnorePattern: '^_',
26+
varsIgnorePattern: '^_',
27+
destructuredArrayIgnorePattern: '^_',
28+
caughtErrorsIgnorePattern: '^(_|ignore)',
29+
},
30+
],
31+
},
32+
},
33+
]
34+
35+
export default eslintConfig

next.config.mjs

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { withPayload } from '@payloadcms/next/withPayload'
2+
3+
/** @type {import('next').NextConfig} */
4+
const nextConfig = {
5+
// Your Next.js config here
6+
}
7+
8+
export default withPayload(nextConfig, { devBundleServerPackages: false })

package.json

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
{
2+
"name": "ui-field-state",
3+
"version": "1.0.0",
4+
"description": "A blank template to get started with Payload 3.0",
5+
"license": "MIT",
6+
"type": "module",
7+
"scripts": {
8+
"build": "cross-env NODE_OPTIONS=--no-deprecation next build",
9+
"dev": "cross-env NODE_OPTIONS=--no-deprecation next dev",
10+
"devsafe": "rm -rf .next && cross-env NODE_OPTIONS=--no-deprecation next dev",
11+
"generate:importmap": "cross-env NODE_OPTIONS=--no-deprecation payload generate:importmap",
12+
"generate:types": "cross-env NODE_OPTIONS=--no-deprecation payload generate:types",
13+
"lint": "cross-env NODE_OPTIONS=--no-deprecation next lint",
14+
"payload": "cross-env NODE_OPTIONS=--no-deprecation payload",
15+
"start": "cross-env NODE_OPTIONS=--no-deprecation next start"
16+
},
17+
"dependencies": {
18+
"@payloadcms/next": "latest",
19+
"@payloadcms/payload-cloud": "latest",
20+
"@payloadcms/richtext-lexical": "latest",
21+
"cross-env": "^7.0.3",
22+
"graphql": "^16.8.1",
23+
"next": "15.2.3",
24+
"payload": "latest",
25+
"react": "19.0.0",
26+
"react-dom": "19.0.0",
27+
"sharp": "0.32.6",
28+
"@payloadcms/db-sqlite": "latest"
29+
},
30+
"devDependencies": {
31+
"@eslint/eslintrc": "^3.2.0",
32+
"@types/node": "^22.5.4",
33+
"@types/react": "19.0.12",
34+
"@types/react-dom": "19.0.4",
35+
"eslint": "^9.16.0",
36+
"eslint-config-next": "15.2.3",
37+
"prettier": "^3.4.2",
38+
"typescript": "5.7.3"
39+
},
40+
"engines": {
41+
"node": "^18.20.2 || >=20.9.0",
42+
"pnpm": "^9"
43+
},
44+
"pnpm": {
45+
"onlyBuiltDependencies": [
46+
"sharp"
47+
]
48+
}
49+
}

0 commit comments

Comments
 (0)