{"id":13486870,"url":"https://github.com/atzcl/z","last_synced_at":"2025-07-11T12:34:11.700Z","repository":{"id":55059039,"uuid":"124681542","full_name":"atzcl/z","owner":"atzcl","description":"基于 MidwayJS(EggJS) + TypeScript 的多模块应用 [ NodeJS 版 ]","archived":false,"fork":false,"pushed_at":"2023-12-01T22:40:18.000Z","size":502,"stargazers_count":128,"open_issues_count":1,"forks_count":20,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-04-27T19:46:07.860Z","etag":null,"topics":["egg","midway","midwayjs","sequelize","ts","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/atzcl.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2018-03-10T17:43:06.000Z","updated_at":"2025-02-18T07:00:05.000Z","dependencies_parsed_at":"2024-04-06T22:32:02.788Z","dependency_job_id":"a007bd4e-1197-4023-a0e0-46d0493a94a5","html_url":"https://github.com/atzcl/z","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/atzcl/z","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atzcl%2Fz","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atzcl%2Fz/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atzcl%2Fz/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atzcl%2Fz/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/atzcl","download_url":"https://codeload.github.com/atzcl/z/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atzcl%2Fz/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264806814,"owners_count":23666687,"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":["egg","midway","midwayjs","sequelize","ts","typescript"],"created_at":"2024-07-31T18:00:52.315Z","updated_at":"2025-07-11T12:34:11.662Z","avatar_url":"https://github.com/atzcl.png","language":"TypeScript","readme":"# z\n\u003e 基于以下技术构建\n- Node.js \u0026 MidwayJS(EggJS)\n- TypeScript\n- Redis\n- MySQL 5.7 以上\n- Sequelize\n- \u003cdel\u003e TypeORM 底层还在进行大重构，暂时不适宜用于生产环境\u003c/del\u003e\n- Socket.io\n- \u003cdel\u003eGraphQL\u003cdel\u003e\n- ...\n\n## 注意事项\n**因为 `midwayjs` 使用了 `IoC` 容器进行依赖解耦，所以开发方式会跟 `eggjs` 有些不一样，建议先阅读 [midwayjs 官方文档](https://midwayjs.org/midway/)、[Injection 文档](https://midwayjs.org/injection/guide.html)**\n\n**验证码模块使用了 `node-canvas` 库, 所以请先根据 [node-canvas 文档](https://github.com/Automattic/node-canvas) 安装好相应的依赖**\n\n\n## 模块开发目录\n开发目录为：`src/app/modules/*`\n\n## 快速开始\n\u003e 请确保已经拉取项目到本地环境,并且安装配置好 Node/yarn\n\n**1、安装依赖**\n```bash\nyarn\n```\n\n**2、copy `config` 配置**\n```bash\ncp src/config/config.example src/config/config.default.ts\n```\n然后修改对应的配置信息\n\n**3、执行数据库迁移**\n\u003esequelize-cli 的数据库迁移并不好用，主要是它没办法定义多目录的 migration, 所以当前使用的是 typeorm 的数据库迁移功能\n\n\u003e遇到出现 UnhandledPromiseRejectionWarning: QueryRunnerAlreadyReleasedError: Query runner already released. Cannot run queries anymore. 错误，请无需担心，这是 typeorm 的一个 bug, 不会影响迁移结果\n```bash\nyarn typeorm migration:run\n```\n\n**4、运行**\n```bash\nyarn dev\n```\n\n## 部署\n\u003e 更多请看 [midway 部署](https://midwayjs.org/midway/guide.html#%E9%83%A8%E7%BD%B2)\n\n**使用 docker**\n详见 docker 手册跟 Dockerfile\n\n**使用 pm2**\n```bash\npm2 start ecosystem.config.js\n```\n\n**使用 egg-scripts**\n```bash\nyarn start\n```\n\n## 辅助开发的 Cli 命令\n\u003e 对应代码目录: src/console\n\n```bash\n// 待补充\n```\n","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatzcl%2Fz","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fatzcl%2Fz","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatzcl%2Fz/lists"}