import path from 'path' import { fileURLToPath } from 'url' import { buildConfig } from 'payload' import { postgresAdapter } from '@payloadcms/db-postgres' import { lexicalEditor } from '@payloadcms/richtext-lexical' import Users from './collections/Users' import Posts from './collections/Posts' import Media from './collections/Media' import Files from './collections/Files' import PostLikes from './collections/PostLikes' import Comments from './collections/Comments' import LaunchNotifications from './collections/LaunchNotifications' const filename = fileURLToPath(import.meta.url) const dirname = path.dirname(filename) export default buildConfig({ admin: { user: Users.slug, meta: { titleSuffix: '— أنور بي آي' }, }, secret: process.env.PAYLOAD_SECRET || 'dev-secret-change-me', collections: [Users, Posts, Media, Files, PostLikes, Comments, LaunchNotifications], editor: lexicalEditor(), db: postgresAdapter({ pool: { connectionString: process.env.DATABASE_URI || 'postgres://anwarpi:anwarpi@127.0.0.1:5432/anwarpi', }, }), telemetry: false, typescript: { outputFile: 'payload-types.ts' }, upload: { limits: { fileSize: 20_000_000 } }, })