{"id":13457740,"url":"https://github.com/cool-team-official/cool-admin-midway","last_synced_at":"2025-05-13T17:04:50.275Z","repository":{"id":37730461,"uuid":"342884320","full_name":"cool-team-official/cool-admin-midway","owner":"cool-team-official","description":"🔥 cool-admin(midway版)一个很酷的后台权限管理框架，Ai编码、流程编排、模块化、插件化、CRUD极速开发，永久开源免费，基于nodejs、typescript、typeorm、mysql、jwt、vue3、vite、element-ui等构建","archived":false,"fork":false,"pushed_at":"2025-05-13T08:05:51.000Z","size":6809,"stargazers_count":2873,"open_issues_count":99,"forks_count":654,"subscribers_count":39,"default_branch":"8.x","last_synced_at":"2025-05-13T09:24:50.986Z","etag":null,"topics":["bull","docker","element-plus","jwt","koa2","midway","mysql","redis","serverless","typeorm","typescript","vite","vue","vue3-typescript"],"latest_commit_sha":null,"homepage":"https://cool-js.com","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cool-team-official.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-02-27T15:05:54.000Z","updated_at":"2025-05-13T08:05:55.000Z","dependencies_parsed_at":"2022-07-16T16:00:35.762Z","dependency_job_id":"2111fd16-8dad-481c-80a3-fa8e5c4c5d5b","html_url":"https://github.com/cool-team-official/cool-admin-midway","commit_stats":{"total_commits":275,"total_committers":14,"mean_commits":"19.642857142857142","dds":0.3163636363636364,"last_synced_commit":"9d90b9910528d22728796a942f382d378d0357d9"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cool-team-official%2Fcool-admin-midway","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cool-team-official%2Fcool-admin-midway/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cool-team-official%2Fcool-admin-midway/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cool-team-official%2Fcool-admin-midway/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cool-team-official","download_url":"https://codeload.github.com/cool-team-official/cool-admin-midway/tar.gz/refs/heads/8.x","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253912436,"owners_count":21983136,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bull","docker","element-plus","jwt","koa2","midway","mysql","redis","serverless","typeorm","typescript","vite","vue","vue3-typescript"],"created_at":"2024-07-31T09:00:35.227Z","updated_at":"2025-05-13T17:04:50.246Z","avatar_url":"https://github.com/cool-team-official.png","language":"TypeScript","funding_links":[],"categories":["TypeScript","前端 + 后端中后台框架"],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://midwayjs.org/\" target=\"blank\"\u003e\u003cimg src=\"https://cool-show.oss-cn-shanghai.aliyuncs.com/admin/logo.png\" width=\"200\" alt=\"Midway Logo\" /\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003ecool-admin(nodejs版)一个很酷的后台权限管理系统，开源免费，Ai编码、流程编排、模块化、插件化、极速开发CRUD，方便快速构建迭代后台管理系统，支持原生、docker、普通服务器等多种方式部署\n到 \u003ca href=\"https://cool-js.com\" target=\"_blank\"\u003e官网\u003c/a\u003e 进一步了解。\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://github.com/cool-team-official/cool-admin-midway/blob/master/LICENSE\" target=\"_blank\"\u003e\u003cimg src=\"https://img.shields.io/badge/license-MIT-green?style=flat-square\" alt=\"GitHub license\" /\u003e\n    \u003ca href=\"\"\u003e\u003cimg src=\"https://img.shields.io/github/package-json/v/cool-team-official/cool-admin-midway?style=flat-square\" alt=\"GitHub tag\"\u003e\u003c/a\u003e\n    \u003cimg src=\"https://img.shields.io/github/last-commit/cool-team-official/cool-admin-midway?style=flat-square\" alt=\"GitHub tag\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n## 特性\n\nAi 时代，很多老旧的框架已经无法满足现代化的开发需求，Cool-Admin 开发了一系列的功能，让开发变得更简单、更快速、更高效。\n\n- **Ai 编码**：通过微调大模型学习框架特有写法，实现简单功能从 Api 接口到前端页面的一键生成[详情](https://node.cool-admin.com/src/guide/ai.html)\n- **流程编排**：通过拖拽编排方式，即可实现类似像智能客服这样的功能[详情](https://node.cool-admin.com/src/guide/flow.html)\n- **多租户**：支持多租户，采用全局动态注入查询条件[详情](https://node.cool-admin.com/src/guide/core/tenant.html)\n- **多语言**：基于大模型自动翻译，无需更改原有代码[详情](https://node.cool-admin.com/src/guide/core/i18n.html)\n- **原生打包**：打包成 exe 等安装包，打包完可以直接运行在 windows、mac、linux 等操作系统上[详情](https://node.cool-admin.com/src/guide/core/pkg.html)\n- **模块化**：代码是模块化的，清晰明了，方便维护\n- **插件化**：插件化的设计，可以通过安装插件的方式扩展如：支付、短信、邮件等功能\n- ......\n\n![](https://cool-show.oss-cn-shanghai.aliyuncs.com/admin/flow.png)\n\n## 技术栈\n\n- 后端：**`node.js` `typescript`**\n- 前端：**`vue.js` `element-plus` `jsx` `pinia` `vue-router`**\n- 数据库：**`mysql` `postgresql` `sqlite`**\n\n如果你是前端，后端的这些技术选型对你是特别友好的，前端开发者可以较快速地上手。\n如果你是后端，Typescript 的语法又跟 java、php 等特别类似，一切看起来也是那么得熟悉。\n\n如果你想使用 java 版本后端，请移步[cool-admin-java](https://cool-js.com/admin/java/introduce.html)\n\n#### 官网\n\n[https://cool-js.com](https://cool-js.com)\n\n## 视频教程\n\n[官方 B 站视频教程](https://www.bilibili.com/video/BV1j1421R7aB)\n\n\u003c!-- 在此次添加使用文档 --\u003e\n\n## 演示\n\n[AI 极速编码](https://node.cool-admin.com/src/guide/ai.html)\n\n[https://show.cool-admin.com](https://show.cool-admin.com)\n\n- 账户：admin\n- 密码：123456\n\n\u003cimg src=\"https://cool-show.oss-cn-shanghai.aliyuncs.com/admin/home-mini.png\" alt=\"Admin Home\"\u003e\u003c/a\u003e\n\n#### 项目前端\n\n[https://github.com/cool-team-official/cool-admin-vue](https://github.com/cool-team-official/cool-admin-vue)\n\n或\n\n[https://gitee.com/cool-team-official/cool-admin-vue](https://gitee.com/cool-team-official/cool-admin-vue)\n\n或\n\n[https://gitcode.com/cool_team/cool-admin-vue](https://gitcode.com/cool_team/cool-admin-vue)\n\n## 微信群\n\n\u003cimg width=\"260\" src=\"https://cool-show.oss-cn-shanghai.aliyuncs.com/admin/wechat.jpeg?v=1\" alt=\"Admin Wechat\"\u003e\u003c/a\u003e\n\n## 运行\n\n#### 修改数据库配置，配置文件位于`src/config/config.local.ts`\n\n以 Mysql 为例，其他数据库请参考[数据库配置文档](https://cool-js.com/admin/node/quick.html#%E6%95%B0%E6%8D%AE%E5%BA%93%E9%85%8D%E7%BD%AE)\n\nMysql(`\u003e=5.7版本`)，建议 8.0，node 版本(`\u003e=18.x`)，首次启动会自动初始化并导入数据\n\n```ts\n// mysql，驱动已经内置，无需安装\ntypeorm: {\n    dataSource: {\n      default: {\n        type: 'mysql',\n        host: '127.0.0.1',\n        port: 3306,\n        username: 'root',\n        password: '123456',\n        database: 'cool',\n        // 自动建表 注意：线上部署的时候不要使用，有可能导致数据丢失\n        synchronize: true,\n        // 打印日志\n        logging: false,\n        // 字符集\n        charset: 'utf8mb4',\n        // 是否开启缓存\n        cache: true,\n        // 实体路径\n        entities: ['**/modules/*/entity'],\n      },\n    },\n  },\n```\n\n#### 安装依赖并运行\n\n```bash\n$ npm i\n$ npm run dev\n```\n\n启动完成访问：[http://localhost:8001/](http://localhost:8001)\n\n注： `npm i`如果安装失败可以尝试使用切换您的镜像源，推荐使用[pnpm](https://pnpm.io/)安装\n\n## CURD(快速增删改查)\n\n大部分的后台管理系统，或者 API 服务都是对数据进行管理，所以可以看到大量的 CRUD 场景(增删改查)，cool-admin 对此进行了大量地封装，让这块的编码量变得极其地少。\n\n#### 新建一个数据表\n\n`src/modules/demo/entity/goods.ts`，项目启动数据库会自动创建该表，无需手动创建\n\n```ts\nimport { BaseEntity } from '../../base/entity/base';\nimport { Column, Entity, Index } from 'typeorm';\n\n/**\n * 商品\n */\n@Entity('demo_app_goods')\nexport class DemoAppGoodsEntity extends BaseEntity {\n  @Column({ comment: '标题' })\n  title: string;\n\n  @Column({ comment: '图片' })\n  pic: string;\n\n  @Column({ comment: '价格', type: 'decimal', precision: 5, scale: 2 })\n  price: number;\n}\n```\n\n#### 编写 api 接口\n\n`src/modules/demo/controller/app/goods.ts`，快速编写 6 个 api 接口\n\n```ts\nimport { CoolController, BaseController } from '@cool-midway/core';\nimport { DemoAppGoodsEntity } from '../../entity/goods';\n\n/**\n * 商品\n */\n@CoolController({\n  api: ['add', 'delete', 'update', 'info', 'list', 'page'],\n  entity: DemoAppGoodsEntity,\n})\nexport class DemoAppGoodsController extends BaseController {\n  /**\n   * 其他接口\n   */\n  @Get('/other')\n  async other() {\n    return this.ok('hello, cool-admin!!!');\n  }\n}\n```\n\n这样我们就完成了 6 个接口的编写，对应的接口如下：\n\n- `POST /app/demo/goods/add` 新增\n- `POST /app/demo/goods/delete` 删除\n- `POST /app/demo/goods/update` 更新\n- `GET /app/demo/goods/info` 单个信息\n- `POST /app/demo/goods/list` 列表信息\n- `POST /app/demo/goods/page` 分页查询(包含模糊查询、字段全匹配等)\n\n### 部署\n\n[部署教程](https://node.cool-admin.com/src/guide/deploy.html)\n\n### 内置指令\n\n- 使用 `npm run lint` 来做代码风格检查。\n\n[midway]: https://midwayjs.org\n\n### 低价服务器\n\n[阿里云、腾讯云、华为云低价云服务器，不限新老](https://cool-js.com/service/cloud)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcool-team-official%2Fcool-admin-midway","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcool-team-official%2Fcool-admin-midway","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcool-team-official%2Fcool-admin-midway/lists"}