14 Star 95 Fork 45

黄富彬 / LibraPlatform

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

Libra-Platform 微服务平台

Libra-Platform微服务平台基于SpringCloud(2020.0.x) + SpringCloudAlibaba(2021.x) + SpringBoot(2.4.x) + Vue3开发,基于多租户SaaS模式的设计,拥有强大的用户中心(一个账号对应多业务身份),权限基于RBAC设计,支持蓝绿灰度发布、网关动态路由、服务治理(流量控制、熔断降级、系统自适应保护、服务鉴权)等功能。Libra-Platform平台架构清晰、代码简介、注解齐全,很适合作为基础框架使用。

架构图

相关功能

相关功能

相关功能

在线体验

演示地址:http://www.librayun.net:8888 (服务器到期,暂时无法提供在线体验)

文档地址:https://www.yuque.com/u28664875/xvkb5a/fl6d3y

img.png

商业合作、技术问题可加微信:Jack-hfbin (添加时请备注好意图)

欢迎关注我的公众号:java技术会所。 技术干货源源不断。

img.png

模块说明

libra-platform -- 父项目
  │─libra-plugin -- 扩展服务治理功能组件
    ├─libra-plugin-common -- 公共
    ├─libra-plugin-bgg -- 蓝绿灰度发布组件
    ├─libra-plugin-nacos -- nacos二次封装组件
    ├─libra-plugin-sentinel -- sentinel二次封装组件
    ├─libra-plugin-gateway -- 网关组件
    ├─libra-plugin-service -- 非网关组件
    ├─libra-plugin-admin-service -- 暴露动态更新配置服务
  ├─libra-auth -- 认证授权服务
  │─libra-common -- 公共工具父级
    ├─libra-common-log -- 封装Log相关
    ├─libra-common-mq -- 封装MQ相关操作
    ├─libra-common-mybatis -- 封装Mybatis Plus相关配置
    ├─libra-common-redis -- 封装Redis相关操作逻辑
    ├─libra-common-security -- 用户鉴权相关处理
    ├─libra-common-springcloud -- 微服务相关组件引用及配置
    ├─libra-common-swagger -- Swagger+Knife4j整合
    ├─libra-core -- 相关公共工具代码封装
  ├─libra-gateway -- 网关SpringCloud Gateway
  ├─libra-service -- 业务服务父级
    ├─libra-ucpm -- 用户中心权限菜单服务
    ├─libra-base -- 基础服务
    ├─libra-gen -- 代码生成服务
    ├─libra-tenant -- 租户服务

相关组件和服务都有使用说明,在对应组件或者服务下的文件,文件名为README.md

其它说明:全链路蓝绿灰度发布及动态路由使用说明在目录libra-plugin下README.md

如何运行项目

建议看此地址教程,五分钟快速启动:https://www.yuque.com/u28664875/xvkb5a/pgczao

# 后端工程
git clone https://gitee.com/huangfubin/LibraPlatform.git
说明:启动项目需要依赖nacos(2.1)、mysql(5.7+)、redis,启动前请先安装好

安装好之后nacos(可以参考官网如何安装)、mysql、redis
第一步:创建好数据库libra-base、libra-gen、libra-tr、libra-ucpm文件目录下create-database.sql是创建数据脚本,可以直接执行,执行完之后执行如下脚本(sql文件下):
    libra-base.sql
    libra-gen.sql
    libra-tr.sql
    libra-ucpm.sql
第二步:访问搭建好nacos服务,将libra服务相关nacos配置文件导入配置中心,在nacos目录下nacos_config.zip(直接导入zip即可)
第三步:启动服务libra-base-service、libra-tenant-service、libra-ucpm-service、libra-auth-service、libra-gateway

# 前端工程
git clone https://gitee.com/huangfubin/LibraPlatformUi.git
npm install --registry=https://registry.npm.taobao.org
npm install
npm run dev

访问地址:http://localhost:9527

相关工具截图

APM Skywalking

拓扑图 Skywalking 仪表盘 Skywalking 调用链路 Skywalking

Sentinel 熔断限流

Sentinel

Prometheus + Grafana 监控

服务监控 Prometheus

Libra-Platform 功能说明

租户配置

租户配置包括了两块内容,租户管理和菜单模板。租户管理主要用来创建租户。菜单模板用来配置租户菜单权限模板,此模块的设计主要为了达到不同的租户等级可以配置不同的租户菜单。

租户管理

租户管理功能包括新增、查询、修改、禁用等功能。

  • 新增租户时候默认会初始化租户默认部门、默认角色、管理员账号等相关信息(注意:默认的数据在系统是无法操作的,相关的界面及接口都做了判断)
  • 特别说明租户编码是作为整个系统数据隔离的重要字段,一旦创建不建议修改,如果要修改需要将相关表的租户字段更新为最新的租户编码,后续作为扩展功能完善
租户列表

租户列表

新增租户

新增租户

菜单模板

菜单模板功能包括新增、查询、修改、权限同步等功能。

  • 菜单模板修改时候不会将关联此菜单模板的租户权限同步到默认角色里,需要另外操作一下权限同步功能,将此菜单权限同步到租户管理员角色
菜单模板列表

菜单模板列表

新增菜单模板

新增菜单模板

组织管理

租户配置包括了员工管理、部门管理、角色管理、岗位管理

员工管理

员工管理功能包括新增、查询、修改、重置密码,删除等功能。

  • 新增员工的账号和手机号做为账号的唯一标识,部门和角色为必填
员工管理列表

员工管理列表

新增员工

新增员工

部门管理

部门管理功能包括新增、查询、修改、删除等功能。

  • 当部门有关联了用户对应的部门是无法删除
  • 系统默认部门无法删除,可修改,创建租户时候默认以租户名称创建默认部门
部门管理列表

部门管理列表

角色管理

角色管理功能包括新增、查询、修改、删除等功能。

  • 角色组及角色在创建租户时候会默认创建,对应的权限无法编辑及删除
角色管理列表

角色管理列表

岗位管理

岗位管理功能包括新增、查询、修改、删除等功能。

岗位管理列表

岗位管理列表

系统设置

系统设置包括了菜单管理、接口管理、版本管理、终端管理、操作日志、登录日志

菜单管理

菜单管理功能包括新增、查询、修改、删除、接口权限配置等功能。

  • 接口权限配置是用来做接口管理的接口绑定,后端在验证接口权限鉴权时候使用此关联关联数据做校验。此模块设计初衷,当业务线较为复杂时候很多接口会在不同功能模块调用,此时就可以灵活配置接口权限了
  • 菜单可以根据不同的应用端去配置
菜单管理列表

菜单管理列表

新增菜单

新增菜单

接口权限配置

接口权限配置

接口管理

接口管理功能包括新增、查询、修改、删除等功能。

  • 接口管理可以区分不同应用端的接口,这样更有效管理
接口管理列表

接口管理列表

应用管理

应用管理功能包括新增、查询、修改、删除等功能。

  • 菜单模块与接口模块需要与应用关联,在不用的应用端只会返回对应端菜单
应用管理列表

应用管理列表

操作日志

操作日志模块目前只提供两种类型,操作日志及登录日志,如果需要扩展可对libra-common-log组件进行类型扩展。

操作日志列表

操作日志列表

开发工具

开发工具模块包括数据源管理、代码生成、版本管理。

数据源管理

提供不同数据源配置便捷代码生成模块 数据源管理

代码生成

可切换不同数据源生成代码,代码生成会生成前端页面代码、后端代码、菜单接口sql 代码生成

版本管理

版本管理模块的主要目的是在迭代推进的过程中我们菜单和接口可能一直在变,此时在切到对应环境时候无需重新添加菜单及接口,此模块会提供一个一键导出当前版本菜单及接口变动的sql文件。

版本管理列表

版本管理列表

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.

简介

📣📣📣 Libra-Platform微服务平台。基于SpringCloud+ SpringCloudAlibaba+SpringBoot+Vue3开发,基于多租户SaaS模式的设计,拥有强大的用户中心(一个账号对应多业务身份),权限基于RBAC设计,支持蓝绿灰度发布、网关动态路由、服务治理(流量控制、熔断降级、系统自适应保护、服务鉴权)等功能 展开 收起
Java 等 4 种语言
Apache-2.0
取消

贡献者

全部

近期动态

加载更多
不能加载更多了
1
https://gitee.com/huangfubin/LibraPlatform.git
git@gitee.com:huangfubin/LibraPlatform.git
huangfubin
LibraPlatform
LibraPlatform
v2.0.x

搜索帮助