{
  "slug": "blog-app",
  "runtimes": {
    "node": {
      "frameworks": {
        "express": {
          "databases": {
            "mysql": {
              "orms": {
                "drizzle": {
                  "templates": {
                    "index": {
                      "architectures": {
                        "mvc": {
                          "files": [
                            {
                              "type": "file",
                              "path": "drizzle.config.ts",
                              "content": "import { Config, defineConfig } from \"drizzle-kit\";\n\nexport default defineConfig({\n  out: \"./src/drizzle/migrations\",\n  schema: \"./src/drizzle/index.ts\",\n  dialect: \"mysql\",\n  dbCredentials: {\n    url: process.env.DATABASE_URL!\n  },\n  verbose: true,\n  strict: true\n}) satisfies Config;\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/index.ts",
                              "content": "export * from \"./schemas/user.schema\";\nexport * from \"./schemas/post.schema\";\nexport * from \"./schemas/category.schema\";\nexport * from \"./schemas/comment.schema\";\nexport * from \"./schemas/comment-like.schema\";\nexport * from \"./schemas/post-like.schema\";\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/schemas/user.schema.ts",
                              "content": "import {\n  mysqlTable,\n  varchar,\n  boolean,\n  timestamp,\n  int,\n  json,\n  uniqueIndex,\n  index,\n  mysqlEnum\n} from \"drizzle-orm/mysql-core\";\nimport { timestamps } from \"./schema.helper\";\nimport { relations } from \"drizzle-orm\";\nimport { posts } from \"./post.schema\";\nimport { postLikes } from \"./post-like.schema\";\nimport { commentLikes } from \"./comment-like.schema\";\nimport { comments } from \"./comment.schema\";\n\ninterface IAvatar {\n  public_id?: string;\n  url: string;\n  size?: number;\n}\n\nexport const users = mysqlTable(\n  \"users\",\n  {\n    id: int(\"id\").primaryKey().autoincrement(),\n    name: varchar(\"name\", { length: 100 }).notNull(),\n    email: varchar(\"email\", { length: 255 }).notNull().unique(),\n    password: varchar(\"password\", { length: 255 }),\n    role: mysqlEnum(\"role\", [\"user\", \"admin\"]).default(\"user\").notNull(),\n\n    provider: mysqlEnum(\"provider\", [\"local\", \"google\", \"github\"])\n      .default(\"local\")\n      .notNull(),\n    providerId: varchar(\"provider_id\", { length: 255 }),\n\n    avatar: json(\"avatar\").$type<IAvatar>(),\n\n    isEmailVerified: boolean(\"is_email_verified\").default(false).notNull(),\n    lastLoginAt: timestamp(\"last_login_at\"),\n    failedLoginAttempts: int(\"failed_login_attempts\").default(0).notNull(),\n    lockUntil: timestamp(\"lock_until\"),\n\n    isDeleted: boolean(\"is_deleted\").default(false).notNull(),\n    deletedAt: timestamp(\"deleted_at\"),\n    reActivateAvailableAt: timestamp(\"re_activate_available_at\"),\n\n    ...timestamps\n  },\n  table => [\n    uniqueIndex(\"email_idx\").on(table.email),\n    index(\"role_idx\").on(table.role),\n    index(\"is_deleted_idx\").on(table.isDeleted)\n  ]\n);\n\n//* relations:\nexport const usersRelations = relations(users, ({ many }) => ({\n  //? relation with posts: user has many posts\n  posts: many(posts),\n\n  //? relation with post_likes: user has many likes\n  postLikes: many(postLikes),\n\n  //? relation with comment_likes: user has many comment likes\n  commentLikes: many(commentLikes),\n\n  //? relation with comments: user has many comments\n  comments: many(comments)\n}));\n\n//? User type\nexport type User = typeof users.$inferSelect;\nexport type NewUser = typeof users.$inferInsert;\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/schemas/schema.helper.ts",
                              "content": "import { timestamp } from \"drizzle-orm/mysql-core\";\n\nexport const timestamps = {\n  createdAt: timestamp(\"created_at\").defaultNow().notNull(),\n  updatedAt: timestamp(\"updated_at\").defaultNow().onUpdateNow().notNull()\n};\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/schemas/post.schema.ts",
                              "content": "import {\n  index,\n  int,\n  json,\n  mysqlEnum,\n  mysqlTable,\n  timestamp,\n  uniqueIndex,\n  varchar\n} from \"drizzle-orm/mysql-core\";\nimport { timestamps } from \"./schema.helper\";\nimport { users } from \"./user.schema\";\nimport { relations } from \"drizzle-orm\";\nimport { categories } from \"./category.schema\";\nimport { postLikes } from \"./post-like.schema\";\n\nconst POST_STATUSES = [\"draft\", \"published\", \"archived\"] as const;\n\ninterface IFile {\n  public_id: string;\n  url: string;\n  size: number;\n}\n\nexport const posts = mysqlTable(\n  \"posts\",\n  {\n    id: int().primaryKey().autoincrement(),\n\n    title: varchar(\"title\", { length: 100 }).notNull(),\n    slug: varchar(\"slug\").notNull().unique(),\n    content: varchar(\"description\"),\n    excerpt: varchar(\"excerpt\"), // Short summary\n\n    authorId: int(\"author_id\")\n      .references(() => users.id, { onDelete: \"cascade\" })\n      .notNull(), // Reference to User\n    categoryId: int(\"category_id\")\n      .references(() => users.id, { onDelete: \"cascade\" })\n      .notNull(),\n\n    tags: json(\"tags\").$type<string[]>(),\n    featuredImage: json(\"featured_image\").$type<IFile>(),\n    views: int(\"views\").default(0).notNull(),\n\n    status: mysqlEnum(\"status\", POST_STATUSES).default(\"draft\").notNull(),\n    publishedAt: timestamp(\"published_at\"),\n\n    ...timestamps\n  },\n  table => [\n    uniqueIndex(\"author_id_slug_unique\").on(table.authorId, table.slug),\n    index(\"category_idx\").on(table.categoryId),\n    index(\"status_idx\").on(table.status)\n  ]\n);\n\n//* relations:\nexport const postsRelations = relations(posts, ({ one, many }) => ({\n  //? relation with users: post belongs to one user\n  author: one(users, {\n    fields: [posts.authorId],\n    references: [users.id]\n  }),\n\n  //? relation with categories: Post belongs to one category\n  category: one(categories, {\n    fields: [posts.categoryId],\n    references: [categories.id]\n  }),\n\n  //? relation with post_likes: one post has many likes\n  postLikes: many(postLikes)\n}));\n\nexport type NewPost = typeof posts.$inferInsert;\nexport type Post = typeof posts.$inferSelect;\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/schemas/post-like.schema.ts",
                              "content": "import { mysqlTable, int, uniqueIndex } from \"drizzle-orm/mysql-core\";\nimport { users } from \"./user.schema\";\nimport { posts } from \"./post.schema\";\nimport { timestamps } from \"./schema.helper\";\nimport { relations } from \"drizzle-orm\";\n\nexport const postLikes = mysqlTable(\n  \"post_likes\",\n  {\n    userId: int(\"user_id\")\n      .references(() => users.id, { onDelete: \"cascade\" })\n      .notNull(),\n\n    postId: int(\"post_id\")\n      .references(() => posts.id, { onDelete: \"cascade\" })\n      .notNull(),\n    ...timestamps\n  },\n  table => [uniqueIndex(\"unique_like\").on(table.userId, table.postId)]\n);\n\n//* relations:\nexport const postLikesRelations = relations(postLikes, ({ one }) => ({\n  //? relation with users: one like belongs to one user\n  user: one(users, {\n    fields: [postLikes.userId],\n    references: [users.id]\n  }),\n\n  //? relation with posts: one like belongs to one post\n  post: one(posts, {\n    fields: [postLikes.postId],\n    references: [posts.id]\n  })\n}));\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/schemas/comment.schema.ts",
                              "content": "import { mysqlTable, int, text } from \"drizzle-orm/mysql-core\";\n\nimport { posts } from \"./post.schema\";\nimport { users } from \"./user.schema\";\nimport { timestamps } from \"./schema.helper\";\nimport { relations } from \"drizzle-orm\";\nimport { commentLikes } from \"./comment-like.schema\";\n\nexport const comments = mysqlTable(\"comments\", {\n  id: int(\"id\").primaryKey().autoincrement(),\n\n  postId: int(\"post_id\")\n    .notNull()\n    .references(() => posts.id),\n\n  authorId: int(\"author_id\")\n    .notNull()\n    .references(() => users.id),\n\n  content: text(\"content\").notNull(),\n\n  parentCommentId: int(\"parent_comment_id\"),\n  ...timestamps\n});\n\n//* relations:\nexport const commentsRelations = relations(comments, ({ one, many }) => ({\n  //? relation with posts: one comment belongs to one post\n  post: one(posts, {\n    fields: [comments.postId],\n    references: [posts.id]\n  }),\n\n  //? relation with users: one comment belongs to one user\n  author: one(users, {\n    fields: [comments.authorId],\n    references: [users.id]\n  }),\n\n  //? relation with comments: one comment belongs to one parent comment\n  parentComment: one(comments, {\n    fields: [comments.parentCommentId],\n    references: [comments.id]\n  }),\n\n  //? relation with comments: one comment has many replies\n  replies: many(comments),\n\n  //? relation with comment_likes: one comment has many likes\n  likes: many(commentLikes)\n}));\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/schemas/comment-like.schema.ts",
                              "content": "import { mysqlTable, int, uniqueIndex } from \"drizzle-orm/mysql-core\";\nimport { comments } from \"./comment.schema\";\nimport { users } from \"./user.schema\";\nimport { timestamps } from \"./schema.helper\";\nimport { relations } from \"drizzle-orm\";\n\nexport const commentLikes = mysqlTable(\n  \"comment_likes\",\n  {\n    userId: int(\"user_id\")\n      .notNull()\n      .references(() => users.id),\n\n    commentId: int(\"comment_id\")\n      .notNull()\n      .references(() => comments.id),\n\n    ...timestamps\n  },\n  table => [\n    uniqueIndex(\"unique_comment_like\").on(table.userId, table.commentId)\n  ]\n);\n\n//* relations:\nexport const commentLikesRelations = relations(commentLikes, ({ one }) => ({\n  //? relation with users: one like belongs to one user\n  user: one(users, {\n    fields: [commentLikes.userId],\n    references: [users.id]\n  }),\n\n  //? relation with comments: one like belongs to one comment\n  comment: one(comments, {\n    fields: [commentLikes.commentId],\n    references: [comments.id]\n  })\n}));\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/schemas/category.schema.ts",
                              "content": "import { int, mysqlTable, uniqueIndex, varchar } from \"drizzle-orm/mysql-core\";\nimport { timestamps } from \"./schema.helper\";\nimport { relations } from \"drizzle-orm\";\nimport { posts } from \"./post.schema\";\n\nexport const categories = mysqlTable(\n  \"categories\",\n  {\n    id: int().primaryKey().autoincrement(),\n    name: varchar(\"name\", { length: 100 }).notNull(),\n    slug: varchar(\"slug\").notNull().unique(),\n    description: varchar(\"description\"),\n\n    ...timestamps\n  },\n  table => [\n    uniqueIndex(\"slug_idx\").on(table.slug),\n    uniqueIndex(\"name_idx\").on(table.name)\n  ]\n);\n\n//? relation with posts: one category has many posts\nexport const categoriesRelations = relations(categories, ({ many }) => ({\n  posts: many(posts)\n}));\n\nexport type NewCategory = typeof categories.$inferInsert;\nexport type Category = typeof categories.$inferSelect;\n"
                            }
                          ]
                        },
                        "feature": {
                          "files": [
                            {
                              "type": "file",
                              "path": "drizzle.config.ts",
                              "content": "import { Config, defineConfig } from \"drizzle-kit\";\n\nexport default defineConfig({\n  out: \"./src/drizzle/migrations\",\n  schema: \"./src/drizzle/index.ts\",\n  dialect: \"mysql\",\n  dbCredentials: {\n    url: process.env.DATABASE_URL!\n  },\n  verbose: true,\n  strict: true\n}) satisfies Config;\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/index.ts",
                              "content": "export * from \"./schemas/user.schema\";\nexport * from \"./schemas/post.schema\";\nexport * from \"./schemas/category.schema\";\nexport * from \"./schemas/comment.schema\";\nexport * from \"./schemas/comment-like.schema\";\nexport * from \"./schemas/post-like.schema\";\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/schemas/user.schema.ts",
                              "content": "import {\n  mysqlTable,\n  varchar,\n  boolean,\n  timestamp,\n  int,\n  json,\n  uniqueIndex,\n  index,\n  mysqlEnum\n} from \"drizzle-orm/mysql-core\";\nimport { timestamps } from \"./schema.helper\";\nimport { relations } from \"drizzle-orm\";\nimport { posts } from \"./post.schema\";\nimport { postLikes } from \"./post-like.schema\";\nimport { commentLikes } from \"./comment-like.schema\";\nimport { comments } from \"./comment.schema\";\n\ninterface IAvatar {\n  public_id?: string;\n  url: string;\n  size?: number;\n}\n\nexport const users = mysqlTable(\n  \"users\",\n  {\n    id: int(\"id\").primaryKey().autoincrement(),\n    name: varchar(\"name\", { length: 100 }).notNull(),\n    email: varchar(\"email\", { length: 255 }).notNull().unique(),\n    password: varchar(\"password\", { length: 255 }),\n    role: mysqlEnum(\"role\", [\"user\", \"admin\"]).default(\"user\").notNull(),\n\n    provider: mysqlEnum(\"provider\", [\"local\", \"google\", \"github\"])\n      .default(\"local\")\n      .notNull(),\n    providerId: varchar(\"provider_id\", { length: 255 }),\n\n    avatar: json(\"avatar\").$type<IAvatar>(),\n\n    isEmailVerified: boolean(\"is_email_verified\").default(false).notNull(),\n    lastLoginAt: timestamp(\"last_login_at\"),\n    failedLoginAttempts: int(\"failed_login_attempts\").default(0).notNull(),\n    lockUntil: timestamp(\"lock_until\"),\n\n    isDeleted: boolean(\"is_deleted\").default(false).notNull(),\n    deletedAt: timestamp(\"deleted_at\"),\n    reActivateAvailableAt: timestamp(\"re_activate_available_at\"),\n\n    ...timestamps\n  },\n  table => [\n    uniqueIndex(\"email_idx\").on(table.email),\n    index(\"role_idx\").on(table.role),\n    index(\"is_deleted_idx\").on(table.isDeleted)\n  ]\n);\n\n//* relations:\nexport const usersRelations = relations(users, ({ many }) => ({\n  //? relation with posts: user has many posts\n  posts: many(posts),\n\n  //? relation with post_likes: user has many likes\n  postLikes: many(postLikes),\n\n  //? relation with comment_likes: user has many comment likes\n  commentLikes: many(commentLikes),\n\n  //? relation with comments: user has many comments\n  comments: many(comments)\n}));\n\n//? User type\nexport type User = typeof users.$inferSelect;\nexport type NewUser = typeof users.$inferInsert;\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/schemas/schema.helper.ts",
                              "content": "import { timestamp } from \"drizzle-orm/mysql-core\";\n\nexport const timestamps = {\n  createdAt: timestamp(\"created_at\").defaultNow().notNull(),\n  updatedAt: timestamp(\"updated_at\").defaultNow().onUpdateNow().notNull()\n};\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/schemas/post.schema.ts",
                              "content": "import {\n  index,\n  int,\n  json,\n  mysqlEnum,\n  mysqlTable,\n  timestamp,\n  uniqueIndex,\n  varchar\n} from \"drizzle-orm/mysql-core\";\nimport { timestamps } from \"./schema.helper\";\nimport { users } from \"./user.schema\";\nimport { relations } from \"drizzle-orm\";\nimport { categories } from \"./category.schema\";\nimport { postLikes } from \"./post-like.schema\";\n\nconst POST_STATUSES = [\"draft\", \"published\", \"archived\"] as const;\n\ninterface IFile {\n  public_id: string;\n  url: string;\n  size: number;\n}\n\nexport const posts = mysqlTable(\n  \"posts\",\n  {\n    id: int().primaryKey().autoincrement(),\n\n    title: varchar(\"title\", { length: 100 }).notNull(),\n    slug: varchar(\"slug\").notNull().unique(),\n    content: varchar(\"description\"),\n    excerpt: varchar(\"excerpt\"), // Short summary\n\n    authorId: int(\"author_id\")\n      .references(() => users.id, { onDelete: \"cascade\" })\n      .notNull(), // Reference to User\n    categoryId: int(\"category_id\")\n      .references(() => users.id, { onDelete: \"cascade\" })\n      .notNull(),\n\n    tags: json(\"tags\").$type<string[]>(),\n    featuredImage: json(\"featured_image\").$type<IFile>(),\n    views: int(\"views\").default(0).notNull(),\n\n    status: mysqlEnum(\"status\", POST_STATUSES).default(\"draft\").notNull(),\n    publishedAt: timestamp(\"published_at\"),\n\n    ...timestamps\n  },\n  table => [\n    uniqueIndex(\"author_id_slug_unique\").on(table.authorId, table.slug),\n    index(\"category_idx\").on(table.categoryId),\n    index(\"status_idx\").on(table.status)\n  ]\n);\n\n//* relations:\nexport const postsRelations = relations(posts, ({ one, many }) => ({\n  //? relation with users: post belongs to one user\n  author: one(users, {\n    fields: [posts.authorId],\n    references: [users.id]\n  }),\n\n  //? relation with categories: Post belongs to one category\n  category: one(categories, {\n    fields: [posts.categoryId],\n    references: [categories.id]\n  }),\n\n  //? relation with post_likes: one post has many likes\n  postLikes: many(postLikes)\n}));\n\nexport type NewPost = typeof posts.$inferInsert;\nexport type Post = typeof posts.$inferSelect;\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/schemas/post-like.schema.ts",
                              "content": "import { mysqlTable, int, uniqueIndex } from \"drizzle-orm/mysql-core\";\nimport { users } from \"./user.schema\";\nimport { posts } from \"./post.schema\";\nimport { timestamps } from \"./schema.helper\";\nimport { relations } from \"drizzle-orm\";\n\nexport const postLikes = mysqlTable(\n  \"post_likes\",\n  {\n    userId: int(\"user_id\")\n      .references(() => users.id, { onDelete: \"cascade\" })\n      .notNull(),\n\n    postId: int(\"post_id\")\n      .references(() => posts.id, { onDelete: \"cascade\" })\n      .notNull(),\n    ...timestamps\n  },\n  table => [uniqueIndex(\"unique_like\").on(table.userId, table.postId)]\n);\n\n//* relations:\nexport const postLikesRelations = relations(postLikes, ({ one }) => ({\n  //? relation with users: one like belongs to one user\n  user: one(users, {\n    fields: [postLikes.userId],\n    references: [users.id]\n  }),\n\n  //? relation with posts: one like belongs to one post\n  post: one(posts, {\n    fields: [postLikes.postId],\n    references: [posts.id]\n  })\n}));\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/schemas/comment.schema.ts",
                              "content": "import { mysqlTable, int, text } from \"drizzle-orm/mysql-core\";\n\nimport { posts } from \"./post.schema\";\nimport { users } from \"./user.schema\";\nimport { timestamps } from \"./schema.helper\";\nimport { relations } from \"drizzle-orm\";\nimport { commentLikes } from \"./comment-like.schema\";\n\nexport const comments = mysqlTable(\"comments\", {\n  id: int(\"id\").primaryKey().autoincrement(),\n\n  postId: int(\"post_id\")\n    .notNull()\n    .references(() => posts.id),\n\n  authorId: int(\"author_id\")\n    .notNull()\n    .references(() => users.id),\n\n  content: text(\"content\").notNull(),\n\n  parentCommentId: int(\"parent_comment_id\"),\n  ...timestamps\n});\n\n//* relations:\nexport const commentsRelations = relations(comments, ({ one, many }) => ({\n  //? relation with posts: one comment belongs to one post\n  post: one(posts, {\n    fields: [comments.postId],\n    references: [posts.id]\n  }),\n\n  //? relation with users: one comment belongs to one user\n  author: one(users, {\n    fields: [comments.authorId],\n    references: [users.id]\n  }),\n\n  //? relation with comments: one comment belongs to one parent comment\n  parentComment: one(comments, {\n    fields: [comments.parentCommentId],\n    references: [comments.id]\n  }),\n\n  //? relation with comments: one comment has many replies\n  replies: many(comments),\n\n  //? relation with comment_likes: one comment has many likes\n  likes: many(commentLikes)\n}));\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/schemas/comment-like.schema.ts",
                              "content": "import { mysqlTable, int, uniqueIndex } from \"drizzle-orm/mysql-core\";\nimport { comments } from \"./comment.schema\";\nimport { users } from \"./user.schema\";\nimport { timestamps } from \"./schema.helper\";\nimport { relations } from \"drizzle-orm\";\n\nexport const commentLikes = mysqlTable(\n  \"comment_likes\",\n  {\n    userId: int(\"user_id\")\n      .notNull()\n      .references(() => users.id),\n\n    commentId: int(\"comment_id\")\n      .notNull()\n      .references(() => comments.id),\n\n    ...timestamps\n  },\n  table => [\n    uniqueIndex(\"unique_comment_like\").on(table.userId, table.commentId)\n  ]\n);\n\n//* relations:\nexport const commentLikesRelations = relations(commentLikes, ({ one }) => ({\n  //? relation with users: one like belongs to one user\n  user: one(users, {\n    fields: [commentLikes.userId],\n    references: [users.id]\n  }),\n\n  //? relation with comments: one like belongs to one comment\n  comment: one(comments, {\n    fields: [commentLikes.commentId],\n    references: [comments.id]\n  })\n}));\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/schemas/category.schema.ts",
                              "content": "import { int, mysqlTable, uniqueIndex, varchar } from \"drizzle-orm/mysql-core\";\nimport { timestamps } from \"./schema.helper\";\nimport { relations } from \"drizzle-orm\";\nimport { posts } from \"./post.schema\";\n\nexport const categories = mysqlTable(\n  \"categories\",\n  {\n    id: int().primaryKey().autoincrement(),\n    name: varchar(\"name\", { length: 100 }).notNull(),\n    slug: varchar(\"slug\").notNull().unique(),\n    description: varchar(\"description\"),\n\n    ...timestamps\n  },\n  table => [\n    uniqueIndex(\"slug_idx\").on(table.slug),\n    uniqueIndex(\"name_idx\").on(table.name)\n  ]\n);\n\n//? relation with posts: one category has many posts\nexport const categoriesRelations = relations(categories, ({ many }) => ({\n  posts: many(posts)\n}));\n\nexport type NewCategory = typeof categories.$inferInsert;\nexport type Category = typeof categories.$inferSelect;\n"
                            }
                          ]
                        }
                      }
                    },
                    "category": {
                      "architectures": {
                        "mvc": {
                          "files": [
                            {
                              "type": "file",
                              "path": "drizzle.config.ts",
                              "content": "import { Config, defineConfig } from \"drizzle-kit\";\n\nexport default defineConfig({\n  out: \"./src/drizzle/migrations\",\n  schema: \"./src/drizzle/index.ts\",\n  dialect: \"mysql\",\n  dbCredentials: {\n    url: process.env.DATABASE_URL!\n  },\n  verbose: true,\n  strict: true\n}) satisfies Config;\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/index.ts",
                              "content": "export * from \"./schemas/category.schema\";\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/schemas/schema.helper.ts",
                              "content": "import { timestamp } from \"drizzle-orm/mysql-core\";\n\nexport const timestamps = {\n  createdAt: timestamp(\"created_at\").defaultNow().notNull(),\n  updatedAt: timestamp(\"updated_at\").defaultNow().onUpdateNow().notNull()\n};\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/schemas/category.schema.ts",
                              "content": "import { int, mysqlTable, uniqueIndex, varchar } from \"drizzle-orm/mysql-core\";\nimport { timestamps } from \"./schema.helper\";\n\nexport const categories = mysqlTable(\n  \"categories\",\n  {\n    id: int().primaryKey().autoincrement(),\n    name: varchar(\"name\", { length: 100 }).notNull(),\n    slug: varchar(\"slug\").notNull().unique(),\n    description: varchar(\"description\"),\n\n    ...timestamps\n  },\n  table => [\n    uniqueIndex(\"slug_idx\").on(table.slug),\n    uniqueIndex(\"name_idx\").on(table.name)\n  ]\n);\n\n//TODO: relation with posts: one category has many posts\n\nexport type NewCategory = typeof categories.$inferInsert;\nexport type Category = typeof categories.$inferSelect;\n"
                            }
                          ]
                        },
                        "feature": {
                          "files": [
                            {
                              "type": "file",
                              "path": "drizzle.config.ts",
                              "content": "import { Config, defineConfig } from \"drizzle-kit\";\n\nexport default defineConfig({\n  out: \"./src/drizzle/migrations\",\n  schema: \"./src/drizzle/index.ts\",\n  dialect: \"mysql\",\n  dbCredentials: {\n    url: process.env.DATABASE_URL!\n  },\n  verbose: true,\n  strict: true\n}) satisfies Config;\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/index.ts",
                              "content": "export * from \"./schemas/category.schema\";\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/schemas/schema.helper.ts",
                              "content": "import { timestamp } from \"drizzle-orm/mysql-core\";\n\nexport const timestamps = {\n  createdAt: timestamp(\"created_at\").defaultNow().notNull(),\n  updatedAt: timestamp(\"updated_at\").defaultNow().onUpdateNow().notNull()\n};\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/schemas/category.schema.ts",
                              "content": "import { int, mysqlTable, uniqueIndex, varchar } from \"drizzle-orm/mysql-core\";\nimport { timestamps } from \"./schema.helper\";\n\nexport const categories = mysqlTable(\n  \"categories\",\n  {\n    id: int().primaryKey().autoincrement(),\n    name: varchar(\"name\", { length: 100 }).notNull(),\n    slug: varchar(\"slug\").notNull().unique(),\n    description: varchar(\"description\"),\n\n    ...timestamps\n  },\n  table => [\n    uniqueIndex(\"slug_idx\").on(table.slug),\n    uniqueIndex(\"name_idx\").on(table.name)\n  ]\n);\n\n//TODO: relation with posts: one category has many posts\n\nexport type NewCategory = typeof categories.$inferInsert;\nexport type Category = typeof categories.$inferSelect;\n"
                            }
                          ]
                        }
                      }
                    },
                    "user": {
                      "architectures": {
                        "mvc": {
                          "files": [
                            {
                              "type": "file",
                              "path": "drizzle.config.ts",
                              "content": "import { Config, defineConfig } from \"drizzle-kit\";\n\nexport default defineConfig({\n  out: \"./src/drizzle/migrations\",\n  schema: \"./src/drizzle/index.ts\",\n  dialect: \"mysql\",\n  dbCredentials: {\n    url: process.env.DATABASE_URL!\n  },\n  verbose: true,\n  strict: true\n}) satisfies Config;\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/index.ts",
                              "content": "export * from \"./schemas/user.schema\";\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/schemas/user.schema.ts",
                              "content": "import {\n  mysqlTable,\n  varchar,\n  boolean,\n  timestamp,\n  int,\n  json,\n  uniqueIndex,\n  index,\n  mysqlEnum\n} from \"drizzle-orm/mysql-core\";\nimport { timestamps } from \"./schema.helper\";\nimport { relations } from \"drizzle-orm\";\n\ninterface IAvatar {\n  public_id?: string;\n  url: string;\n  size?: number;\n}\n\nexport const users = mysqlTable(\n  \"users\",\n  {\n    id: int(\"id\").primaryKey().autoincrement(),\n    name: varchar(\"name\", { length: 100 }).notNull(),\n    email: varchar(\"email\", { length: 255 }).notNull().unique(),\n    password: varchar(\"password\", { length: 255 }),\n    role: mysqlEnum(\"role\", [\"user\", \"admin\"]).default(\"user\").notNull(),\n\n    provider: mysqlEnum(\"provider\", [\"local\", \"google\", \"github\"])\n      .default(\"local\")\n      .notNull(),\n    providerId: varchar(\"provider_id\", { length: 255 }),\n\n    avatar: json(\"avatar\").$type<IAvatar>(),\n\n    isEmailVerified: boolean(\"is_email_verified\").default(false).notNull(),\n    lastLoginAt: timestamp(\"last_login_at\"),\n    failedLoginAttempts: int(\"failed_login_attempts\").default(0).notNull(),\n    lockUntil: timestamp(\"lock_until\"),\n\n    isDeleted: boolean(\"is_deleted\").default(false).notNull(),\n    deletedAt: timestamp(\"deleted_at\"),\n    reActivateAvailableAt: timestamp(\"re_activate_available_at\"),\n\n    ...timestamps\n  },\n  table => [\n    uniqueIndex(\"email_idx\").on(table.email),\n    index(\"role_idx\").on(table.role),\n    index(\"is_deleted_idx\").on(table.isDeleted)\n  ]\n);\n\n//* relations:\nexport const usersRelations = relations(users, ({ many }) => ({\n  //TODO: relation with posts: user has many posts\n  //TODO: relation with post_likes: user has many likes\n  //TODO: relation with comment_likes: user has many comment likes\n  //TODO: relation with comments: user has many comments\n}));\n\n//? User type\nexport type User = typeof users.$inferSelect;\nexport type NewUser = typeof users.$inferInsert;\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/schemas/schema.helper.ts",
                              "content": "import { timestamp } from \"drizzle-orm/mysql-core\";\n\nexport const timestamps = {\n  createdAt: timestamp(\"created_at\").defaultNow().notNull(),\n  updatedAt: timestamp(\"updated_at\").defaultNow().onUpdateNow().notNull()\n};\n"
                            }
                          ]
                        },
                        "feature": {
                          "files": [
                            {
                              "type": "file",
                              "path": "drizzle.config.ts",
                              "content": "import { Config, defineConfig } from \"drizzle-kit\";\n\nexport default defineConfig({\n  out: \"./src/drizzle/migrations\",\n  schema: \"./src/drizzle/index.ts\",\n  dialect: \"mysql\",\n  dbCredentials: {\n    url: process.env.DATABASE_URL!\n  },\n  verbose: true,\n  strict: true\n}) satisfies Config;\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/index.ts",
                              "content": "export * from \"./schemas/user.schema\";\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/schemas/user.schema.ts",
                              "content": "import {\n  mysqlTable,\n  varchar,\n  boolean,\n  timestamp,\n  int,\n  json,\n  uniqueIndex,\n  index,\n  mysqlEnum\n} from \"drizzle-orm/mysql-core\";\nimport { timestamps } from \"./schema.helper\";\nimport { relations } from \"drizzle-orm\";\n\ninterface IAvatar {\n  public_id?: string;\n  url: string;\n  size?: number;\n}\n\nexport const users = mysqlTable(\n  \"users\",\n  {\n    id: int(\"id\").primaryKey().autoincrement(),\n    name: varchar(\"name\", { length: 100 }).notNull(),\n    email: varchar(\"email\", { length: 255 }).notNull().unique(),\n    password: varchar(\"password\", { length: 255 }),\n    role: mysqlEnum(\"role\", [\"user\", \"admin\"]).default(\"user\").notNull(),\n\n    provider: mysqlEnum(\"provider\", [\"local\", \"google\", \"github\"])\n      .default(\"local\")\n      .notNull(),\n    providerId: varchar(\"provider_id\", { length: 255 }),\n\n    avatar: json(\"avatar\").$type<IAvatar>(),\n\n    isEmailVerified: boolean(\"is_email_verified\").default(false).notNull(),\n    lastLoginAt: timestamp(\"last_login_at\"),\n    failedLoginAttempts: int(\"failed_login_attempts\").default(0).notNull(),\n    lockUntil: timestamp(\"lock_until\"),\n\n    isDeleted: boolean(\"is_deleted\").default(false).notNull(),\n    deletedAt: timestamp(\"deleted_at\"),\n    reActivateAvailableAt: timestamp(\"re_activate_available_at\"),\n\n    ...timestamps\n  },\n  table => [\n    uniqueIndex(\"email_idx\").on(table.email),\n    index(\"role_idx\").on(table.role),\n    index(\"is_deleted_idx\").on(table.isDeleted)\n  ]\n);\n\n//* relations:\nexport const usersRelations = relations(users, ({ many }) => ({\n  //TODO: relation with posts: user has many posts\n  //TODO: relation with post_likes: user has many likes\n  //TODO: relation with comment_likes: user has many comment likes\n  //TODO: relation with comments: user has many comments\n}));\n\n//? User type\nexport type User = typeof users.$inferSelect;\nexport type NewUser = typeof users.$inferInsert;\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/schemas/schema.helper.ts",
                              "content": "import { timestamp } from \"drizzle-orm/mysql-core\";\n\nexport const timestamps = {\n  createdAt: timestamp(\"created_at\").defaultNow().notNull(),\n  updatedAt: timestamp(\"updated_at\").defaultNow().onUpdateNow().notNull()\n};\n"
                            }
                          ]
                        }
                      }
                    },
                    "comment": {
                      "architectures": {
                        "mvc": {
                          "files": [
                            {
                              "type": "file",
                              "path": "drizzle.config.ts",
                              "content": "import { Config, defineConfig } from \"drizzle-kit\";\n\nexport default defineConfig({\n  out: \"./src/drizzle/migrations\",\n  schema: \"./src/drizzle/index.ts\",\n  dialect: \"mysql\",\n  dbCredentials: {\n    url: process.env.DATABASE_URL!\n  },\n  verbose: true,\n  strict: true\n}) satisfies Config;\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/index.ts",
                              "content": "export * from \"./schemas/comment.schema\";\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/schemas/schema.helper.ts",
                              "content": "import { timestamp } from \"drizzle-orm/mysql-core\";\n\nexport const timestamps = {\n  createdAt: timestamp(\"created_at\").defaultNow().notNull(),\n  updatedAt: timestamp(\"updated_at\").defaultNow().onUpdateNow().notNull()\n};\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/schemas/comment.schema.ts",
                              "content": "import { mysqlTable, int, text } from \"drizzle-orm/mysql-core\";\n\nimport { timestamps } from \"./schema.helper\";\nimport { relations } from \"drizzle-orm\";\n\nexport const comments = mysqlTable(\"comments\", {\n  id: int(\"id\").primaryKey().autoincrement(),\n\n  postId: int(\"post_id\")\n    // .references(() => posts.id),\n    .notNull(),\n\n  authorId: int(\"author_id\")\n    // .references(() => users.id),\n    .notNull(),\n\n  content: text(\"content\").notNull(),\n\n  parentCommentId: int(\"parent_comment_id\"),\n  ...timestamps\n});\n\n//* relations:\nexport const commentsRelations = relations(comments, ({ one, many }) => ({\n  //TODO: relation with posts: one comment belongs to one post\n  //TODO: relation with users: one comment belongs to one user\n  //TODO: relation with comments: one comment belongs to one parent comment\n  //TODO: relation with comments: one comment has many replies\n  //TODO: relation with comment_likes: one comment has many likes\n}));\n"
                            }
                          ]
                        },
                        "feature": {
                          "files": [
                            {
                              "type": "file",
                              "path": "drizzle.config.ts",
                              "content": "import { Config, defineConfig } from \"drizzle-kit\";\n\nexport default defineConfig({\n  out: \"./src/drizzle/migrations\",\n  schema: \"./src/drizzle/index.ts\",\n  dialect: \"mysql\",\n  dbCredentials: {\n    url: process.env.DATABASE_URL!\n  },\n  verbose: true,\n  strict: true\n}) satisfies Config;\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/index.ts",
                              "content": "export * from \"./schemas/comment.schema\";\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/schemas/schema.helper.ts",
                              "content": "import { timestamp } from \"drizzle-orm/mysql-core\";\n\nexport const timestamps = {\n  createdAt: timestamp(\"created_at\").defaultNow().notNull(),\n  updatedAt: timestamp(\"updated_at\").defaultNow().onUpdateNow().notNull()\n};\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/schemas/comment.schema.ts",
                              "content": "import { mysqlTable, int, text } from \"drizzle-orm/mysql-core\";\n\nimport { timestamps } from \"./schema.helper\";\nimport { relations } from \"drizzle-orm\";\n\nexport const comments = mysqlTable(\"comments\", {\n  id: int(\"id\").primaryKey().autoincrement(),\n\n  postId: int(\"post_id\")\n    // .references(() => posts.id),\n    .notNull(),\n\n  authorId: int(\"author_id\")\n    // .references(() => users.id),\n    .notNull(),\n\n  content: text(\"content\").notNull(),\n\n  parentCommentId: int(\"parent_comment_id\"),\n  ...timestamps\n});\n\n//* relations:\nexport const commentsRelations = relations(comments, ({ one, many }) => ({\n  //TODO: relation with posts: one comment belongs to one post\n  //TODO: relation with users: one comment belongs to one user\n  //TODO: relation with comments: one comment belongs to one parent comment\n  //TODO: relation with comments: one comment has many replies\n  //TODO: relation with comment_likes: one comment has many likes\n}));\n"
                            }
                          ]
                        }
                      }
                    },
                    "comment-like": {
                      "architectures": {
                        "mvc": {
                          "files": [
                            {
                              "type": "file",
                              "path": "drizzle.config.ts",
                              "content": "import { Config, defineConfig } from \"drizzle-kit\";\n\nexport default defineConfig({\n  out: \"./src/drizzle/migrations\",\n  schema: \"./src/drizzle/index.ts\",\n  dialect: \"mysql\",\n  dbCredentials: {\n    url: process.env.DATABASE_URL!\n  },\n  verbose: true,\n  strict: true\n}) satisfies Config;\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/index.ts",
                              "content": "export * from \"./schemas/comment-like.schema\";\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/schemas/schema.helper.ts",
                              "content": "import { timestamp } from \"drizzle-orm/mysql-core\";\n\nexport const timestamps = {\n  createdAt: timestamp(\"created_at\").defaultNow().notNull(),\n  updatedAt: timestamp(\"updated_at\").defaultNow().onUpdateNow().notNull()\n};\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/schemas/comment-like.schema.ts",
                              "content": "import { mysqlTable, int, uniqueIndex } from \"drizzle-orm/mysql-core\";\nimport { timestamps } from \"./schema.helper\";\nimport { relations } from \"drizzle-orm\";\n\nexport const commentLikes = mysqlTable(\n  \"comment_likes\",\n  {\n    userId: int(\"user_id\")\n      // .references(() => users.id),\n      .notNull(),\n\n    commentId: int(\"comment_id\")\n      // .references(() => comments.id),\n      .notNull(),\n\n    ...timestamps\n  },\n  table => [\n    uniqueIndex(\"unique_comment_like\").on(table.userId, table.commentId)\n  ]\n);\n\n//* relations:\nexport const commentLikesRelations = relations(commentLikes, ({ one }) => ({\n  //TODO: relation with users: one like belongs to one user\n  //TODO: relation with comments: one like belongs to one comment\n}));\n"
                            }
                          ]
                        },
                        "feature": {
                          "files": [
                            {
                              "type": "file",
                              "path": "drizzle.config.ts",
                              "content": "import { Config, defineConfig } from \"drizzle-kit\";\n\nexport default defineConfig({\n  out: \"./src/drizzle/migrations\",\n  schema: \"./src/drizzle/index.ts\",\n  dialect: \"mysql\",\n  dbCredentials: {\n    url: process.env.DATABASE_URL!\n  },\n  verbose: true,\n  strict: true\n}) satisfies Config;\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/index.ts",
                              "content": "export * from \"./schemas/comment-like.schema\";\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/schemas/schema.helper.ts",
                              "content": "import { timestamp } from \"drizzle-orm/mysql-core\";\n\nexport const timestamps = {\n  createdAt: timestamp(\"created_at\").defaultNow().notNull(),\n  updatedAt: timestamp(\"updated_at\").defaultNow().onUpdateNow().notNull()\n};\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/schemas/comment-like.schema.ts",
                              "content": "import { mysqlTable, int, uniqueIndex } from \"drizzle-orm/mysql-core\";\nimport { timestamps } from \"./schema.helper\";\nimport { relations } from \"drizzle-orm\";\n\nexport const commentLikes = mysqlTable(\n  \"comment_likes\",\n  {\n    userId: int(\"user_id\")\n      // .references(() => users.id),\n      .notNull(),\n\n    commentId: int(\"comment_id\")\n      // .references(() => comments.id),\n      .notNull(),\n\n    ...timestamps\n  },\n  table => [\n    uniqueIndex(\"unique_comment_like\").on(table.userId, table.commentId)\n  ]\n);\n\n//* relations:\nexport const commentLikesRelations = relations(commentLikes, ({ one }) => ({\n  //TODO: relation with users: one like belongs to one user\n  //TODO: relation with comments: one like belongs to one comment\n}));\n"
                            }
                          ]
                        }
                      }
                    },
                    "post": {
                      "architectures": {
                        "mvc": {
                          "files": [
                            {
                              "type": "file",
                              "path": "drizzle.config.ts",
                              "content": "import { Config, defineConfig } from \"drizzle-kit\";\n\nexport default defineConfig({\n  out: \"./src/drizzle/migrations\",\n  schema: \"./src/drizzle/index.ts\",\n  dialect: \"mysql\",\n  dbCredentials: {\n    url: process.env.DATABASE_URL!\n  },\n  verbose: true,\n  strict: true\n}) satisfies Config;\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/index.ts",
                              "content": "export * from \"./schemas/post.schema\";\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/schemas/schema.helper.ts",
                              "content": "import { timestamp } from \"drizzle-orm/mysql-core\";\n\nexport const timestamps = {\n  createdAt: timestamp(\"created_at\").defaultNow().notNull(),\n  updatedAt: timestamp(\"updated_at\").defaultNow().onUpdateNow().notNull()\n};\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/schemas/post.schema.ts",
                              "content": "import {\n  index,\n  int,\n  json,\n  mysqlEnum,\n  mysqlTable,\n  timestamp,\n  uniqueIndex,\n  varchar\n} from \"drizzle-orm/mysql-core\";\nimport { timestamps } from \"./schema.helper\";\nimport { relations } from \"drizzle-orm\";\n\nconst POST_STATUSES = [\"draft\", \"published\", \"archived\"] as const;\n\ninterface IFile {\n  public_id: string;\n  url: string;\n  size: number;\n}\n\nexport const posts = mysqlTable(\n  \"posts\",\n  {\n    id: int().primaryKey().autoincrement(),\n\n    title: varchar(\"title\", { length: 100 }).notNull(),\n    slug: varchar(\"slug\").notNull().unique(),\n    content: varchar(\"description\"),\n    excerpt: varchar(\"excerpt\"), // Short summary\n\n    authorId: int(\"author_id\")\n      // .references(() => users.id, { onDelete: \"cascade\" })\n      .notNull(), // Reference to User\n    categoryId: int(\"category_id\")\n      // .references(() => users.id, { onDelete: \"cascade\" })\n      .notNull(),\n\n    tags: json(\"tags\").$type<string[]>(),\n    featuredImage: json(\"featured_image\").$type<IFile>(),\n    views: int(\"views\").default(0).notNull(),\n\n    status: mysqlEnum(\"status\", POST_STATUSES).default(\"draft\").notNull(),\n    publishedAt: timestamp(\"published_at\"),\n\n    ...timestamps\n  },\n  table => [\n    uniqueIndex(\"author_id_slug_unique\").on(table.authorId, table.slug),\n    index(\"category_idx\").on(table.categoryId),\n    index(\"status_idx\").on(table.status)\n  ]\n);\n\n//* relations:\nexport const postsRelations = relations(posts, ({ one, many }) => ({\n  //?TODO: relation with users: post belongs to one user\n  //?TODO: relation with categories: Post belongs to one category\n  //?TODO: relation with post_likes: one post has many likes\n}));\n\nexport type NewPost = typeof posts.$inferInsert;\nexport type Post = typeof posts.$inferSelect;\n"
                            }
                          ]
                        },
                        "feature": {
                          "files": [
                            {
                              "type": "file",
                              "path": "drizzle.config.ts",
                              "content": "import { Config, defineConfig } from \"drizzle-kit\";\n\nexport default defineConfig({\n  out: \"./src/drizzle/migrations\",\n  schema: \"./src/drizzle/index.ts\",\n  dialect: \"mysql\",\n  dbCredentials: {\n    url: process.env.DATABASE_URL!\n  },\n  verbose: true,\n  strict: true\n}) satisfies Config;\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/index.ts",
                              "content": "export * from \"./schemas/post.schema\";\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/schemas/schema.helper.ts",
                              "content": "import { timestamp } from \"drizzle-orm/mysql-core\";\n\nexport const timestamps = {\n  createdAt: timestamp(\"created_at\").defaultNow().notNull(),\n  updatedAt: timestamp(\"updated_at\").defaultNow().onUpdateNow().notNull()\n};\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/schemas/post.schema.ts",
                              "content": "import {\n  index,\n  int,\n  json,\n  mysqlEnum,\n  mysqlTable,\n  timestamp,\n  uniqueIndex,\n  varchar\n} from \"drizzle-orm/mysql-core\";\nimport { timestamps } from \"./schema.helper\";\nimport { relations } from \"drizzle-orm\";\n\nconst POST_STATUSES = [\"draft\", \"published\", \"archived\"] as const;\n\ninterface IFile {\n  public_id: string;\n  url: string;\n  size: number;\n}\n\nexport const posts = mysqlTable(\n  \"posts\",\n  {\n    id: int().primaryKey().autoincrement(),\n\n    title: varchar(\"title\", { length: 100 }).notNull(),\n    slug: varchar(\"slug\").notNull().unique(),\n    content: varchar(\"description\"),\n    excerpt: varchar(\"excerpt\"), // Short summary\n\n    authorId: int(\"author_id\")\n      // .references(() => users.id, { onDelete: \"cascade\" })\n      .notNull(), // Reference to User\n    categoryId: int(\"category_id\")\n      // .references(() => users.id, { onDelete: \"cascade\" })\n      .notNull(),\n\n    tags: json(\"tags\").$type<string[]>(),\n    featuredImage: json(\"featured_image\").$type<IFile>(),\n    views: int(\"views\").default(0).notNull(),\n\n    status: mysqlEnum(\"status\", POST_STATUSES).default(\"draft\").notNull(),\n    publishedAt: timestamp(\"published_at\"),\n\n    ...timestamps\n  },\n  table => [\n    uniqueIndex(\"author_id_slug_unique\").on(table.authorId, table.slug),\n    index(\"category_idx\").on(table.categoryId),\n    index(\"status_idx\").on(table.status)\n  ]\n);\n\n//* relations:\nexport const postsRelations = relations(posts, ({ one, many }) => ({\n  //?TODO: relation with users: post belongs to one user\n  //?TODO: relation with categories: Post belongs to one category\n  //?TODO: relation with post_likes: one post has many likes\n}));\n\nexport type NewPost = typeof posts.$inferInsert;\nexport type Post = typeof posts.$inferSelect;\n"
                            }
                          ]
                        }
                      }
                    },
                    "post-like": {
                      "architectures": {
                        "mvc": {
                          "files": [
                            {
                              "type": "file",
                              "path": "drizzle.config.ts",
                              "content": "import { Config, defineConfig } from \"drizzle-kit\";\n\nexport default defineConfig({\n  out: \"./src/drizzle/migrations\",\n  schema: \"./src/drizzle/index.ts\",\n  dialect: \"mysql\",\n  dbCredentials: {\n    url: process.env.DATABASE_URL!\n  },\n  verbose: true,\n  strict: true\n}) satisfies Config;\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/index.ts",
                              "content": "export * from \"./schemas/post-like.schema\";\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/schemas/schema.helper.ts",
                              "content": "import { timestamp } from \"drizzle-orm/mysql-core\";\n\nexport const timestamps = {\n  createdAt: timestamp(\"created_at\").defaultNow().notNull(),\n  updatedAt: timestamp(\"updated_at\").defaultNow().onUpdateNow().notNull()\n};\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/schemas/post-like.schema.ts",
                              "content": "import { mysqlTable, int, uniqueIndex } from \"drizzle-orm/mysql-core\";\nimport { timestamps } from \"./schema.helper\";\nimport { relations } from \"drizzle-orm\";\n\nexport const postLikes = mysqlTable(\n  \"post_likes\",\n  {\n    userId: int(\"user_id\")\n      // .references(() => users.id, { onDelete: \"cascade\" })\n      .notNull(),\n\n    postId: int(\"post_id\")\n      // .references(() => posts.id, { onDelete: \"cascade\" })\n      .notNull(),\n    ...timestamps\n  },\n  table => [uniqueIndex(\"unique_like\").on(table.userId, table.postId)]\n);\n\n//* relations:\nexport const postLikesRelations = relations(postLikes, ({ one }) => ({\n  //TODO: relation with users: one like belongs to one user\n  //TODO: relation with posts: one like belongs to one post\n}));\n"
                            }
                          ]
                        },
                        "feature": {
                          "files": [
                            {
                              "type": "file",
                              "path": "drizzle.config.ts",
                              "content": "import { Config, defineConfig } from \"drizzle-kit\";\n\nexport default defineConfig({\n  out: \"./src/drizzle/migrations\",\n  schema: \"./src/drizzle/index.ts\",\n  dialect: \"mysql\",\n  dbCredentials: {\n    url: process.env.DATABASE_URL!\n  },\n  verbose: true,\n  strict: true\n}) satisfies Config;\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/index.ts",
                              "content": "export * from \"./schemas/post-like.schema\";\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/schemas/schema.helper.ts",
                              "content": "import { timestamp } from \"drizzle-orm/mysql-core\";\n\nexport const timestamps = {\n  createdAt: timestamp(\"created_at\").defaultNow().notNull(),\n  updatedAt: timestamp(\"updated_at\").defaultNow().onUpdateNow().notNull()\n};\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/schemas/post-like.schema.ts",
                              "content": "import { mysqlTable, int, uniqueIndex } from \"drizzle-orm/mysql-core\";\nimport { timestamps } from \"./schema.helper\";\nimport { relations } from \"drizzle-orm\";\n\nexport const postLikes = mysqlTable(\n  \"post_likes\",\n  {\n    userId: int(\"user_id\")\n      // .references(() => users.id, { onDelete: \"cascade\" })\n      .notNull(),\n\n    postId: int(\"post_id\")\n      // .references(() => posts.id, { onDelete: \"cascade\" })\n      .notNull(),\n    ...timestamps\n  },\n  table => [uniqueIndex(\"unique_like\").on(table.userId, table.postId)]\n);\n\n//* relations:\nexport const postLikesRelations = relations(postLikes, ({ one }) => ({\n  //TODO: relation with users: one like belongs to one user\n  //TODO: relation with posts: one like belongs to one post\n}));\n"
                            }
                          ]
                        }
                      }
                    }
                  },
                  "dependencies": {
                    "runtime": [
                      "mysql2",
                      "drizzle-orm"
                    ],
                    "dev": [
                      "drizzle-kit"
                    ]
                  }
                }
              }
            },
            "postgresql": {
              "orms": {
                "drizzle": {
                  "templates": {
                    "index": {
                      "architectures": {
                        "mvc": {
                          "files": [
                            {
                              "type": "file",
                              "path": "drizzle.config.ts",
                              "content": "import { Config, defineConfig } from \"drizzle-kit\";\n\nexport default defineConfig({\n  out: \"./src/drizzle/migrations\",\n  schema: \"./src/drizzle/index.ts\",\n  dialect: \"postgresql\",\n  dbCredentials: {\n    url: process.env.DATABASE_URL!\n  },\n  verbose: true,\n  strict: true\n}) satisfies Config;\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/index.ts",
                              "content": "export * from \"./schemas/user.schema\";\nexport * from \"./schemas/post.schema\";\nexport * from \"./schemas/category.schema\";\nexport * from \"./schemas/comment.schema\";\nexport * from \"./schemas/comment-like.schema\";\nexport * from \"./schemas/post-like.schema\";\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/schemas/user.schema.ts",
                              "content": "import {\n  pgTable,\n  varchar,\n  boolean,\n  timestamp,\n  integer,\n  json,\n  uniqueIndex,\n  index,\n  pgEnum,\n  serial\n} from \"drizzle-orm/pg-core\";\nimport { timestamps } from \"./schema.helper\";\nimport { relations } from \"drizzle-orm\";\nimport { posts } from \"./post.schema\";\nimport { postLikes } from \"./post-like.schema\";\nimport { commentLikes } from \"./comment-like.schema\";\nimport { comments } from \"./comment.schema\";\n\ninterface IAvatar {\n  public_id?: string;\n  url: string;\n  size?: number;\n}\n\nconst providerEnum = pgEnum(\"provider\", [\"local\", \"google\", \"github\"]);\n\nconst roleEnum = pgEnum(\"role\", [\"user\", \"admin\"]);\n\nexport const users = pgTable(\n  \"users\",\n  {\n    id: serial(\"id\").primaryKey(),\n    name: varchar(\"name\", { length: 100 }).notNull(),\n    email: varchar(\"email\", { length: 255 }).notNull().unique(),\n    password: varchar(\"password\", { length: 255 }),\n    role: roleEnum(\"role\").default(\"user\").notNull(),\n\n    provider: providerEnum(\"provider\").default(\"local\").notNull(),\n    providerId: varchar(\"provider_id\", { length: 255 }),\n\n    avatar: json(\"avatar\").$type<IAvatar>(),\n\n    isEmailVerified: boolean(\"is_email_verified\").default(false).notNull(),\n    lastLoginAt: timestamp(\"last_login_at\"),\n    failedLoginAttempts: integer(\"failed_login_attempts\").default(0).notNull(),\n    lockUntil: timestamp(\"lock_until\"),\n\n    isDeleted: boolean(\"is_deleted\").default(false).notNull(),\n    deletedAt: timestamp(\"deleted_at\"),\n    reActivateAvailableAt: timestamp(\"re_activate_available_at\"),\n\n    ...timestamps\n  },\n  table => [\n    uniqueIndex(\"email_idx\").on(table.email),\n    index(\"role_idx\").on(table.role),\n    index(\"is_deleted_idx\").on(table.isDeleted)\n  ]\n);\n\n//* relations:\nexport const usersRelations = relations(users, ({ many }) => ({\n  //? relation with posts: user has many posts\n  posts: many(posts),\n\n  //? relation with post_likes: user has many likes\n  postLikes: many(postLikes),\n\n  //? relation with comment_likes: user has many comment likes\n  commentLikes: many(commentLikes),\n\n  //? relation with comments: user has many comments\n  comments: many(comments)\n}));\n\n//? User type\nexport type User = typeof users.$inferSelect;\nexport type NewUser = typeof users.$inferInsert;\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/schemas/schema.helper.ts",
                              "content": "import { timestamp } from \"drizzle-orm/pg-core\";\n\nexport const timestamps = {\n  createdAt: timestamp(\"created_at\").defaultNow().notNull(),\n  updatedAt: timestamp(\"updated_at\")\n    .defaultNow()\n    .$onUpdate(() => new Date())\n    .notNull()\n};\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/schemas/post.schema.ts",
                              "content": "import {\n  index,\n  integer,\n  json,\n  pgEnum,\n  pgTable,\n  serial,\n  timestamp,\n  uniqueIndex,\n  varchar\n} from \"drizzle-orm/pg-core\";\nimport { timestamps } from \"./schema.helper\";\nimport { users } from \"./user.schema\";\nimport { relations } from \"drizzle-orm\";\nimport { categories } from \"./category.schema\";\nimport { postLikes } from \"./post-like.schema\";\n\nconst POST_STATUSES = [\"draft\", \"published\", \"archived\"] as const;\n\ninterface IFile {\n  public_id: string;\n  url: string;\n  size: number;\n}\n\nconst statusEnum = pgEnum(\"post_status\", POST_STATUSES);\n\nexport const posts = pgTable(\n  \"posts\",\n  {\n    id: serial().primaryKey(),\n\n    title: varchar(\"title\", { length: 100 }).notNull(),\n    slug: varchar(\"slug\").notNull().unique(),\n    content: varchar(\"description\"),\n    excerpt: varchar(\"excerpt\"), // Short summary\n\n    authorId: integer(\"author_id\")\n      .references(() => users.id, { onDelete: \"cascade\" })\n      .notNull(), // Reference to User\n    categoryId: integer(\"category_id\")\n      .references(() => users.id, { onDelete: \"cascade\" })\n      .notNull(),\n\n    tags: json(\"tags\").$type<string[]>(),\n    featuredImage: json(\"featured_image\").$type<IFile>(),\n    views: integer(\"views\").default(0).notNull(),\n\n    status: statusEnum(\"status\").default(\"draft\").notNull(),\n    publishedAt: timestamp(\"published_at\"),\n\n    ...timestamps\n  },\n  table => [\n    uniqueIndex(\"author_id_slug_unique\").on(table.authorId, table.slug),\n    index(\"category_idx\").on(table.categoryId),\n    index(\"status_idx\").on(table.status)\n  ]\n);\n\n//* relations:\nexport const postsRelations = relations(posts, ({ one, many }) => ({\n  //? relation with users: post belongs to one user\n  author: one(users, {\n    fields: [posts.authorId],\n    references: [users.id]\n  }),\n\n  //? relation with categories: Post belongs to one category\n  category: one(categories, {\n    fields: [posts.categoryId],\n    references: [categories.id]\n  }),\n\n  //? relation with post_likes: one post has many likes\n  postLikes: many(postLikes)\n}));\n\nexport type NewPost = typeof posts.$inferInsert;\nexport type Post = typeof posts.$inferSelect;\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/schemas/post-like.schema.ts",
                              "content": "import { pgTable, integer, uniqueIndex } from \"drizzle-orm/pg-core\";\nimport { users } from \"./user.schema\";\nimport { posts } from \"./post.schema\";\nimport { timestamps } from \"./schema.helper\";\nimport { relations } from \"drizzle-orm\";\n\nexport const postLikes = pgTable(\n  \"post_likes\",\n  {\n    userId: integer(\"user_id\")\n      .references(() => users.id, { onDelete: \"cascade\" })\n      .notNull(),\n\n    postId: integer(\"post_id\")\n      .references(() => posts.id, { onDelete: \"cascade\" })\n      .notNull(),\n    ...timestamps\n  },\n  table => [uniqueIndex(\"unique_like\").on(table.userId, table.postId)]\n);\n\n//* relations:\nexport const postLikesRelations = relations(postLikes, ({ one }) => ({\n  //? relation with users: one like belongs to one user\n  user: one(users, {\n    fields: [postLikes.userId],\n    references: [users.id]\n  }),\n\n  //? relation with posts: one like belongs to one post\n  post: one(posts, {\n    fields: [postLikes.postId],\n    references: [posts.id]\n  })\n}));\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/schemas/comment.schema.ts",
                              "content": "import { pgTable, integer, text } from \"drizzle-orm/pg-core\";\n\nimport { posts } from \"./post.schema\";\nimport { users } from \"./user.schema\";\nimport { timestamps } from \"./schema.helper\";\nimport { relations } from \"drizzle-orm\";\nimport { commentLikes } from \"./comment-like.schema\";\n\nexport const comments = pgTable(\"comments\", {\n  id: integer(\"id\").primaryKey(),\n\n  postId: integer(\"post_id\")\n    .notNull()\n    .references(() => posts.id),\n\n  authorId: integer(\"author_id\")\n    .notNull()\n    .references(() => users.id),\n\n  content: text(\"content\").notNull(),\n\n  parentCommentId: integer(\"parent_comment_id\"),\n  ...timestamps\n});\n\n//* relations:\nexport const commentsRelations = relations(comments, ({ one, many }) => ({\n  //? relation with posts: one comment belongs to one post\n  post: one(posts, {\n    fields: [comments.postId],\n    references: [posts.id]\n  }),\n\n  //? relation with users: one comment belongs to one user\n  author: one(users, {\n    fields: [comments.authorId],\n    references: [users.id]\n  }),\n\n  //? relation with comments: one comment belongs to one parent comment\n  parentComment: one(comments, {\n    fields: [comments.parentCommentId],\n    references: [comments.id]\n  }),\n\n  //? relation with comments: one comment has many replies\n  replies: many(comments),\n\n  //? relation with comment_likes: one comment has many likes\n  likes: many(commentLikes)\n}));\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/schemas/comment-like.schema.ts",
                              "content": "import { pgTable, integer, uniqueIndex } from \"drizzle-orm/pg-core\";\nimport { comments } from \"./comment.schema\";\nimport { users } from \"./user.schema\";\nimport { timestamps } from \"./schema.helper\";\nimport { relations } from \"drizzle-orm\";\n\nexport const commentLikes = pgTable(\n  \"comment_likes\",\n  {\n    userId: integer(\"user_id\")\n      .notNull()\n      .references(() => users.id),\n\n    commentId: integer(\"comment_id\")\n      .notNull()\n      .references(() => comments.id),\n\n    ...timestamps\n  },\n  table => [\n    uniqueIndex(\"unique_comment_like\").on(table.userId, table.commentId)\n  ]\n);\n\n//* relations:\nexport const commentLikesRelations = relations(commentLikes, ({ one }) => ({\n  //? relation with users: one like belongs to one user\n  user: one(users, {\n    fields: [commentLikes.userId],\n    references: [users.id]\n  }),\n\n  //? relation with comments: one like belongs to one comment\n  comment: one(comments, {\n    fields: [commentLikes.commentId],\n    references: [comments.id]\n  })\n}));\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/schemas/category.schema.ts",
                              "content": "import { serial, pgTable, uniqueIndex, varchar } from \"drizzle-orm/pg-core\";\nimport { timestamps } from \"./schema.helper\";\nimport { relations } from \"drizzle-orm\";\nimport { posts } from \"./post.schema\";\n\nexport const categories = pgTable(\n  \"categories\",\n  {\n    id: serial(\"id\").primaryKey(),\n    name: varchar(\"name\", { length: 100 }).notNull(),\n    slug: varchar(\"slug\").notNull().unique(),\n    description: varchar(\"description\"),\n\n    ...timestamps\n  },\n  table => [\n    uniqueIndex(\"slug_idx\").on(table.slug),\n    uniqueIndex(\"name_idx\").on(table.name)\n  ]\n);\n\n//? relation with posts: one category has many posts\nexport const categoriesRelations = relations(categories, ({ many }) => ({\n  posts: many(posts)\n}));\n\nexport type NewCategory = typeof categories.$inferInsert;\nexport type Category = typeof categories.$inferSelect;\n"
                            }
                          ]
                        },
                        "feature": {
                          "files": [
                            {
                              "type": "file",
                              "path": "drizzle.config.ts",
                              "content": "import { Config, defineConfig } from \"drizzle-kit\";\n\nexport default defineConfig({\n  out: \"./src/drizzle/migrations\",\n  schema: \"./src/drizzle/index.ts\",\n  dialect: \"postgresql\",\n  dbCredentials: {\n    url: process.env.DATABASE_URL!\n  },\n  verbose: true,\n  strict: true\n}) satisfies Config;\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/index.ts",
                              "content": "export * from \"./schemas/user.schema\";\nexport * from \"./schemas/post.schema\";\nexport * from \"./schemas/category.schema\";\nexport * from \"./schemas/comment.schema\";\nexport * from \"./schemas/comment-like.schema\";\nexport * from \"./schemas/post-like.schema\";\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/schemas/user.schema.ts",
                              "content": "import {\n  pgTable,\n  varchar,\n  boolean,\n  timestamp,\n  integer,\n  json,\n  uniqueIndex,\n  index,\n  pgEnum,\n  serial\n} from \"drizzle-orm/pg-core\";\nimport { timestamps } from \"./schema.helper\";\nimport { relations } from \"drizzle-orm\";\nimport { posts } from \"./post.schema\";\nimport { postLikes } from \"./post-like.schema\";\nimport { commentLikes } from \"./comment-like.schema\";\nimport { comments } from \"./comment.schema\";\n\ninterface IAvatar {\n  public_id?: string;\n  url: string;\n  size?: number;\n}\n\nconst providerEnum = pgEnum(\"provider\", [\"local\", \"google\", \"github\"]);\n\nconst roleEnum = pgEnum(\"role\", [\"user\", \"admin\"]);\n\nexport const users = pgTable(\n  \"users\",\n  {\n    id: serial(\"id\").primaryKey(),\n    name: varchar(\"name\", { length: 100 }).notNull(),\n    email: varchar(\"email\", { length: 255 }).notNull().unique(),\n    password: varchar(\"password\", { length: 255 }),\n    role: roleEnum(\"role\").default(\"user\").notNull(),\n\n    provider: providerEnum(\"provider\").default(\"local\").notNull(),\n    providerId: varchar(\"provider_id\", { length: 255 }),\n\n    avatar: json(\"avatar\").$type<IAvatar>(),\n\n    isEmailVerified: boolean(\"is_email_verified\").default(false).notNull(),\n    lastLoginAt: timestamp(\"last_login_at\"),\n    failedLoginAttempts: integer(\"failed_login_attempts\").default(0).notNull(),\n    lockUntil: timestamp(\"lock_until\"),\n\n    isDeleted: boolean(\"is_deleted\").default(false).notNull(),\n    deletedAt: timestamp(\"deleted_at\"),\n    reActivateAvailableAt: timestamp(\"re_activate_available_at\"),\n\n    ...timestamps\n  },\n  table => [\n    uniqueIndex(\"email_idx\").on(table.email),\n    index(\"role_idx\").on(table.role),\n    index(\"is_deleted_idx\").on(table.isDeleted)\n  ]\n);\n\n//* relations:\nexport const usersRelations = relations(users, ({ many }) => ({\n  //? relation with posts: user has many posts\n  posts: many(posts),\n\n  //? relation with post_likes: user has many likes\n  postLikes: many(postLikes),\n\n  //? relation with comment_likes: user has many comment likes\n  commentLikes: many(commentLikes),\n\n  //? relation with comments: user has many comments\n  comments: many(comments)\n}));\n\n//? User type\nexport type User = typeof users.$inferSelect;\nexport type NewUser = typeof users.$inferInsert;\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/schemas/schema.helper.ts",
                              "content": "import { timestamp } from \"drizzle-orm/pg-core\";\n\nexport const timestamps = {\n  createdAt: timestamp(\"created_at\").defaultNow().notNull(),\n  updatedAt: timestamp(\"updated_at\")\n    .defaultNow()\n    .$onUpdate(() => new Date())\n    .notNull()\n};\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/schemas/post.schema.ts",
                              "content": "import {\n  index,\n  integer,\n  json,\n  pgEnum,\n  pgTable,\n  serial,\n  timestamp,\n  uniqueIndex,\n  varchar\n} from \"drizzle-orm/pg-core\";\nimport { timestamps } from \"./schema.helper\";\nimport { users } from \"./user.schema\";\nimport { relations } from \"drizzle-orm\";\nimport { categories } from \"./category.schema\";\nimport { postLikes } from \"./post-like.schema\";\n\nconst POST_STATUSES = [\"draft\", \"published\", \"archived\"] as const;\n\ninterface IFile {\n  public_id: string;\n  url: string;\n  size: number;\n}\n\nconst statusEnum = pgEnum(\"post_status\", POST_STATUSES);\n\nexport const posts = pgTable(\n  \"posts\",\n  {\n    id: serial().primaryKey(),\n\n    title: varchar(\"title\", { length: 100 }).notNull(),\n    slug: varchar(\"slug\").notNull().unique(),\n    content: varchar(\"description\"),\n    excerpt: varchar(\"excerpt\"), // Short summary\n\n    authorId: integer(\"author_id\")\n      .references(() => users.id, { onDelete: \"cascade\" })\n      .notNull(), // Reference to User\n    categoryId: integer(\"category_id\")\n      .references(() => users.id, { onDelete: \"cascade\" })\n      .notNull(),\n\n    tags: json(\"tags\").$type<string[]>(),\n    featuredImage: json(\"featured_image\").$type<IFile>(),\n    views: integer(\"views\").default(0).notNull(),\n\n    status: statusEnum(\"status\").default(\"draft\").notNull(),\n    publishedAt: timestamp(\"published_at\"),\n\n    ...timestamps\n  },\n  table => [\n    uniqueIndex(\"author_id_slug_unique\").on(table.authorId, table.slug),\n    index(\"category_idx\").on(table.categoryId),\n    index(\"status_idx\").on(table.status)\n  ]\n);\n\n//* relations:\nexport const postsRelations = relations(posts, ({ one, many }) => ({\n  //? relation with users: post belongs to one user\n  author: one(users, {\n    fields: [posts.authorId],\n    references: [users.id]\n  }),\n\n  //? relation with categories: Post belongs to one category\n  category: one(categories, {\n    fields: [posts.categoryId],\n    references: [categories.id]\n  }),\n\n  //? relation with post_likes: one post has many likes\n  postLikes: many(postLikes)\n}));\n\nexport type NewPost = typeof posts.$inferInsert;\nexport type Post = typeof posts.$inferSelect;\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/schemas/post-like.schema.ts",
                              "content": "import { pgTable, integer, uniqueIndex } from \"drizzle-orm/pg-core\";\nimport { users } from \"./user.schema\";\nimport { posts } from \"./post.schema\";\nimport { timestamps } from \"./schema.helper\";\nimport { relations } from \"drizzle-orm\";\n\nexport const postLikes = pgTable(\n  \"post_likes\",\n  {\n    userId: integer(\"user_id\")\n      .references(() => users.id, { onDelete: \"cascade\" })\n      .notNull(),\n\n    postId: integer(\"post_id\")\n      .references(() => posts.id, { onDelete: \"cascade\" })\n      .notNull(),\n    ...timestamps\n  },\n  table => [uniqueIndex(\"unique_like\").on(table.userId, table.postId)]\n);\n\n//* relations:\nexport const postLikesRelations = relations(postLikes, ({ one }) => ({\n  //? relation with users: one like belongs to one user\n  user: one(users, {\n    fields: [postLikes.userId],\n    references: [users.id]\n  }),\n\n  //? relation with posts: one like belongs to one post\n  post: one(posts, {\n    fields: [postLikes.postId],\n    references: [posts.id]\n  })\n}));\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/schemas/comment.schema.ts",
                              "content": "import { pgTable, integer, text } from \"drizzle-orm/pg-core\";\n\nimport { posts } from \"./post.schema\";\nimport { users } from \"./user.schema\";\nimport { timestamps } from \"./schema.helper\";\nimport { relations } from \"drizzle-orm\";\nimport { commentLikes } from \"./comment-like.schema\";\n\nexport const comments = pgTable(\"comments\", {\n  id: integer(\"id\").primaryKey(),\n\n  postId: integer(\"post_id\")\n    .notNull()\n    .references(() => posts.id),\n\n  authorId: integer(\"author_id\")\n    .notNull()\n    .references(() => users.id),\n\n  content: text(\"content\").notNull(),\n\n  parentCommentId: integer(\"parent_comment_id\"),\n  ...timestamps\n});\n\n//* relations:\nexport const commentsRelations = relations(comments, ({ one, many }) => ({\n  //? relation with posts: one comment belongs to one post\n  post: one(posts, {\n    fields: [comments.postId],\n    references: [posts.id]\n  }),\n\n  //? relation with users: one comment belongs to one user\n  author: one(users, {\n    fields: [comments.authorId],\n    references: [users.id]\n  }),\n\n  //? relation with comments: one comment belongs to one parent comment\n  parentComment: one(comments, {\n    fields: [comments.parentCommentId],\n    references: [comments.id]\n  }),\n\n  //? relation with comments: one comment has many replies\n  replies: many(comments),\n\n  //? relation with comment_likes: one comment has many likes\n  likes: many(commentLikes)\n}));\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/schemas/comment-like.schema.ts",
                              "content": "import { pgTable, integer, uniqueIndex } from \"drizzle-orm/pg-core\";\nimport { comments } from \"./comment.schema\";\nimport { users } from \"./user.schema\";\nimport { timestamps } from \"./schema.helper\";\nimport { relations } from \"drizzle-orm\";\n\nexport const commentLikes = pgTable(\n  \"comment_likes\",\n  {\n    userId: integer(\"user_id\")\n      .notNull()\n      .references(() => users.id),\n\n    commentId: integer(\"comment_id\")\n      .notNull()\n      .references(() => comments.id),\n\n    ...timestamps\n  },\n  table => [\n    uniqueIndex(\"unique_comment_like\").on(table.userId, table.commentId)\n  ]\n);\n\n//* relations:\nexport const commentLikesRelations = relations(commentLikes, ({ one }) => ({\n  //? relation with users: one like belongs to one user\n  user: one(users, {\n    fields: [commentLikes.userId],\n    references: [users.id]\n  }),\n\n  //? relation with comments: one like belongs to one comment\n  comment: one(comments, {\n    fields: [commentLikes.commentId],\n    references: [comments.id]\n  })\n}));\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/schemas/category.schema.ts",
                              "content": "import { serial, pgTable, uniqueIndex, varchar } from \"drizzle-orm/pg-core\";\nimport { timestamps } from \"./schema.helper\";\nimport { relations } from \"drizzle-orm\";\nimport { posts } from \"./post.schema\";\n\nexport const categories = pgTable(\n  \"categories\",\n  {\n    id: serial(\"id\").primaryKey(),\n    name: varchar(\"name\", { length: 100 }).notNull(),\n    slug: varchar(\"slug\").notNull().unique(),\n    description: varchar(\"description\"),\n\n    ...timestamps\n  },\n  table => [\n    uniqueIndex(\"slug_idx\").on(table.slug),\n    uniqueIndex(\"name_idx\").on(table.name)\n  ]\n);\n\n//? relation with posts: one category has many posts\nexport const categoriesRelations = relations(categories, ({ many }) => ({\n  posts: many(posts)\n}));\n\nexport type NewCategory = typeof categories.$inferInsert;\nexport type Category = typeof categories.$inferSelect;\n"
                            }
                          ]
                        }
                      }
                    },
                    "category": {
                      "architectures": {
                        "mvc": {
                          "files": [
                            {
                              "type": "file",
                              "path": "drizzle.config.ts",
                              "content": "import { Config, defineConfig } from \"drizzle-kit\";\n\nexport default defineConfig({\n  out: \"./src/drizzle/migrations\",\n  schema: \"./src/drizzle/index.ts\",\n  dialect: \"postgresql\",\n  dbCredentials: {\n    url: process.env.DATABASE_URL!\n  },\n  verbose: true,\n  strict: true\n}) satisfies Config;\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/index.ts",
                              "content": "export * from \"./schemas/category.schema\";\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/schemas/schema.helper.ts",
                              "content": "import { timestamp } from \"drizzle-orm/pg-core\";\n\nexport const timestamps = {\n  createdAt: timestamp(\"created_at\").defaultNow().notNull(),\n  updatedAt: timestamp(\"updated_at\")\n    .defaultNow()\n    .$onUpdate(() => new Date())\n    .notNull()\n};\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/schemas/category.schema.ts",
                              "content": "import { serial, pgTable, uniqueIndex, varchar } from \"drizzle-orm/pg-core\";\nimport { timestamps } from \"./schema.helper\";\nimport { relations } from \"drizzle-orm\";\n\nexport const categories = pgTable(\n  \"categories\",\n  {\n    id: serial(\"id\").primaryKey(),\n    name: varchar(\"name\", { length: 100 }).notNull(),\n    slug: varchar(\"slug\").notNull().unique(),\n    description: varchar(\"description\"),\n\n    ...timestamps\n  },\n  table => [\n    uniqueIndex(\"slug_idx\").on(table.slug),\n    uniqueIndex(\"name_idx\").on(table.name)\n  ]\n);\n\n//TODO: relation with posts: one category has many posts\nexport const categoriesRelations = relations(categories, ({ many }) => ({}));\n\nexport type NewCategory = typeof categories.$inferInsert;\nexport type Category = typeof categories.$inferSelect;\n"
                            }
                          ]
                        },
                        "feature": {
                          "files": [
                            {
                              "type": "file",
                              "path": "drizzle.config.ts",
                              "content": "import { Config, defineConfig } from \"drizzle-kit\";\n\nexport default defineConfig({\n  out: \"./src/drizzle/migrations\",\n  schema: \"./src/drizzle/index.ts\",\n  dialect: \"postgresql\",\n  dbCredentials: {\n    url: process.env.DATABASE_URL!\n  },\n  verbose: true,\n  strict: true\n}) satisfies Config;\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/index.ts",
                              "content": "export * from \"./schemas/category.schema\";\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/schemas/schema.helper.ts",
                              "content": "import { timestamp } from \"drizzle-orm/pg-core\";\n\nexport const timestamps = {\n  createdAt: timestamp(\"created_at\").defaultNow().notNull(),\n  updatedAt: timestamp(\"updated_at\")\n    .defaultNow()\n    .$onUpdate(() => new Date())\n    .notNull()\n};\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/schemas/category.schema.ts",
                              "content": "import { serial, pgTable, uniqueIndex, varchar } from \"drizzle-orm/pg-core\";\nimport { timestamps } from \"./schema.helper\";\nimport { relations } from \"drizzle-orm\";\n\nexport const categories = pgTable(\n  \"categories\",\n  {\n    id: serial(\"id\").primaryKey(),\n    name: varchar(\"name\", { length: 100 }).notNull(),\n    slug: varchar(\"slug\").notNull().unique(),\n    description: varchar(\"description\"),\n\n    ...timestamps\n  },\n  table => [\n    uniqueIndex(\"slug_idx\").on(table.slug),\n    uniqueIndex(\"name_idx\").on(table.name)\n  ]\n);\n\n//TODO: relation with posts: one category has many posts\nexport const categoriesRelations = relations(categories, ({ many }) => ({}));\n\nexport type NewCategory = typeof categories.$inferInsert;\nexport type Category = typeof categories.$inferSelect;\n"
                            }
                          ]
                        }
                      }
                    },
                    "user": {
                      "architectures": {
                        "mvc": {
                          "files": [
                            {
                              "type": "file",
                              "path": "drizzle.config.ts",
                              "content": "import { Config, defineConfig } from \"drizzle-kit\";\n\nexport default defineConfig({\n  out: \"./src/drizzle/migrations\",\n  schema: \"./src/drizzle/index.ts\",\n  dialect: \"postgresql\",\n  dbCredentials: {\n    url: process.env.DATABASE_URL!\n  },\n  verbose: true,\n  strict: true\n}) satisfies Config;\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/index.ts",
                              "content": "export * from \"./schemas/user.schema\";\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/schemas/user.schema.ts",
                              "content": "import {\n  pgTable,\n  varchar,\n  boolean,\n  timestamp,\n  integer,\n  json,\n  uniqueIndex,\n  index,\n  pgEnum,\n  serial\n} from \"drizzle-orm/pg-core\";\nimport { timestamps } from \"./schema.helper\";\nimport { relations } from \"drizzle-orm\";\n\ninterface IAvatar {\n  public_id?: string;\n  url: string;\n  size?: number;\n}\n\nconst providerEnum = pgEnum(\"provider\", [\"local\", \"google\", \"github\"]);\n\nconst roleEnum = pgEnum(\"role\", [\"user\", \"admin\"]);\n\nexport const users = pgTable(\n  \"users\",\n  {\n    id: serial(\"id\").primaryKey(),\n    name: varchar(\"name\", { length: 100 }).notNull(),\n    email: varchar(\"email\", { length: 255 }).notNull().unique(),\n    password: varchar(\"password\", { length: 255 }),\n    role: roleEnum(\"role\").default(\"user\").notNull(),\n\n    provider: providerEnum(\"provider\").default(\"local\").notNull(),\n    providerId: varchar(\"provider_id\", { length: 255 }),\n\n    avatar: json(\"avatar\").$type<IAvatar>(),\n\n    isEmailVerified: boolean(\"is_email_verified\").default(false).notNull(),\n    lastLoginAt: timestamp(\"last_login_at\"),\n    failedLoginAttempts: integer(\"failed_login_attempts\").default(0).notNull(),\n    lockUntil: timestamp(\"lock_until\"),\n\n    isDeleted: boolean(\"is_deleted\").default(false).notNull(),\n    deletedAt: timestamp(\"deleted_at\"),\n    reActivateAvailableAt: timestamp(\"re_activate_available_at\"),\n\n    ...timestamps\n  },\n  table => [\n    uniqueIndex(\"email_idx\").on(table.email),\n    index(\"role_idx\").on(table.role),\n    index(\"is_deleted_idx\").on(table.isDeleted)\n  ]\n);\n\n//* relations:\nexport const usersRelations = relations(users, ({ many }) => ({\n  //TODO: relation with posts: user has many posts\n  //TODO: relation with post_likes: user has many likes\n  //TODO: relation with comment_likes: user has many comment likes\n  //TODO: relation with comments: user has many comments\n}));\n\n//? User type\nexport type User = typeof users.$inferSelect;\nexport type NewUser = typeof users.$inferInsert;\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/schemas/schema.helper.ts",
                              "content": "import { timestamp } from \"drizzle-orm/pg-core\";\n\nexport const timestamps = {\n  createdAt: timestamp(\"created_at\").defaultNow().notNull(),\n  updatedAt: timestamp(\"updated_at\")\n    .defaultNow()\n    .$onUpdate(() => new Date())\n    .notNull()\n};\n"
                            }
                          ]
                        },
                        "feature": {
                          "files": [
                            {
                              "type": "file",
                              "path": "drizzle.config.ts",
                              "content": "import { Config, defineConfig } from \"drizzle-kit\";\n\nexport default defineConfig({\n  out: \"./src/drizzle/migrations\",\n  schema: \"./src/drizzle/index.ts\",\n  dialect: \"postgresql\",\n  dbCredentials: {\n    url: process.env.DATABASE_URL!\n  },\n  verbose: true,\n  strict: true\n}) satisfies Config;\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/index.ts",
                              "content": "export * from \"./schemas/user.schema\";\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/schemas/user.schema.ts",
                              "content": "import {\n  pgTable,\n  varchar,\n  boolean,\n  timestamp,\n  integer,\n  json,\n  uniqueIndex,\n  index,\n  pgEnum,\n  serial\n} from \"drizzle-orm/pg-core\";\nimport { timestamps } from \"./schema.helper\";\nimport { relations } from \"drizzle-orm\";\n\ninterface IAvatar {\n  public_id?: string;\n  url: string;\n  size?: number;\n}\n\nconst providerEnum = pgEnum(\"provider\", [\"local\", \"google\", \"github\"]);\n\nconst roleEnum = pgEnum(\"role\", [\"user\", \"admin\"]);\n\nexport const users = pgTable(\n  \"users\",\n  {\n    id: serial(\"id\").primaryKey(),\n    name: varchar(\"name\", { length: 100 }).notNull(),\n    email: varchar(\"email\", { length: 255 }).notNull().unique(),\n    password: varchar(\"password\", { length: 255 }),\n    role: roleEnum(\"role\").default(\"user\").notNull(),\n\n    provider: providerEnum(\"provider\").default(\"local\").notNull(),\n    providerId: varchar(\"provider_id\", { length: 255 }),\n\n    avatar: json(\"avatar\").$type<IAvatar>(),\n\n    isEmailVerified: boolean(\"is_email_verified\").default(false).notNull(),\n    lastLoginAt: timestamp(\"last_login_at\"),\n    failedLoginAttempts: integer(\"failed_login_attempts\").default(0).notNull(),\n    lockUntil: timestamp(\"lock_until\"),\n\n    isDeleted: boolean(\"is_deleted\").default(false).notNull(),\n    deletedAt: timestamp(\"deleted_at\"),\n    reActivateAvailableAt: timestamp(\"re_activate_available_at\"),\n\n    ...timestamps\n  },\n  table => [\n    uniqueIndex(\"email_idx\").on(table.email),\n    index(\"role_idx\").on(table.role),\n    index(\"is_deleted_idx\").on(table.isDeleted)\n  ]\n);\n\n//* relations:\nexport const usersRelations = relations(users, ({ many }) => ({\n  //TODO: relation with posts: user has many posts\n  //TODO: relation with post_likes: user has many likes\n  //TODO: relation with comment_likes: user has many comment likes\n  //TODO: relation with comments: user has many comments\n}));\n\n//? User type\nexport type User = typeof users.$inferSelect;\nexport type NewUser = typeof users.$inferInsert;\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/schemas/schema.helper.ts",
                              "content": "import { timestamp } from \"drizzle-orm/pg-core\";\n\nexport const timestamps = {\n  createdAt: timestamp(\"created_at\").defaultNow().notNull(),\n  updatedAt: timestamp(\"updated_at\")\n    .defaultNow()\n    .$onUpdate(() => new Date())\n    .notNull()\n};\n"
                            }
                          ]
                        }
                      }
                    },
                    "comment": {
                      "architectures": {
                        "mvc": {
                          "files": [
                            {
                              "type": "file",
                              "path": "drizzle.config.ts",
                              "content": "import { Config, defineConfig } from \"drizzle-kit\";\n\nexport default defineConfig({\n  out: \"./src/drizzle/migrations\",\n  schema: \"./src/drizzle/index.ts\",\n  dialect: \"postgresql\",\n  dbCredentials: {\n    url: process.env.DATABASE_URL!\n  },\n  verbose: true,\n  strict: true\n}) satisfies Config;\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/index.ts",
                              "content": "export * from \"./schemas/comment.schema\";\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/schemas/schema.helper.ts",
                              "content": "import { timestamp } from \"drizzle-orm/pg-core\";\n\nexport const timestamps = {\n  createdAt: timestamp(\"created_at\").defaultNow().notNull(),\n  updatedAt: timestamp(\"updated_at\")\n    .defaultNow()\n    .$onUpdate(() => new Date())\n    .notNull()\n};\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/schemas/comment.schema.ts",
                              "content": "import { pgTable, integer, text } from \"drizzle-orm/pg-core\";\n\nimport { timestamps } from \"./schema.helper\";\nimport { relations } from \"drizzle-orm\";\n\nexport const comments = pgTable(\"comments\", {\n  id: integer(\"id\").primaryKey(),\n\n  postId: integer(\"post_id\")\n    // .references(() => posts.id),\n    .notNull(),\n\n  authorId: integer(\"author_id\")\n    // .references(() => users.id),\n    .notNull(),\n\n  content: text(\"content\").notNull(),\n\n  parentCommentId: integer(\"parent_comment_id\"),\n  ...timestamps\n});\n\n//* relations:\nexport const commentsRelations = relations(comments, ({ one, many }) => ({\n  //TODO: relation with posts: one comment belongs to one post\n  //TODO: relation with users: one comment belongs to one user\n  //TODO: relation with comments: one comment belongs to one parent comment\n  //TODO: relation with comments: one comment has many replies\n  //TODO: relation with comment_likes: one comment has many likes\n}));\n"
                            }
                          ]
                        },
                        "feature": {
                          "files": [
                            {
                              "type": "file",
                              "path": "drizzle.config.ts",
                              "content": "import { Config, defineConfig } from \"drizzle-kit\";\n\nexport default defineConfig({\n  out: \"./src/drizzle/migrations\",\n  schema: \"./src/drizzle/index.ts\",\n  dialect: \"postgresql\",\n  dbCredentials: {\n    url: process.env.DATABASE_URL!\n  },\n  verbose: true,\n  strict: true\n}) satisfies Config;\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/index.ts",
                              "content": "export * from \"./schemas/comment.schema\";\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/schemas/schema.helper.ts",
                              "content": "import { timestamp } from \"drizzle-orm/pg-core\";\n\nexport const timestamps = {\n  createdAt: timestamp(\"created_at\").defaultNow().notNull(),\n  updatedAt: timestamp(\"updated_at\")\n    .defaultNow()\n    .$onUpdate(() => new Date())\n    .notNull()\n};\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/schemas/comment.schema.ts",
                              "content": "import { pgTable, integer, text } from \"drizzle-orm/pg-core\";\n\nimport { timestamps } from \"./schema.helper\";\nimport { relations } from \"drizzle-orm\";\n\nexport const comments = pgTable(\"comments\", {\n  id: integer(\"id\").primaryKey(),\n\n  postId: integer(\"post_id\")\n    // .references(() => posts.id),\n    .notNull(),\n\n  authorId: integer(\"author_id\")\n    // .references(() => users.id),\n    .notNull(),\n\n  content: text(\"content\").notNull(),\n\n  parentCommentId: integer(\"parent_comment_id\"),\n  ...timestamps\n});\n\n//* relations:\nexport const commentsRelations = relations(comments, ({ one, many }) => ({\n  //TODO: relation with posts: one comment belongs to one post\n  //TODO: relation with users: one comment belongs to one user\n  //TODO: relation with comments: one comment belongs to one parent comment\n  //TODO: relation with comments: one comment has many replies\n  //TODO: relation with comment_likes: one comment has many likes\n}));\n"
                            }
                          ]
                        }
                      }
                    },
                    "comment-like": {
                      "architectures": {
                        "mvc": {
                          "files": [
                            {
                              "type": "file",
                              "path": "drizzle.config.ts",
                              "content": "import { Config, defineConfig } from \"drizzle-kit\";\n\nexport default defineConfig({\n  out: \"./src/drizzle/migrations\",\n  schema: \"./src/drizzle/index.ts\",\n  dialect: \"postgresql\",\n  dbCredentials: {\n    url: process.env.DATABASE_URL!\n  },\n  verbose: true,\n  strict: true\n}) satisfies Config;\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/index.ts",
                              "content": "export * from \"./schemas/comment-like.schema\";\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/schemas/schema.helper.ts",
                              "content": "import { timestamp } from \"drizzle-orm/pg-core\";\n\nexport const timestamps = {\n  createdAt: timestamp(\"created_at\").defaultNow().notNull(),\n  updatedAt: timestamp(\"updated_at\")\n    .defaultNow()\n    .$onUpdate(() => new Date())\n    .notNull()\n};\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/schemas/comment-like.schema.ts",
                              "content": "import { pgTable, integer, uniqueIndex } from \"drizzle-orm/pg-core\";\nimport { timestamps } from \"./schema.helper\";\nimport { relations } from \"drizzle-orm\";\n\nexport const commentLikes = pgTable(\n  \"comment_likes\",\n  {\n    userId: integer(\"user_id\")\n      // .references(() => users.id),\n      .notNull(),\n\n    commentId: integer(\"comment_id\")\n      // .references(() => comments.id),\n      .notNull(),\n\n    ...timestamps\n  },\n  table => [\n    uniqueIndex(\"unique_comment_like\").on(table.userId, table.commentId)\n  ]\n);\n\n//* relations:\nexport const commentLikesRelations = relations(commentLikes, ({ one }) => ({\n  //TODO: relation with users: one like belongs to one user\n  //TODO: relation with comments: one like belongs to one comment\n}));\n"
                            }
                          ]
                        },
                        "feature": {
                          "files": [
                            {
                              "type": "file",
                              "path": "drizzle.config.ts",
                              "content": "import { Config, defineConfig } from \"drizzle-kit\";\n\nexport default defineConfig({\n  out: \"./src/drizzle/migrations\",\n  schema: \"./src/drizzle/index.ts\",\n  dialect: \"postgresql\",\n  dbCredentials: {\n    url: process.env.DATABASE_URL!\n  },\n  verbose: true,\n  strict: true\n}) satisfies Config;\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/index.ts",
                              "content": "export * from \"./schemas/comment-like.schema\";\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/schemas/schema.helper.ts",
                              "content": "import { timestamp } from \"drizzle-orm/pg-core\";\n\nexport const timestamps = {\n  createdAt: timestamp(\"created_at\").defaultNow().notNull(),\n  updatedAt: timestamp(\"updated_at\")\n    .defaultNow()\n    .$onUpdate(() => new Date())\n    .notNull()\n};\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/schemas/comment-like.schema.ts",
                              "content": "import { pgTable, integer, uniqueIndex } from \"drizzle-orm/pg-core\";\nimport { timestamps } from \"./schema.helper\";\nimport { relations } from \"drizzle-orm\";\n\nexport const commentLikes = pgTable(\n  \"comment_likes\",\n  {\n    userId: integer(\"user_id\")\n      // .references(() => users.id),\n      .notNull(),\n\n    commentId: integer(\"comment_id\")\n      // .references(() => comments.id),\n      .notNull(),\n\n    ...timestamps\n  },\n  table => [\n    uniqueIndex(\"unique_comment_like\").on(table.userId, table.commentId)\n  ]\n);\n\n//* relations:\nexport const commentLikesRelations = relations(commentLikes, ({ one }) => ({\n  //TODO: relation with users: one like belongs to one user\n  //TODO: relation with comments: one like belongs to one comment\n}));\n"
                            }
                          ]
                        }
                      }
                    },
                    "post": {
                      "architectures": {
                        "mvc": {
                          "files": [
                            {
                              "type": "file",
                              "path": "drizzle.config.ts",
                              "content": "import { Config, defineConfig } from \"drizzle-kit\";\n\nexport default defineConfig({\n  out: \"./src/drizzle/migrations\",\n  schema: \"./src/drizzle/index.ts\",\n  dialect: \"postgresql\",\n  dbCredentials: {\n    url: process.env.DATABASE_URL!\n  },\n  verbose: true,\n  strict: true\n}) satisfies Config;\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/index.ts",
                              "content": "export * from \"./schemas/post.schema\";\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/schemas/schema.helper.ts",
                              "content": "import { timestamp } from \"drizzle-orm/pg-core\";\n\nexport const timestamps = {\n  createdAt: timestamp(\"created_at\").defaultNow().notNull(),\n  updatedAt: timestamp(\"updated_at\")\n    .defaultNow()\n    .$onUpdate(() => new Date())\n    .notNull()\n};\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/schemas/post.schema.ts",
                              "content": "import {\n  index,\n  integer,\n  json,\n  pgEnum,\n  pgTable,\n  serial,\n  timestamp,\n  uniqueIndex,\n  varchar\n} from \"drizzle-orm/pg-core\";\nimport { timestamps } from \"./schema.helper\";\nimport { relations } from \"drizzle-orm\";\n\nconst POST_STATUSES = [\"draft\", \"published\", \"archived\"] as const;\n\ninterface IFile {\n  public_id: string;\n  url: string;\n  size: number;\n}\n\nconst statusEnum = pgEnum(\"post_status\", POST_STATUSES);\n\nexport const posts = pgTable(\n  \"posts\",\n  {\n    id: serial().primaryKey(),\n\n    title: varchar(\"title\", { length: 100 }).notNull(),\n    slug: varchar(\"slug\").notNull().unique(),\n    content: varchar(\"description\"),\n    excerpt: varchar(\"excerpt\"), // Short summary\n\n    authorId: integer(\"author_id\")\n      // .references(() => users.id, { onDelete: \"cascade\" })\n      .notNull(), // Reference to User\n    categoryId: integer(\"category_id\")\n      // .references(() => users.id, { onDelete: \"cascade\" })\n      .notNull(),\n\n    tags: json(\"tags\").$type<string[]>(),\n    featuredImage: json(\"featured_image\").$type<IFile>(),\n    views: integer(\"views\").default(0).notNull(),\n\n    status: statusEnum(\"status\").default(\"draft\").notNull(),\n    publishedAt: timestamp(\"published_at\"),\n\n    ...timestamps\n  },\n  table => [\n    uniqueIndex(\"author_id_slug_unique\").on(table.authorId, table.slug),\n    index(\"category_idx\").on(table.categoryId),\n    index(\"status_idx\").on(table.status)\n  ]\n);\n\n//* relations:\nexport const postsRelations = relations(posts, ({ one, many }) => ({\n  //TODO: relation with users: post belongs to one user\n  //TODO: relation with categories: Post belongs to one category\n  //TODO: relation with post_likes: one post has many likes\n}));\n\nexport type NewPost = typeof posts.$inferInsert;\nexport type Post = typeof posts.$inferSelect;\n"
                            }
                          ]
                        },
                        "feature": {
                          "files": [
                            {
                              "type": "file",
                              "path": "drizzle.config.ts",
                              "content": "import { Config, defineConfig } from \"drizzle-kit\";\n\nexport default defineConfig({\n  out: \"./src/drizzle/migrations\",\n  schema: \"./src/drizzle/index.ts\",\n  dialect: \"postgresql\",\n  dbCredentials: {\n    url: process.env.DATABASE_URL!\n  },\n  verbose: true,\n  strict: true\n}) satisfies Config;\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/index.ts",
                              "content": "export * from \"./schemas/post.schema\";\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/schemas/schema.helper.ts",
                              "content": "import { timestamp } from \"drizzle-orm/pg-core\";\n\nexport const timestamps = {\n  createdAt: timestamp(\"created_at\").defaultNow().notNull(),\n  updatedAt: timestamp(\"updated_at\")\n    .defaultNow()\n    .$onUpdate(() => new Date())\n    .notNull()\n};\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/schemas/post.schema.ts",
                              "content": "import {\n  index,\n  integer,\n  json,\n  pgEnum,\n  pgTable,\n  serial,\n  timestamp,\n  uniqueIndex,\n  varchar\n} from \"drizzle-orm/pg-core\";\nimport { timestamps } from \"./schema.helper\";\nimport { relations } from \"drizzle-orm\";\n\nconst POST_STATUSES = [\"draft\", \"published\", \"archived\"] as const;\n\ninterface IFile {\n  public_id: string;\n  url: string;\n  size: number;\n}\n\nconst statusEnum = pgEnum(\"post_status\", POST_STATUSES);\n\nexport const posts = pgTable(\n  \"posts\",\n  {\n    id: serial().primaryKey(),\n\n    title: varchar(\"title\", { length: 100 }).notNull(),\n    slug: varchar(\"slug\").notNull().unique(),\n    content: varchar(\"description\"),\n    excerpt: varchar(\"excerpt\"), // Short summary\n\n    authorId: integer(\"author_id\")\n      // .references(() => users.id, { onDelete: \"cascade\" })\n      .notNull(), // Reference to User\n    categoryId: integer(\"category_id\")\n      // .references(() => users.id, { onDelete: \"cascade\" })\n      .notNull(),\n\n    tags: json(\"tags\").$type<string[]>(),\n    featuredImage: json(\"featured_image\").$type<IFile>(),\n    views: integer(\"views\").default(0).notNull(),\n\n    status: statusEnum(\"status\").default(\"draft\").notNull(),\n    publishedAt: timestamp(\"published_at\"),\n\n    ...timestamps\n  },\n  table => [\n    uniqueIndex(\"author_id_slug_unique\").on(table.authorId, table.slug),\n    index(\"category_idx\").on(table.categoryId),\n    index(\"status_idx\").on(table.status)\n  ]\n);\n\n//* relations:\nexport const postsRelations = relations(posts, ({ one, many }) => ({\n  //TODO: relation with users: post belongs to one user\n  //TODO: relation with categories: Post belongs to one category\n  //TODO: relation with post_likes: one post has many likes\n}));\n\nexport type NewPost = typeof posts.$inferInsert;\nexport type Post = typeof posts.$inferSelect;\n"
                            }
                          ]
                        }
                      }
                    },
                    "post-like": {
                      "architectures": {
                        "mvc": {
                          "files": [
                            {
                              "type": "file",
                              "path": "drizzle.config.ts",
                              "content": "import { Config, defineConfig } from \"drizzle-kit\";\n\nexport default defineConfig({\n  out: \"./src/drizzle/migrations\",\n  schema: \"./src/drizzle/index.ts\",\n  dialect: \"postgresql\",\n  dbCredentials: {\n    url: process.env.DATABASE_URL!\n  },\n  verbose: true,\n  strict: true\n}) satisfies Config;\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/index.ts",
                              "content": "export * from \"./schemas/post-like.schema\";\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/schemas/schema.helper.ts",
                              "content": "import { timestamp } from \"drizzle-orm/pg-core\";\n\nexport const timestamps = {\n  createdAt: timestamp(\"created_at\").defaultNow().notNull(),\n  updatedAt: timestamp(\"updated_at\")\n    .defaultNow()\n    .$onUpdate(() => new Date())\n    .notNull()\n};\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/schemas/post-like.schema.ts",
                              "content": "import { pgTable, integer, uniqueIndex } from \"drizzle-orm/pg-core\";\nimport { timestamps } from \"./schema.helper\";\nimport { relations } from \"drizzle-orm\";\n\nexport const postLikes = pgTable(\n  \"post_likes\",\n  {\n    userId: integer(\"user_id\")\n      // .references(() => users.id, { onDelete: \"cascade\" })\n      .notNull(),\n\n    postId: integer(\"post_id\")\n      // .references(() => posts.id, { onDelete: \"cascade\" })\n      .notNull(),\n    ...timestamps\n  },\n  table => [uniqueIndex(\"unique_like\").on(table.userId, table.postId)]\n);\n\n//* relations:\nexport const postLikesRelations = relations(postLikes, ({ one }) => ({\n  //TODO: relation with users: one like belongs to one user\n  //TODO: relation with posts: one like belongs to one post\n}));\n"
                            }
                          ]
                        },
                        "feature": {
                          "files": [
                            {
                              "type": "file",
                              "path": "drizzle.config.ts",
                              "content": "import { Config, defineConfig } from \"drizzle-kit\";\n\nexport default defineConfig({\n  out: \"./src/drizzle/migrations\",\n  schema: \"./src/drizzle/index.ts\",\n  dialect: \"postgresql\",\n  dbCredentials: {\n    url: process.env.DATABASE_URL!\n  },\n  verbose: true,\n  strict: true\n}) satisfies Config;\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/index.ts",
                              "content": "export * from \"./schemas/post-like.schema\";\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/schemas/schema.helper.ts",
                              "content": "import { timestamp } from \"drizzle-orm/pg-core\";\n\nexport const timestamps = {\n  createdAt: timestamp(\"created_at\").defaultNow().notNull(),\n  updatedAt: timestamp(\"updated_at\")\n    .defaultNow()\n    .$onUpdate(() => new Date())\n    .notNull()\n};\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/schemas/post-like.schema.ts",
                              "content": "import { pgTable, integer, uniqueIndex } from \"drizzle-orm/pg-core\";\nimport { timestamps } from \"./schema.helper\";\nimport { relations } from \"drizzle-orm\";\n\nexport const postLikes = pgTable(\n  \"post_likes\",\n  {\n    userId: integer(\"user_id\")\n      // .references(() => users.id, { onDelete: \"cascade\" })\n      .notNull(),\n\n    postId: integer(\"post_id\")\n      // .references(() => posts.id, { onDelete: \"cascade\" })\n      .notNull(),\n    ...timestamps\n  },\n  table => [uniqueIndex(\"unique_like\").on(table.userId, table.postId)]\n);\n\n//* relations:\nexport const postLikesRelations = relations(postLikes, ({ one }) => ({\n  //TODO: relation with users: one like belongs to one user\n  //TODO: relation with posts: one like belongs to one post\n}));\n"
                            }
                          ]
                        }
                      }
                    }
                  },
                  "dependencies": {
                    "runtime": [
                      "pg",
                      "drizzle-orm"
                    ],
                    "dev": [
                      "drizzle-kit",
                      "@types/pg"
                    ]
                  }
                }
              }
            },
            "mongodb": {
              "orms": {
                "mongoose": {
                  "templates": {
                    "index": {
                      "architectures": {
                        "mvc": {
                          "files": [
                            {
                              "type": "file",
                              "path": "src/models/user.model.ts",
                              "content": "import mongoose, { Document, Model, Schema } from \"mongoose\";\n\nexport interface IFile {\n  public_id: string;\n  url: string;\n  size: number;\n}\n\nexport interface IUser extends Document {\n  _id: mongoose.Types.ObjectId;\n  name: string;\n  email: string;\n  password?: string;\n  role: \"user\" | \"admin\";\n  isEmailVerified: boolean;\n  lastLoginAt?: Date;\n  failedLoginAttempts: number;\n  lockUntil?: Date;\n  avatar?: IFile;\n\n  provider: \"local\" | \"google\" | \"github\";\n  providerId?: string;\n\n  isDeleted: boolean;\n  deletedAt?: Date | null;\n  reActivateAvailableAt?: Date | null;\n\n  createdAt: Date;\n  updatedAt: Date;\n}\n\nconst userSchema = new Schema<IUser>(\n  {\n    name: {\n      type: String,\n      required: [true, \"Name is required\"],\n      trim: true\n    },\n    email: {\n      type: String,\n      required: [true, \"Email is required\"],\n      unique: true,\n      lowercase: true,\n      trim: true\n    },\n    password: {\n      type: String,\n      select: false,\n      default: null\n    },\n    provider: {\n      type: String,\n      enum: [\"local\", \"google\", \"github\"],\n      default: \"local\"\n    },\n    providerId: {\n      type: String,\n      default: null\n    },\n    role: {\n      type: String,\n      enum: [\"user\", \"admin\"],\n      default: \"user\"\n    },\n    avatar: {\n      public_id: String,\n      url: String,\n      size: Number\n    },\n    isEmailVerified: {\n      type: Boolean,\n      default: false\n    },\n    lastLoginAt: {\n      type: Date\n    },\n    failedLoginAttempts: {\n      type: Number,\n      required: true,\n      default: 0\n    },\n    lockUntil: {\n      type: Date\n    },\n    isDeleted: {\n      type: Boolean,\n      default: false\n    },\n    deletedAt: {\n      type: Date,\n      default: null\n    },\n    reActivateAvailableAt: {\n      type: Date,\n      default: null\n    }\n  },\n  {\n    timestamps: true\n  }\n);\n\n// Performance Indexes\nuserSchema.index({\n  provider: 1,\n  providerId: 1\n});\nuserSchema.index({\n  role: 1\n});\nuserSchema.index({\n  isDeleted: 1\n}); // Optimized for soft-delete queries\n\nconst User: Model<IUser> =\n  mongoose.models.User || mongoose.model<IUser>(\"User\", userSchema);\n\nexport default User;\n"
                            },
                            {
                              "type": "file",
                              "path": "src/models/post.model.ts",
                              "content": "import mongoose, { Document, Model, Schema, Types } from \"mongoose\";\nimport { IFile } from \"./user.model\";\n\nconst POST_STATUSES = [\"draft\", \"published\", \"archived\"] as const;\n\ntype PostStatus = (typeof POST_STATUSES)[number];\n\nexport interface IPost extends Document {\n  _id: Types.ObjectId;\n\n  title: string;\n  slug: string;\n  content: string;\n\n  excerpt?: string;\n  author: Types.ObjectId;\n  category?: Types.ObjectId;\n  tags?: string[];\n  featuredImage: IFile | null;\n\n  views: number;\n  likes: Types.ObjectId[];\n  likeCount: number;\n\n  status: PostStatus;\n  publishedAt?: Date;\n\n  createdAt: Date;\n  updatedAt: Date;\n}\n\nconst postSchema = new Schema<IPost>(\n  {\n    title: {\n      type: String,\n      required: true\n    }, // Blog post title\n\n    slug: {\n      type: String,\n      required: true\n    }, // SEO-friendly URL slug\n\n    content: {\n      type: String,\n      required: true\n    }, // Main blog content\n\n    excerpt: {\n      type: String\n    }, // Short summary\n\n    author: {\n      type: Schema.Types.ObjectId,\n      ref: \"User\",\n      required: true\n    }, // Reference to User\n\n    category: {\n      type: Schema.Types.ObjectId,\n      ref: \"Category\"\n    }, // Reference to category\n\n    tags: {\n      type: [String],\n      default: []\n    }, // List of tags\n\n    featuredImage: {\n      public_id: String,\n      url: String,\n      size: Number\n    }, // Blog cover image URL\n\n    views: {\n      type: Number,\n      default: 0\n    }, // View count\n\n    likes: [\n      {\n        type: Schema.Types.ObjectId,\n        ref: \"User\"\n      }\n    ], // Users who liked the post\n\n    likeCount: {\n      type: Number,\n      default: 0\n    }, // Cached number of likes\n\n    status: {\n      type: String,\n      enum: POST_STATUSES,\n      default: \"draft\"\n    }, // Publication status\n\n    publishedAt: {\n      type: Date\n    } // Date when published\n  },\n  {\n    timestamps: true\n  }\n);\n\n//? indexes for efficient searching and filtering\npostSchema.index({ title: \"text\", content: \"text\" });\npostSchema.index({ author: 1, slug: 1 }, { unique: true });\n\npostSchema.index({ category: 1 }); // Efficient retrieval of posts by category\npostSchema.index({ createdAt: -1 });\n\nconst Post: Model<IPost> =\n  mongoose.models.Post || mongoose.model<IPost>(\"Post\", postSchema);\n\nexport default Post;\n"
                            },
                            {
                              "type": "file",
                              "path": "src/models/comment.model.ts",
                              "content": "import { model, Schema, Types } from \"mongoose\";\n\nexport interface IComment extends Document {\n  _id: Types.ObjectId;\n\n  post: Types.ObjectId;\n  author: Types.ObjectId;\n  content: string;\n  parentComment?: Types.ObjectId;\n\n  likes: Types.ObjectId[];\n\n  createdAt: Date;\n  updatedAt: Date;\n}\n\nconst commentSchema = new Schema<IComment>(\n  {\n    post: {\n      type: Schema.Types.ObjectId,\n      ref: \"Post\",\n      required: true\n    }, // Blog post reference\n\n    author: {\n      type: Schema.Types.ObjectId,\n      ref: \"User\",\n      required: true\n    }, // Comment author\n\n    content: {\n      type: String,\n      required: true,\n      trim: true,\n      maxlength: 500,\n      minlength: 1\n    }, // Comment text\n\n    likes: [\n      {\n        type: Schema.Types.ObjectId,\n        ref: \"User\"\n      }\n    ], // List of users who liked the comment\n\n    parentComment: {\n      type: Schema.Types.ObjectId,\n      ref: \"Comment\"\n    } // For nested replies\n  },\n  { timestamps: true }\n);\n\n//? index for query performance,\ncommentSchema.index({ post: 1 });\ncommentSchema.index({ author: 1 });\ncommentSchema.index({ parentComment: 1 });\n\nconst Comment = model<IComment>(\"Comment\", commentSchema);\n\nexport default Comment;\n"
                            },
                            {
                              "type": "file",
                              "path": "src/models/category.model.ts",
                              "content": "import mongoose, { model, Schema } from \"mongoose\";\n\nexport interface ICategory extends Document {\n  _id: mongoose.Types.ObjectId;\n  name: string;\n  slug: string;\n  description?: string;\n  createdAt: Date;\n  updatedAt: Date;\n}\n\nconst categorySchema = new Schema<ICategory>(\n  {\n    name: {\n      type: String,\n      required: true\n    }, // Category name\n\n    slug: {\n      type: String,\n      required: true,\n      unique: true\n    }, // URL-friendly slug\n\n    description: {\n      type: String\n    } // Category description\n  },\n  { timestamps: true }\n);\n\n//? Index for quick lookup by slug\ncategorySchema.index({ slug: 1, name: 1 }, { unique: true });\n\nconst Category = model<ICategory>(\"Category\", categorySchema);\n\nexport default Category;\n"
                            }
                          ]
                        },
                        "feature": {
                          "files": [
                            {
                              "type": "file",
                              "path": "src/modules/user/user.model.ts",
                              "content": "import mongoose, { Document, Model, Schema } from \"mongoose\";\n\ninterface IFile {\n  public_id: string;\n  url: string;\n  size: number;\n}\n\nexport interface IUser extends Document {\n  _id: mongoose.Types.ObjectId;\n  name: string;\n  email: string;\n  password?: string;\n  role: \"user\" | \"admin\";\n  isEmailVerified: boolean;\n  lastLoginAt?: Date;\n  failedLoginAttempts: number;\n  lockUntil?: Date;\n  avatar?: IFile;\n\n  provider: \"local\" | \"google\" | \"github\";\n  providerId?: string;\n\n  isDeleted: boolean;\n  deletedAt?: Date | null;\n  reActivateAvailableAt?: Date | null;\n\n  createdAt: Date;\n  updatedAt: Date;\n}\n\nconst userSchema = new Schema<IUser>(\n  {\n    name: {\n      type: String,\n      required: [true, \"Name is required\"],\n      trim: true\n    },\n    email: {\n      type: String,\n      required: [true, \"Email is required\"],\n      unique: true,\n      lowercase: true,\n      trim: true\n    },\n    password: {\n      type: String,\n      select: false,\n      default: null\n    },\n    provider: {\n      type: String,\n      enum: [\"local\", \"google\", \"github\"],\n      default: \"local\"\n    },\n    providerId: {\n      type: String,\n      default: null\n    },\n    role: {\n      type: String,\n      enum: [\"user\", \"admin\"],\n      default: \"user\"\n    },\n    avatar: {\n      public_id: String,\n      url: String,\n      size: Number\n    },\n    isEmailVerified: {\n      type: Boolean,\n      default: false\n    },\n    lastLoginAt: {\n      type: Date\n    },\n    failedLoginAttempts: {\n      type: Number,\n      required: true,\n      default: 0\n    },\n    lockUntil: {\n      type: Date\n    },\n    isDeleted: {\n      type: Boolean,\n      default: false\n    },\n    deletedAt: {\n      type: Date,\n      default: null\n    },\n    reActivateAvailableAt: {\n      type: Date,\n      default: null\n    }\n  },\n  {\n    timestamps: true\n  }\n);\n\n// Performance Indexes\nuserSchema.index({\n  provider: 1,\n  providerId: 1\n});\nuserSchema.index({\n  role: 1\n});\nuserSchema.index({\n  isDeleted: 1\n}); // Optimized for soft-delete queries\n\nconst User: Model<IUser> =\n  mongoose.models.User || mongoose.model<IUser>(\"User\", userSchema);\n\nexport default User;\n"
                            },
                            {
                              "type": "file",
                              "path": "src/modules/comment/comment.model.ts",
                              "content": "import { model, Schema, Types } from \"mongoose\";\n\nexport interface IComment extends Document {\n  _id: Types.ObjectId;\n\n  post: Types.ObjectId;\n  author: Types.ObjectId;\n  content: string;\n  parentComment?: Types.ObjectId;\n\n  likes: Types.ObjectId[];\n\n  createdAt: Date;\n  updatedAt: Date;\n}\n\nconst commentSchema = new Schema<IComment>(\n  {\n    post: {\n      type: Schema.Types.ObjectId,\n      ref: \"Post\",\n      required: true\n    }, // Blog post reference\n\n    author: {\n      type: Schema.Types.ObjectId,\n      ref: \"User\",\n      required: true\n    }, // Comment author\n\n    content: {\n      type: String,\n      required: true,\n      trim: true,\n      maxlength: 500,\n      minlength: 1\n    }, // Comment text\n\n    likes: [\n      {\n        type: Schema.Types.ObjectId,\n        ref: \"User\"\n      }\n    ], // List of users who liked the comment\n\n    parentComment: {\n      type: Schema.Types.ObjectId,\n      ref: \"Comment\"\n    } // For nested replies\n  },\n  { timestamps: true }\n);\n\n//? index for query performance,\ncommentSchema.index({ post: 1 });\ncommentSchema.index({ author: 1 });\ncommentSchema.index({ parentComment: 1 });\n\nconst Comment = model<IComment>(\"Comment\", commentSchema);\n\nexport default Comment;\n"
                            },
                            {
                              "type": "file",
                              "path": "src/modules/post/post.types.ts",
                              "content": "import { POST_STATUSES } from \"./post.constants\";\n\nexport type PostStatus = (typeof POST_STATUSES)[number];\n"
                            },
                            {
                              "type": "file",
                              "path": "src/modules/post/post.model.ts",
                              "content": "import mongoose, { Document, Model, Schema, Types } from \"mongoose\";\nimport { PostStatus } from \"./post.types\";\nimport { POST_STATUSES } from \"./post.constants\";\n\ninterface IFile {\n  public_id: string;\n  url: string;\n  size: number;\n}\n\nexport interface IPost extends Document {\n  _id: Types.ObjectId;\n\n  title: string;\n  slug: string;\n  content: string;\n\n  excerpt?: string;\n  author: Types.ObjectId;\n  category?: Types.ObjectId;\n  tags?: string[];\n  featuredImage: IFile | null;\n\n  views: number;\n  likes: Types.ObjectId[];\n  likeCount: number;\n\n  status: PostStatus;\n  publishedAt?: Date;\n\n  createdAt: Date;\n  updatedAt: Date;\n}\n\nconst postSchema = new Schema<IPost>(\n  {\n    title: {\n      type: String,\n      required: true\n    }, // Blog post title\n\n    slug: {\n      type: String,\n      required: true\n    }, // SEO-friendly URL slug\n\n    content: {\n      type: String,\n      required: true\n    }, // Main blog content\n\n    excerpt: {\n      type: String\n    }, // Short summary\n\n    author: {\n      type: Schema.Types.ObjectId,\n      ref: \"User\",\n      required: true\n    }, // Reference to User\n\n    category: {\n      type: Schema.Types.ObjectId,\n      ref: \"Category\"\n    }, // Reference to category\n\n    tags: {\n      type: [String],\n      default: []\n    }, // List of tags\n\n    featuredImage: {\n      public_id: String,\n      url: String,\n      size: Number\n    }, // Blog cover image URL\n\n    views: {\n      type: Number,\n      default: 0\n    }, // View count\n\n    likes: [\n      {\n        type: Schema.Types.ObjectId,\n        ref: \"User\"\n      }\n    ], // Users who liked the post\n\n    likeCount: {\n      type: Number,\n      default: 0\n    }, // Cached number of likes\n\n    status: {\n      type: String,\n      enum: POST_STATUSES,\n      default: \"draft\"\n    }, // Publication status\n\n    publishedAt: {\n      type: Date\n    } // Date when published\n  },\n  {\n    timestamps: true\n  }\n);\n\n//? indexes for efficient searching and filtering\npostSchema.index({ title: \"text\", content: \"text\" });\npostSchema.index({ author: 1, slug: 1 }, { unique: true });\n\npostSchema.index({ category: 1 }); // Efficient retrieval of posts by category\npostSchema.index({ createdAt: -1 });\n\nconst Post: Model<IPost> =\n  mongoose.models.Post || mongoose.model<IPost>(\"Post\", postSchema);\n\nexport default Post;\n"
                            },
                            {
                              "type": "file",
                              "path": "src/modules/post/post.constants.ts",
                              "content": "export const POST_STATUSES = [\"draft\", \"published\", \"archived\"] as const;\n"
                            },
                            {
                              "type": "file",
                              "path": "src/modules/category/category.model.ts",
                              "content": "import mongoose, { model, Schema } from \"mongoose\";\n\nexport interface ICategory extends Document {\n  _id: mongoose.Types.ObjectId;\n  name: string;\n  slug: string;\n  description?: string;\n  createdAt: Date;\n  updatedAt: Date;\n}\n\nconst categorySchema = new Schema<ICategory>(\n  {\n    name: {\n      type: String,\n      required: true\n    }, // Category name\n\n    slug: {\n      type: String,\n      required: true,\n      unique: true\n    }, // URL-friendly slug\n\n    description: {\n      type: String\n    } // Category description\n  },\n  { timestamps: true }\n);\n\n//? Index for quick lookup by slug\ncategorySchema.index({ slug: 1, name: 1 }, { unique: true });\n\nconst Category = model<ICategory>(\"Category\", categorySchema);\n\nexport default Category;\n"
                            }
                          ]
                        }
                      }
                    },
                    "category": {
                      "architectures": {
                        "mvc": {
                          "files": [
                            {
                              "type": "file",
                              "path": "src/models/category.model.ts",
                              "content": "import mongoose, { model, Schema } from \"mongoose\";\n\nexport interface ICategory extends Document {\n  _id: mongoose.Types.ObjectId;\n  name: string;\n  slug: string;\n  description?: string;\n  createdAt: Date;\n  updatedAt: Date;\n}\n\nconst categorySchema = new Schema<ICategory>(\n  {\n    name: {\n      type: String,\n      required: true\n    }, // Category name\n\n    slug: {\n      type: String,\n      required: true,\n      unique: true\n    }, // URL-friendly slug\n\n    description: {\n      type: String\n    } // Category description\n  },\n  { timestamps: true }\n);\n\n//? Index for quick lookup by slug\ncategorySchema.index({ slug: 1, name: 1 }, { unique: true });\n\nconst Category = model<ICategory>(\"Category\", categorySchema);\n\nexport default Category;\n"
                            }
                          ]
                        },
                        "feature": {
                          "files": [
                            {
                              "type": "file",
                              "path": "src/modules/category/category.model.ts",
                              "content": "import mongoose, { model, Schema } from \"mongoose\";\n\nexport interface ICategory extends Document {\n  _id: mongoose.Types.ObjectId;\n  name: string;\n  slug: string;\n  description?: string;\n  createdAt: Date;\n  updatedAt: Date;\n}\n\nconst categorySchema = new Schema<ICategory>(\n  {\n    name: {\n      type: String,\n      required: true\n    }, // Category name\n\n    slug: {\n      type: String,\n      required: true,\n      unique: true\n    }, // URL-friendly slug\n\n    description: {\n      type: String\n    } // Category description\n  },\n  { timestamps: true }\n);\n\n//? Index for quick lookup by slug\ncategorySchema.index({ slug: 1, name: 1 }, { unique: true });\n\nconst Category = model<ICategory>(\"Category\", categorySchema);\n\nexport default Category;\n"
                            }
                          ]
                        }
                      }
                    },
                    "user": {
                      "architectures": {
                        "mvc": {
                          "files": [
                            {
                              "type": "file",
                              "path": "src/types/user.d.ts",
                              "content": "import { Request } from \"express\";\nimport { OTP_TYPES } from \"../constants/auth\";\n\nexport type OTPType = (typeof OTP_TYPES)[number];\n\nexport interface UserRequest extends Request {\n  user?: {\n    _id?: string | undefined;\n    role?: \"user\" | \"admin\" | undefined;\n  };\n}\n\nexport interface IUser {\n  _id: string;\n  name: string;\n  email: string;\n  password?: string;\n  role: \"user\" | \"admin\";\n  isEmailVerified: boolean;\n  lastLoginAt?: Date;\n  failedLoginAttempts: number;\n  lockUntil?: Date;\n  avatar?: {\n    url: string;\n    publicId: string;\n    size: number;\n  };\n  provider: \"local\" | \"google\" | \"github\";\n  providerId?: string;\n  isDeleted: boolean;\n  deletedAt?: Date;\n  reActivateAvailableAt?: Date;\n  createdAt: Date;\n  updatedAt: Date;\n}\n\ninterface IAccount {\n  _id: string;\n  type: string;\n  currency: string;\n  status: string;\n  createdAt?: string;\n  updatedAt?: string;\n}\n\nexport type UserProfile = Pick<\n  IUser,\n  \"_id\" | \"name\" | \"email\" | \"avatar\" | \"role\" | \"isEmailVerified\"\n> & {\n  accounts?: IAccount[];\n};\n"
                            },
                            {
                              "type": "file",
                              "path": "src/models/user.model.ts",
                              "content": "import mongoose, { Document, Model, Schema } from \"mongoose\";\n\nexport interface IAvatar {\n  public_id: string;\n  url: string;\n  size: number;\n}\n\nexport interface IUser extends Document {\n  _id: mongoose.Types.ObjectId;\n  name: string;\n  email: string;\n  password?: string;\n  role: \"user\" | \"admin\";\n  isEmailVerified: boolean;\n  lastLoginAt?: Date;\n  failedLoginAttempts: number;\n  lockUntil?: Date;\n  avatar?: IAvatar;\n\n  provider: \"local\" | \"google\" | \"github\";\n  providerId?: string;\n\n  isDeleted: boolean;\n  deletedAt?: Date | null;\n  reActivateAvailableAt?: Date | null;\n\n  createdAt: Date;\n  updatedAt: Date;\n}\n\nconst userSchema = new Schema<IUser>(\n  {\n    name: {\n      type: String,\n      required: [true, \"Name is required\"],\n      trim: true\n    },\n    email: {\n      type: String,\n      required: [true, \"Email is required\"],\n      unique: true,\n      lowercase: true,\n      trim: true\n    },\n    password: {\n      type: String,\n      select: false,\n      default: null\n    },\n    provider: {\n      type: String,\n      enum: [\"local\", \"google\", \"github\"],\n      default: \"local\"\n    },\n    providerId: {\n      type: String,\n      default: null\n    },\n    role: {\n      type: String,\n      enum: [\"user\", \"admin\"],\n      default: \"user\"\n    },\n    avatar: {\n      public_id: String,\n      url: String,\n      size: Number\n    },\n    isEmailVerified: {\n      type: Boolean,\n      default: false\n    },\n    lastLoginAt: {\n      type: Date\n    },\n    failedLoginAttempts: {\n      type: Number,\n      required: true,\n      default: 0\n    },\n    lockUntil: {\n      type: Date\n    },\n    isDeleted: {\n      type: Boolean,\n      default: false\n    },\n    deletedAt: {\n      type: Date,\n      default: null\n    },\n    reActivateAvailableAt: {\n      type: Date,\n      default: null\n    }\n  },\n  {\n    timestamps: true\n  }\n);\n\n// Performance Indexes\nuserSchema.index({ provider: 1, providerId: 1 }); // Quick lookup for OAuth\nuserSchema.index({ role: 1 });\nuserSchema.index({ isDeleted: 1 }); // Optimized for soft-delete queries\n\nconst User: Model<IUser> =\n  mongoose.models.User || mongoose.model<IUser>(\"User\", userSchema);\n\nexport default User;\n"
                            },
                            {
                              "type": "file",
                              "path": "src/constants/auth.ts",
                              "content": "export const OTP_MAX_ATTEMPTS = 5;\n\nexport const OTP_TYPES = [\n  \"signin\",\n  \"email-verification\",\n  \"password-reset\",\n  \"password-change\"\n] as const;\n\nexport const NEXT_OTP_DELAY = 1 * 60 * 1000; // 1 minute\n\nexport const LOGIN_MAX_ATTEMPTS = 5 as const;\n\nexport const OTP_CODE_LENGTH = 6 as const;\n\nexport const OTP_EXPIRES_IN = 5 * 60 * 1000; // 5 minutes\n\nexport const LOCK_TIME_MS = 24 * 60 * 60 * 1000; // 24 hours\n\nexport const ACCESS_TOKEN_EXPIRY = 15 * 60 * 1000; // 15 minutes\n\nexport const REFRESH_TOKEN_EXPIRY = 7 * 24 * 60 * 60 * 1000; // 7 days\n\nexport const RESET_PASSWORD_TOKEN_EXPIRY = 5 * 60 * 1000; // 5 minutes\n\nexport const REACTIVATION_AVAILABLE_AT = 24 * 60 * 60 * 1000; // 24 hours\n"
                            }
                          ]
                        },
                        "feature": {
                          "files": [
                            {
                              "type": "file",
                              "path": "src/modules/auth/user.model.ts",
                              "content": "import mongoose, { Document, Model, Schema } from \"mongoose\";\n\nexport interface IAvatar {\n  public_id: string;\n  url: string;\n  size: number;\n}\n\nexport interface IUser extends Document {\n  _id: mongoose.Types.ObjectId;\n  name: string;\n  email: string;\n  password?: string;\n  role: \"user\" | \"admin\";\n  isEmailVerified: boolean;\n  lastLoginAt?: Date;\n  failedLoginAttempts: number;\n  lockUntil?: Date;\n  avatar?: IAvatar;\n\n  provider: \"local\" | \"google\" | \"github\";\n  providerId?: string;\n\n  isDeleted: boolean;\n  deletedAt?: Date | null;\n  reActivateAvailableAt?: Date | null;\n\n  createdAt: Date;\n  updatedAt: Date;\n}\n\nconst userSchema = new Schema<IUser>(\n  {\n    name: {\n      type: String,\n      required: [true, \"Name is required\"],\n      trim: true\n    },\n    email: {\n      type: String,\n      required: [true, \"Email is required\"],\n      unique: true,\n      lowercase: true,\n      trim: true\n    },\n    password: {\n      type: String,\n      select: false,\n      default: null\n    },\n    provider: {\n      type: String,\n      enum: [\"local\", \"google\", \"github\"],\n      default: \"local\"\n    },\n    providerId: {\n      type: String,\n      default: null\n    },\n    role: {\n      type: String,\n      enum: [\"user\", \"admin\"],\n      default: \"user\"\n    },\n    avatar: {\n      public_id: String,\n      url: String,\n      size: Number\n    },\n    isEmailVerified: {\n      type: Boolean,\n      default: false\n    },\n    lastLoginAt: {\n      type: Date\n    },\n    failedLoginAttempts: {\n      type: Number,\n      required: true,\n      default: 0\n    },\n    lockUntil: {\n      type: Date\n    },\n    isDeleted: {\n      type: Boolean,\n      default: false\n    },\n    deletedAt: {\n      type: Date,\n      default: null\n    },\n    reActivateAvailableAt: {\n      type: Date,\n      default: null\n    }\n  },\n  {\n    timestamps: true\n  }\n);\n\n// Performance Indexes\nuserSchema.index({ provider: 1, providerId: 1 }); // Quick lookup for OAuth\nuserSchema.index({ role: 1 });\nuserSchema.index({ isDeleted: 1 }); // Optimized for soft-delete queries\n\nconst User: Model<IUser> =\n  mongoose.models.User || mongoose.model<IUser>(\"User\", userSchema);\n\nexport default User;\n"
                            },
                            {
                              "type": "file",
                              "path": "src/modules/auth/auth.types.ts",
                              "content": "export interface IUser {\n  _id: string;\n  name: string;\n  email: string;\n  password?: string;\n  role: \"user\" | \"admin\";\n  isEmailVerified: boolean;\n  lastLoginAt?: Date;\n  failedLoginAttempts: number;\n  lockUntil?: Date;\n  avatar?: {\n    url: string;\n    publicId: string;\n    size: number;\n  };\n  provider: \"local\" | \"google\" | \"github\";\n  providerId?: string;\n  isDeleted: boolean;\n  deletedAt?: Date;\n  reActivateAvailableAt?: Date;\n  createdAt: Date;\n  updatedAt: Date;\n}\n\ninterface IAccount {\n  _id: string;\n  type: string;\n  currency: string;\n  status: string;\n  createdAt?: string;\n  updatedAt?: string;\n}\n\nexport type UserProfile = Pick<\n  IUser,\n  \"_id\" | \"name\" | \"email\" | \"avatar\" | \"role\" | \"isEmailVerified\"\n> & {\n  accounts?: IAccount[];\n};\n"
                            },
                            {
                              "type": "file",
                              "path": "src/modules/auth/auth.constants.ts",
                              "content": "export const LOGIN_MAX_ATTEMPTS = 5 as const;\n\nexport const LOCK_TIME_MS = 24 * 60 * 60 * 1000; // 24 hours\n\nexport const ACCESS_TOKEN_EXPIRY = 15 * 60 * 1000; // 15 minutes\n\nexport const REFRESH_TOKEN_EXPIRY = 7 * 24 * 60 * 60 * 1000; // 7 days\n\nexport const RESET_PASSWORD_TOKEN_EXPIRY = 5 * 60 * 1000; // 5 minutes\n\nexport const REACTIVATION_AVAILABLE_AT = 24 * 60 * 60 * 1000; // 24 hours\n"
                            }
                          ]
                        }
                      }
                    },
                    "comment": {
                      "architectures": {
                        "mvc": {
                          "files": [
                            {
                              "type": "file",
                              "path": "src/models/comment.model.ts",
                              "content": "import { model, Schema, Types } from \"mongoose\";\n\nexport interface IComment extends Document {\n  _id: Types.ObjectId;\n\n  post: Types.ObjectId;\n  author: Types.ObjectId;\n  content: string;\n  parentComment?: Types.ObjectId;\n\n  likes: Types.ObjectId[];\n\n  createdAt: Date;\n  updatedAt: Date;\n}\n\nconst commentSchema = new Schema<IComment>(\n  {\n    post: {\n      type: Schema.Types.ObjectId,\n      ref: \"Post\",\n      required: true\n    }, // Blog post reference\n\n    author: {\n      type: Schema.Types.ObjectId,\n      ref: \"User\",\n      required: true\n    }, // Comment author\n\n    content: {\n      type: String,\n      required: true,\n      trim: true,\n      maxlength: 500,\n      minlength: 1\n    }, // Comment text\n\n    likes: [\n      {\n        type: Schema.Types.ObjectId,\n        ref: \"User\"\n      }\n    ], // List of users who liked the comment\n\n    parentComment: {\n      type: Schema.Types.ObjectId,\n      ref: \"Comment\"\n    } // For nested replies\n  },\n  { timestamps: true }\n);\n\n//? index for query performance,\ncommentSchema.index({ post: 1 });\ncommentSchema.index({ author: 1 });\ncommentSchema.index({ parentComment: 1 });\n\nconst Comment = model<IComment>(\"Comment\", commentSchema);\n\nexport default Comment;\n"
                            }
                          ]
                        },
                        "feature": {
                          "files": [
                            {
                              "type": "file",
                              "path": "src/modules/comment/comment.model.ts",
                              "content": "import { model, Schema, Types } from \"mongoose\";\n\nexport interface IComment extends Document {\n  _id: Types.ObjectId;\n\n  post: Types.ObjectId;\n  author: Types.ObjectId;\n  content: string;\n  parentComment?: Types.ObjectId;\n\n  likes: Types.ObjectId[];\n\n  createdAt: Date;\n  updatedAt: Date;\n}\n\nconst commentSchema = new Schema<IComment>(\n  {\n    post: {\n      type: Schema.Types.ObjectId,\n      ref: \"Post\",\n      required: true\n    }, // Blog post reference\n\n    author: {\n      type: Schema.Types.ObjectId,\n      ref: \"User\",\n      required: true\n    }, // Comment author\n\n    content: {\n      type: String,\n      required: true,\n      trim: true,\n      maxlength: 500,\n      minlength: 1\n    }, // Comment text\n\n    likes: [\n      {\n        type: Schema.Types.ObjectId,\n        ref: \"User\"\n      }\n    ], // List of users who liked the comment\n\n    parentComment: {\n      type: Schema.Types.ObjectId,\n      ref: \"Comment\"\n    } // For nested replies\n  },\n  { timestamps: true }\n);\n\n//? index for query performance,\ncommentSchema.index({ post: 1 });\ncommentSchema.index({ author: 1 });\ncommentSchema.index({ parentComment: 1 });\n\nconst Comment = model<IComment>(\"Comment\", commentSchema);\n\nexport default Comment;\n"
                            }
                          ]
                        }
                      }
                    },
                    "post": {
                      "architectures": {
                        "mvc": {
                          "files": [
                            {
                              "type": "file",
                              "path": "src/models/post.model.ts",
                              "content": "import mongoose, { Document, Model, Schema, Types } from \"mongoose\";\n\nconst POST_STATUSES = [\"draft\", \"published\", \"archived\"] as const;\n\ntype PostStatus = (typeof POST_STATUSES)[number];\ntype IFile = {\n  public_id: string;\n  url: string;\n  size: number;\n};\n\nexport interface IPost extends Document {\n  _id: Types.ObjectId;\n\n  title: string;\n  slug: string;\n  content: string;\n\n  excerpt?: string;\n  author: Types.ObjectId;\n  category?: Types.ObjectId;\n  tags?: string[];\n  featuredImage: IFile | null;\n\n  views: number;\n  likes: Types.ObjectId[];\n  likeCount: number;\n\n  status: PostStatus;\n  publishedAt?: Date;\n\n  createdAt: Date;\n  updatedAt: Date;\n}\n\nconst postSchema = new Schema<IPost>(\n  {\n    title: {\n      type: String,\n      required: true\n    }, // Blog post title\n\n    slug: {\n      type: String,\n      required: true\n    }, // SEO-friendly URL slug\n\n    content: {\n      type: String,\n      required: true\n    }, // Main blog content\n\n    excerpt: {\n      type: String\n    }, // Short summary\n\n    author: {\n      type: Schema.Types.ObjectId,\n      ref: \"User\",\n      required: true\n    }, // Reference to User\n\n    category: {\n      type: Schema.Types.ObjectId,\n      ref: \"Category\"\n    }, // Reference to category\n\n    tags: {\n      type: [String],\n      default: []\n    }, // List of tags\n\n    featuredImage: {\n      public_id: String,\n      url: String,\n      size: Number\n    }, // Blog cover image URL\n\n    views: {\n      type: Number,\n      default: 0\n    }, // View count\n\n    likes: [\n      {\n        type: Schema.Types.ObjectId,\n        ref: \"User\"\n      }\n    ], // Users who liked the post\n\n    likeCount: {\n      type: Number,\n      default: 0\n    }, // Cached number of likes\n\n    status: {\n      type: String,\n      enum: POST_STATUSES,\n      default: \"draft\"\n    }, // Publication status\n\n    publishedAt: {\n      type: Date\n    } // Date when published\n  },\n  {\n    timestamps: true\n  }\n);\n\n//? indexes for efficient searching and filtering\npostSchema.index({ title: \"text\", content: \"text\" });\npostSchema.index({ author: 1, slug: 1 }, { unique: true });\n\npostSchema.index({ category: 1 }); // Efficient retrieval of posts by category\npostSchema.index({ createdAt: -1 }); // Efficient retrieval of posts by date\n\nconst Post: Model<IPost> =\n  mongoose.models.Post || mongoose.model<IPost>(\"Post\", postSchema);\n\nexport default Post;\n"
                            }
                          ]
                        },
                        "feature": {
                          "files": [
                            {
                              "type": "file",
                              "path": "src/modules/post/post.types.ts",
                              "content": "import { POST_STATUSES } from \"./post.constants\";\n\nexport type PostStatus = (typeof POST_STATUSES)[number];\n"
                            },
                            {
                              "type": "file",
                              "path": "src/modules/post/post.model.ts",
                              "content": "import mongoose, { Document, Model, Schema, Types } from \"mongoose\";\nimport { PostStatus } from \"./post.types\";\nimport { POST_STATUSES } from \"./post.constants\";\n\ninterface IFile {\n  public_id: string;\n  url: string;\n  size: number;\n}\n\nexport interface IPost extends Document {\n  _id: Types.ObjectId;\n\n  title: string;\n  slug: string;\n  content: string;\n\n  excerpt?: string;\n  author: Types.ObjectId;\n  category?: Types.ObjectId;\n  tags?: string[];\n  featuredImage: IFile | null;\n\n  views: number;\n  likes: Types.ObjectId[];\n  likeCount: number;\n\n  status: PostStatus;\n  publishedAt?: Date;\n\n  createdAt: Date;\n  updatedAt: Date;\n}\n\nconst postSchema = new Schema<IPost>(\n  {\n    title: {\n      type: String,\n      required: true\n    }, // Blog post title\n\n    slug: {\n      type: String,\n      required: true\n    }, // SEO-friendly URL slug\n\n    content: {\n      type: String,\n      required: true\n    }, // Main blog content\n\n    excerpt: {\n      type: String\n    }, // Short summary\n\n    author: {\n      type: Schema.Types.ObjectId,\n      ref: \"User\",\n      required: true\n    }, // Reference to User\n\n    category: {\n      type: Schema.Types.ObjectId,\n      ref: \"Category\"\n    }, // Reference to category\n\n    tags: {\n      type: [String],\n      default: []\n    }, // List of tags\n\n    featuredImage: {\n      public_id: String,\n      url: String,\n      size: Number\n    }, // Blog cover image URL\n\n    views: {\n      type: Number,\n      default: 0\n    }, // View count\n\n    likes: [\n      {\n        type: Schema.Types.ObjectId,\n        ref: \"User\"\n      }\n    ], // Users who liked the post\n\n    likeCount: {\n      type: Number,\n      default: 0\n    }, // Cached number of likes\n\n    status: {\n      type: String,\n      enum: POST_STATUSES,\n      default: \"draft\"\n    }, // Publication status\n\n    publishedAt: {\n      type: Date\n    } // Date when published\n  },\n  {\n    timestamps: true\n  }\n);\n\n//? indexes for efficient searching and filtering\npostSchema.index({ title: \"text\", content: \"text\" });\npostSchema.index({ author: 1, slug: 1 }, { unique: true });\n\npostSchema.index({ category: 1 }); // Efficient retrieval of posts by category\npostSchema.index({ createdAt: -1 }); // Efficient retrieval of posts by date\nconst Post: Model<IPost> =\n  mongoose.models.Post || mongoose.model<IPost>(\"Post\", postSchema);\n\nexport default Post;\n"
                            },
                            {
                              "type": "file",
                              "path": "src/modules/post/post.constants.ts",
                              "content": "export const POST_STATUSES = [\"draft\", \"published\", \"archived\"] as const;\n"
                            }
                          ]
                        }
                      }
                    }
                  },
                  "dependencies": {
                    "runtime": [
                      "mongoose"
                    ],
                    "dev": []
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
