2025-02-03 03:19:32 +07:00
|
|
|
// storage-adapter-import-placeholder
|
|
|
|
import { postgresAdapter } from "@payloadcms/db-postgres";
|
|
|
|
import { payloadCloudPlugin } from "@payloadcms/payload-cloud";
|
2025-02-05 16:24:08 +07:00
|
|
|
import { formBuilderPlugin } from "@payloadcms/plugin-form-builder";
|
2025-02-05 17:49:33 +07:00
|
|
|
import { s3Storage } from "@payloadcms/storage-s3";
|
2025-02-03 03:19:32 +07:00
|
|
|
import path from "path";
|
|
|
|
import { buildConfig } from "payload";
|
|
|
|
import sharp from "sharp";
|
2025-02-04 11:04:18 +07:00
|
|
|
import { fileURLToPath } from "url";
|
2025-02-03 03:19:32 +07:00
|
|
|
|
2025-02-04 11:04:18 +07:00
|
|
|
import { Blogs } from "@/collections/Blogs";
|
|
|
|
import { Media } from "@/collections/Media";
|
|
|
|
import { Users } from "@/collections/Users";
|
2025-02-05 16:24:08 +07:00
|
|
|
import {
|
|
|
|
BoldFeature,
|
|
|
|
FixedToolbarFeature,
|
|
|
|
HeadingFeature,
|
|
|
|
InlineToolbarFeature,
|
|
|
|
ItalicFeature,
|
|
|
|
lexicalEditor,
|
|
|
|
LinkFeature,
|
|
|
|
} from "@payloadcms/richtext-lexical";
|
2025-02-03 03:19:32 +07:00
|
|
|
|
|
|
|
const filename = fileURLToPath(import.meta.url);
|
|
|
|
const dirname = path.dirname(filename);
|
|
|
|
|
|
|
|
export default buildConfig({
|
|
|
|
admin: {
|
|
|
|
user: Users.slug,
|
|
|
|
importMap: {
|
2025-02-04 11:04:18 +07:00
|
|
|
// baseDir: path.resolve(dirname),
|
|
|
|
baseDir: "@",
|
|
|
|
},
|
|
|
|
meta: {
|
|
|
|
titleSuffix: "- Admin - Cochise Oncology",
|
|
|
|
description: "Cochise Oncology",
|
|
|
|
icons: [{ url: "/assets/images/demo-slick/logo-dark.webp" }],
|
|
|
|
},
|
|
|
|
components: {
|
|
|
|
graphics: {
|
|
|
|
Logo: {
|
|
|
|
path: "/components/Logo/AdminLogo",
|
|
|
|
},
|
|
|
|
},
|
2025-02-03 03:19:32 +07:00
|
|
|
},
|
2025-02-04 11:04:18 +07:00
|
|
|
theme: "dark",
|
2025-02-03 03:19:32 +07:00
|
|
|
},
|
2025-02-05 17:49:33 +07:00
|
|
|
collections: [Users, Media, Blogs],
|
2025-02-03 03:19:32 +07:00
|
|
|
secret: process.env.PAYLOAD_SECRET || "",
|
|
|
|
typescript: {
|
|
|
|
outputFile: path.resolve(dirname, "payload-types.ts"),
|
|
|
|
},
|
|
|
|
db: postgresAdapter({
|
|
|
|
pool: {
|
|
|
|
connectionString: process.env.DATABASE_URI || "",
|
|
|
|
},
|
|
|
|
}),
|
2025-02-05 16:24:08 +07:00
|
|
|
editor: lexicalEditor({
|
|
|
|
features: () => {
|
|
|
|
return [
|
|
|
|
BoldFeature(),
|
|
|
|
ItalicFeature(),
|
|
|
|
LinkFeature({ enabledCollections: ["blogs"] }),
|
|
|
|
HeadingFeature({ enabledHeadingSizes: ["h1", "h2", "h3"] }),
|
|
|
|
FixedToolbarFeature(),
|
|
|
|
InlineToolbarFeature(),
|
|
|
|
];
|
|
|
|
},
|
|
|
|
}),
|
2025-02-03 03:19:32 +07:00
|
|
|
sharp,
|
|
|
|
plugins: [
|
|
|
|
payloadCloudPlugin(),
|
|
|
|
// storage-adapter-placeholder
|
|
|
|
s3Storage({
|
|
|
|
collections: {
|
|
|
|
media: {
|
|
|
|
prefix: "media",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
bucket: process.env.S3_BUCKET || "",
|
|
|
|
config: {
|
|
|
|
forcePathStyle: true, // Important for using Supabase
|
|
|
|
credentials: {
|
|
|
|
accessKeyId: process.env.S3_ACCESS_KEY_ID || "",
|
|
|
|
secretAccessKey: process.env.S3_SECRET_ACCESS_KEY || "",
|
|
|
|
},
|
|
|
|
region: process.env.S3_REGION,
|
|
|
|
endpoint: process.env.S3_ENDPOINT,
|
|
|
|
},
|
|
|
|
}),
|
2025-02-05 16:24:08 +07:00
|
|
|
// form builder
|
|
|
|
formBuilderPlugin({
|
|
|
|
fields: {
|
|
|
|
text: true,
|
|
|
|
textarea: true,
|
|
|
|
select: true,
|
|
|
|
email: true,
|
|
|
|
state: true,
|
|
|
|
country: true,
|
|
|
|
checkbox: true,
|
|
|
|
number: true,
|
|
|
|
message: false,
|
|
|
|
payment: false,
|
|
|
|
},
|
|
|
|
formOverrides: {
|
|
|
|
fields: undefined,
|
|
|
|
},
|
|
|
|
}),
|
2025-02-03 03:19:32 +07:00
|
|
|
],
|
|
|
|
});
|