1 Star 0 Fork 796

123yaohao / orange-admin

forked from orange-form / orange-admin 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
Apache-2.0

橙单简介

橙单中台化低代码生成工具由知视科技团队研发,团队经过多年大型企业中台化改造项目的历练,不断总结经验教训,不断努力提升产能,不断积极应对微服务改造过程中出现的分分合合。在历经无数日夜的持续迭代和优化后,终于可以实现生成 70% 的适用于微服务架构的高质量范式化工程级代码。此后,我们就很少加班,热爱工作,并与领导成为了战友,与客户成为了朋友。

橙单生成器

如果说基础框架是技术轮子,那么我们就是生产线。不仅可以造出各种尺寸的轮子,通过我们的在线配置工具,还能生成您的更多业务所需。下图所示的微服务组件,在创建项目时可正交化组合。生成后的工程不仅可用于企业中台化改造,同样也适用于开发者进行微服务全技术栈的快速学习。

在线资源

主要功能

  • 支持前后端全部主流技术栈的自由组合,并可根据所选配置动态生成工程的基础架构。
  • 前端支持基于 Fragment 和 Block 的嵌套布局,配置后即可生成多样化的表单页面,支持高交互性的全工程预览。
  • 提供极为完善且灵活的用户权限管理和数据权限过滤等基础性功能,运行时性能高度优化。
  • 可创建多数据库、多应用服务,并导入业务数据表,配置服务内或服务间的复杂表关联关系。目前已支持服务内和跨服务的"一对一关联、一对多关联、多对多关联、字典关联、一对多和多对多分组聚合计算"等范式化关联关系代码的生成。
  • 有别于其他产品,我们不仅支持多种主流 Job 框架的集成,更能生成适配 Job 框架的定时任务业务逻辑代码。目前已支持“全量同步、增量同步、增量分组聚合转换同步”等业务代码的生成。
  • 项目生成具备较强的裁剪性,既可选择生成不包含权限和表单的适用于 app 的纯后台服务,也可生成支持表单和权限的完整中后台工程。
  • 微服务和单体服务的代码风格、接口命名与参数定义规范完全一致,便于您今后的平滑升级。

竞争优势

  • 排在首位的就是 15 万字以上的专业、详尽、完善和暗黑护眼的操作指南、开发文档和教学视频。
  • 真正的低代码生成工具,而非单纯的敏捷脚手架,可生成 70% 以上相对复杂的中台化业务代码。
  • 浅显易懂的极高质量生成后工程代码,经过 SonarQube 和 Alibaba 代码规范严格扫描。
  • 合理、透明、全网超低价的教学版和企业版商业授权。(请我们撸一次串的价格)

关于我们

  • S.L 老师,20年开发经验,后台全栈架构师,代码强迫症、性能洁癖、能看出一像素偏差。精通 C++/Java/Scala/Web高并发/大数据/C++服务器/视频直播网络技术,略懂容器。
  • J.T 老师,15年开发经验,前端全栈架构师,思维极缜密、号边界王。精通 C++/Java/Javascript/Vue & React/C++客户端/Android原生/小程序/视频直播编解码技术。
  • 欢迎加入我们的技术交流 QQ 群,几乎每天都有30分钟的技术分享。
  • 由于被恶意举报,如果您通过群号搜索不到,请添加作者的 QQ (3510245832),我们会将您拉入群中。 QQ群

生成后工程

可无限制的用于学习、培训、接私活、公司自用和开发商业项目等场景,其中基础框架代码将永久免费,并持续更新。

开箱即用

项目信息如您所愿,工程名称、目录结构、基础包名、common模块、代码注释中的 @author 信息等,在创建工程时即已配置,不会留有橙单的任何信息。因此无需二次修改,前后端直接编译运行即可。如编译期和运行时出现问题,那一定是我们的 bug,在得到您反馈后,我们将及时修复。

技术选型

  • 前端: Element (Vue) / Ant Design (React) + ECharts / AntV + Axios + Webpack。
  • 后端: Spring Boot / Spring Cloud / Spring Cloud Alibaba + Spring Security OAuth2 + Mybatis + Jwt。
  • 工具库: Hutool + Guava + Caffeine + Lombok + MapStruct + Mybatis Plus + tk mapper + Knife4j + qdox。
  • 服务组件: Redis + Zookeeper + Consul + Apollo + XXL-Job + Quartz + Seata + Minio + Canal + RocketMQ + Kafka + Nacos + Sentinel + Nepxion Discovery。
  • 系统监控: ELK + PinPoint / SkyWalking + Grafana + Prometheus。

基础功能

  • 前端框架:单页面、多标签、多栏目和子路由,多套高颜值样式主题可供选择。
  • 前端能力:列表编辑、统计图表、多表联动、明细数据下钻、上传下载、数据导出、自定义打印样式模板、富文本等。
  • 页面布局:支持基于 Fragment 和 Block 的灵活布局方式,通过配置即可生成多样化的表单页面,并可预览。
  • 接口规范:微服务和单体服务的接口命名和参数定义规范完全一致,便于日后的平滑升级。
  • 后台架构:分布式锁、分布式 Id、分布式缓存、分布式事务、分布式限流和灰度发布等,按需集成。
  • 用户管理:支持基于 OAuth2 的单点登录。
  • 操作权限:前端控制可精确到按钮级的操作和标签级的显示,同时提供了多维度的权限分配路径查询能力。
  • 数据权限:基于 Mybatis 拦截器 + JSqlParser 的实现方式,配置更灵活,代码侵入性更低。
  • 多数据源:可根据配置动态生成,路由策略灵活可扩展。
  • 数据组装:Java 注解方式实现数据组装,支持统一接口的服务内和跨服务的一对一、一对多、多对多、字典、聚合计算等关系数据组合。
  • 定时任务:我们不仅提供了多套 Job 基础框架的集成,更能生成灵活可配、高度优化、便于二次开发的 Job 业务逻辑代码。
  • 系统监控:基于 Kafka + ELK 的日志收集,基于 PinPoint/SkyWalking 的服务链路跟踪,基于 GPE 的服务性能指标监控。
  • 接口文档:目前已集成 Knife4j,同时支持基于 qdox 逆推 Java 工程代码,实现 0 注解导出 Postman 接口文件和 Markdown 文档。
  • 缓存同步:同时集成了 Canal-Admin 和 Canal-Server,以便于用户的 Canal Instance 管理。目前已实现字典变化数据到 Redis 的实时缓存同步。

设计理念

  • 前沿的单表组合式设计,使业务服务的拆分与再合并 SO EASY。
  • 先代码,后 SQL 的主流中台化设计原则,让服务横向扩充更具弹性。
  • 标准化的服务间调用接口,使业务服务组合更具正交性。
  • 前后端基于约定各司其职,默契配合,让系统运行飞起来。
  • 可平滑的逐步演化为云原生架构。

代码质量

  • 无任何二次封装,只生成您最懂的代码。
  • 遵循阿里巴巴标准的代码规范。
  • SonarQube 基于最严格检测规则的代码扫描。
  • 产品级代码质量,层次清晰、滴水不漏。
  • 近乎于 0 的代码重复率,35% 以上的注释覆盖率。
  • 15 年架构师优化的每一处细节。

规则扫描

此为在线演示工程的代码审查报告,而非当前开源示例工程。前者代码量更大,结构更复杂。

  1. SonarQube 扫描
  • 基于 SonarQube8.2 缺省最严格的代码扫描规则,其中代码复杂度要求为 15。
  • 有气味代码共90处,其中85处为DTO、Model、常量字典、RPC接口等定义出现重复名称所致,均与模拟实际业务有关。
  • 其余气味代码,是在权衡性能、可读性和易修改性等因素后保留下来的,具体见图4。
  1. Alibaba Code Guide 扫描
  • 下载最新版本IDEA插件,同时打开所有审查条件。
  • 全部代码扫描通过。
  1. Statistic 代码统计
  • 生成代码总量约为86000多行,主要包括Java、XML、YAML和SQL初始化脚本等。
  • Java代码覆盖率为37%。

开源工程部署

  1. 目录说明

根据用户的反馈,我们已经支持生成纯app后台服务。该服务并不包含权限和表单,以便于用户迅速上手开发app后台。

  • 微服务app后端工程:orange-demo-multi-service-for-app
  • 单体服务app后端工程:orange-demo-single-service-for-app
  • 微服务后端工程:orange-demo-multi-service
  • 微服务前端工程:orange-demo-multi-web
  • 单体服务后端工程:orange-demo-single-service
  • 单体服务前端工程:orange-demo-single-web
  1. 数据初始化。
  • 通过常用的数据库访问工具(如:navicat),执行工程目录下的zz-resource/db-scripts/zz-orange-demo.sql文件。
  • 导入脚本主要负责,数据库创建、数据表创建和测试数据的插入。
  1. Api接口文档
  1. 环境准备。
    docker是必选组件。通过docker-compose命令,可快速启停服务所依赖的服务中间件,如nacos、redis、zookeeper、kafka和sentinel dashboard等。中间件的控制台访问方式,可参考工程目录下的README文件。
# 假定当前目录为工程根目录。
cd zz-resource/docker-files
# 启动和停止带有基础服务中间件的docker-compose.yml文件
docker-compose up -d
# 彻底终止容器
docker-compose down
# 在第一次启动之后,可以考虑每次执行下面的命令启动和停止容器。
docker-compose start
docker-compose stop
  1. 后台工程导入。
    以Maven的形式导入IDE,直接编译运行即可。具体可参考我们的开发文档教学版微服务工程导入章节

  2. 后台服务配置。

  • 进入工程目录下的 zz-resource/config-data/ 子目录,修改和数据库相关的配置,具体操作详见下图及文字注释。
  • 将该目录下的所有配置文件导入nacos。nacos控制台访问地址 localhost:8848/nacos,用户名和密码 nacos/nacos。
  • 具体导入方式可参考我们的开发文档服务配置章节
  1. 后台服务启动。
    这里仅以upms服务为例。在开发环境中,为每个微服务启动项配置main class,下图为IntelliJ IDEA中的配置截图,配置后点击Debug/Run按钮即可启动。

  2. 前端工程导入和启动。

  • 将前端工程导入vscode。
  • 修改 src -> core -> config 下的配置文件,将baseUrl修改为您服务器地址。
  • 安装依赖,执行 npm install。
  • 启动前端服务,执行 npm run dev。
  • 具体可参考我们的开发文档教学版前端工程启动段落

主要截图

橙单生成器

演示工程

集成组件

开发文档

价值理念

都看到这里了,如果看的仔细,至少要花 20 分钟,非常感谢您的坚持和耐心,希望能再花 1 秒钟的时间在下面 star 一下。

Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

简介

我们在橙单生成器中创建了一个Spring Cloud Alibaba项目,此后又配置了一些数据模型关联关系,现在将生成后的项目开源。希望通过工程中的高质量代码,能让我们彼此间有些许了解。方便的话,Fork同时也Star一下! 展开 收起
Java
Apache-2.0
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
Java
1
https://gitee.com/753159/orange-admin.git
git@gitee.com:753159/orange-admin.git
753159
orange-admin
orange-admin
master

搜索帮助