feat: admin panel CRUD, Cloudinary upload, logo, user management

This commit is contained in:
mstfyldz
2026-06-05 17:38:01 +03:00
parent 53eeeee474
commit 5e4e2f0db9
43 changed files with 3917 additions and 281 deletions
+19
View File
@@ -0,0 +1,19 @@
import { PrismaClient } from '@prisma/client'
import { Pool } from 'pg'
import { PrismaPg } from '@prisma/adapter-pg'
const prismaClientSingleton = () => {
const pool = new Pool({ connectionString: process.env.DATABASE_URL })
const adapter = new PrismaPg(pool)
return new PrismaClient({ adapter })
}
declare const globalThis: {
prismaGlobal: ReturnType<typeof prismaClientSingleton>;
} & typeof global;
const prisma = globalThis.prismaGlobal ?? prismaClientSingleton()
export default prisma
if (process.env.NODE_ENV !== 'production') globalThis.prismaGlobal = prisma