{
  "slug": "mongodb-prisma",
  "runtimes": {
    "node": {
      "frameworks": {
        "express": {
          "dependencies": {
            "runtime": [
              "@prisma/client@6"
            ],
            "dev": [
              "prisma@6"
            ]
          },
          "env": [
            "DATABASE_URL",
            "NODE_ENV"
          ],
          "architectures": {
            "mvc": {
              "files": [
                {
                  "type": "file",
                  "path": "src/configs/prisma.ts",
                  "content": "import { PrismaClient } from \"@prisma/client\";\r\nimport env from \"./env\";\r\n\r\nconst prisma = new PrismaClient({\r\n  log: env.NODE_ENV === \"development\" ? [\"query\", \"warn\", \"error\"] : [\"error\"]\r\n});\r\n\r\nexport default prisma;\r\n"
                },
                {
                  "type": "file",
                  "path": "src/configs/env.ts",
                  "content": "import \"dotenv-flow/config\";\r\nimport { z } from \"zod\";\r\n\r\nexport const envSchema = z.object({\r\n  NODE_ENV: z\r\n    .enum([\"development\", \"test\", \"production\"])\r\n    .default(\"development\"),\r\n\r\n  DATABASE_URL: z.url()\r\n});\r\n\r\nexport type Env = z.infer<typeof envSchema>;\r\n\r\nconst result = envSchema.safeParse(process.env);\r\n\r\nif (!result.success) {\r\n  console.error(\"❌ Invalid environment configuration\");\r\n  console.error(z.prettifyError(result.error));\r\n  process.exit(1);\r\n}\r\n\r\nexport const env: Readonly<Env> = Object.freeze(result.data);\r\n\r\nexport default env;\r\n"
                },
                {
                  "type": "file",
                  "path": "src/prisma/schema.prisma",
                  "content": "// This is your Prisma schema file,\r\n// learn more about it in the docs: https://pris.ly/d/prisma-schema\r\n\r\n// Looking for ways to speed up your queries, or scale easily with your serverless or edge functions?\r\n// Try Prisma Accelerate: https://pris.ly/cli/accelerate-init\r\n\r\ngenerator client {\r\n  provider = \"prisma-client-js\"\r\n}\r\n\r\ndatasource db {\r\n  provider = \"mongodb\"\r\n  url      = env(\"DATABASE_URL\")\r\n}\r\n\r\nmodel User { \r\n  id    String  @id @default(auto()) @map(\"_id\") @db.ObjectId\r\n  email String  @unique\r\n  name  String?\r\n  password String\r\n} \r\n"
                }
              ]
            },
            "feature": {
              "files": [
                {
                  "type": "file",
                  "path": "src/prisma/schema.prisma",
                  "content": "// This is your Prisma schema file,\r\n// learn more about it in the docs: https://pris.ly/d/prisma-schema\r\n\r\n// Looking for ways to speed up your queries, or scale easily with your serverless or edge functions?\r\n// Try Prisma Accelerate: https://pris.ly/cli/accelerate-init\r\n\r\ngenerator client {\r\n  provider = \"prisma-client-js\"\r\n}\r\n\r\ndatasource db {\r\n  provider = \"mongodb\"\r\n  url      = env(\"DATABASE_URL\")\r\n}\r\n\r\nmodel User { \r\n  id    String  @id @default(auto()) @map(\"_id\") @db.ObjectId\r\n  email String  @unique\r\n  name  String?\r\n  password String\r\n} \r\n"
                },
                {
                  "type": "file",
                  "path": "src/shared/configs/prisma.ts",
                  "content": "import { PrismaClient } from \"@prisma/client\";\r\nimport env from \"./env\";\r\n\r\nconst prisma = new PrismaClient({\r\n  log: env.NODE_ENV === \"development\" ? [\"query\", \"warn\", \"error\"] : [\"error\"]\r\n});\r\n\r\nexport default prisma;\r\n"
                },
                {
                  "type": "file",
                  "path": "src/shared/configs/env.ts",
                  "content": "import \"dotenv-flow/config\";\r\nimport { z } from \"zod\";\r\n\r\nexport const envSchema = z.object({\r\n  NODE_ENV: z\r\n    .enum([\"development\", \"test\", \"production\"])\r\n    .default(\"development\"),\r\n\r\n  DATABASE_URL: z.url()\r\n});\r\n\r\nexport type Env = z.infer<typeof envSchema>;\r\n\r\nconst result = envSchema.safeParse(process.env);\r\n\r\nif (!result.success) {\r\n  console.error(\"❌ Invalid environment configuration\");\r\n  console.error(z.prettifyError(result.error));\r\n  process.exit(1);\r\n}\r\n\r\nexport const env: Readonly<Env> = Object.freeze(result.data);\r\n\r\nexport default env;\r\n"
                }
              ]
            }
          }
        }
      }
    }
  }
}
