# ebuilder-server **Repository Path**: geeguo-open/ebuilder-server ## Basic Information - **Project Name**: ebuilder-server - **Description**: eBuilder是一个基于Spring Boot的SaaS化系统快速开发平台,方便Java开发者快速搭建开发自己的SaaS化系统。该项目为服务端代码。 - **Primary Language**: Java - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-08-02 - **Last Updated**: 2025-08-24 ## Categories & Tags **Categories**: Uncategorized **Tags**: saas, SpringBoot3 ## README # 项目介绍 感谢各位开发者的支持,文档在继续完善中,敬请期待。 ## 简介 eBuilder是一个基于Spring Boot的SaaS化系统快速开发平台,方便Java开发者快速搭建开发自己的SaaS化系统。 服务端采用SpringBoot3做为开发框架,详细技术参见技术栈部分;Web端开发框架采用Vue3,UI采用Arco Design。 同时该快速开发平台充分考虑了开发者的后期扩展需求。 此项目为服务端。 ## 平台组成 该平台包括两大系统: 1、运营系统:负责整个平台所有租户的运营管理,包括租户管理、数据源管理等,开发者可根据需求进行运营功能扩展。 2、客户系统:SaaS模式的客户系统,为客户提供最终服务的系统,开发者在该系统下开发自己的SaaS化产品。 ## 服务组成 该项目包括三个接口服务、两个Web前端。 三个接口服务如下: ebuilder-operation-web-server 运营系统的Web端接口服务,为运营系统Web端提供接口服务。 ebuilder-operation-api-server 运营系统的内部接口服务,为内部其他服务提供接口服务,禁止外网访问。 ebuilder-client-web-server 客户系统Web端接口服务,为客户系统Web端提供接口服务,该服务为SaaS模式。 两个Web前端如下: ebuilder-operation-web 运营系统的Web端,详见: https://gitee.com/geeguo-open/ebuilder-operation-web ebuilder-client-web 客户系统的Web端,详见: https://gitee.com/geeguo-open/ebuilder-client-web # 技术栈 ```text 语言:JDK17 开发框架: Spring Boot 3 数据库:MySQL + Druid + Dynamic-Datasource + Mybatis + Mybatis-Plus 缓存:Redis + Lettuce 消息队列:RocketMQ 5.3.2 服务间接口调用:OpenFeign 服务注册、发现及配置管理:Nacos 接口文档及增强:Swagger + Knife4j ``` # 快速开始 1、安装JDK17、Maven3、开发工具 2、安装MySQL服务,版本8.x 3、创建数据库:ebuilder-operation,数据库初始化脚本: ebuilder-attachment/sql/ebuilder-operation.sql 4、创建数据库:ebuilder-client,数据库初始化脚本: ebuilder-attachment/sql/ebuilder-client.sql 5、安装Redis服务 6、安装RocketMQ服务 7、安装Nacos服务,版本3.x 8、创建Nacos命名空间:ebuilder-dev 9、在Nacos命名空间ebuilder-dev中导入应用配置文件:ebuilder-attachment/nacos-config/nacos_config.zip 10、在Naocs中修改刚刚导入的应用配置文件,修改成自己的配置。 group为ebuilder-operation的application.yaml ```text spring: datasource: url: jdbc:mysql://127.0.0.1:3306/ebuilder-operation?useUnicode=true&characterEncoding=utf8&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true&useSSL=false&serverTimezone=GMT%2B8 username: root password: root data: redis: host: 127.0.0.1 port: 6379 password: 123456 rocketmq: name-server: 127.0.0.1:9876 ``` group为ebuilder-client的application.yaml ```text spring: datasource: url: jdbc:mysql://127.0.0.1:3306/ebuilder-client?useUnicode=true&characterEncoding=utf8&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true&useSSL=false&serverTimezone=GMT%2B8 username: root password: root data: redis: host: 127.0.0.1 port: 6379 password: 123456 rocketmq: name-server: 127.0.0.1:9876 ``` 11、进入项目根目录,使用Maven构建。 12、修改项目中的应用配置文件,主要修改自己的nacos配置信息。 ebuilder-operation-web-server的配置文件:ebuilder-operation-web-server/src/main/resources/bootstrap.yml ```text spring: config: activate: on-profile: dev cloud: inetutils: # 忽略eth1至eth2网卡,不将它们用于服务注册 ignored-interfaces: eth[1-2] # 优先选择该网段的IP地址 preferred-networks: 192.168 # 只使用私有IP地址(如10.x.x.x, 172.16.x.x-172.31.x.x, 192.168.x.x) use-only-site-local-interfaces: true nacos: discovery: server-addr: 127.0.0.1:8848 namespace: 08e24e5c-f1c6-4e43-b210-55ddd357a791 group: ebuilder username: "nacos" password: "nacos" identity-key: VGhpc0lzTXlDdXN0b21TZWNyZXRLZXkwMTIzNDU2Nzg= config: server-addr: ${spring.cloud.nacos.discovery.server-addr} namespace: 08e24e5c-f1c6-4e43-b210-55ddd357a791 group: ebuilder-operation username: "nacos" password: "nacos" identity-key: VGhpc0lzTXlDdXN0b21TZWNyZXRLZXkwMTIzNDU2Nzg= extension-configs: - data-id: application.yaml group: ebuilder-operation refresh: true ``` ebuilder-operation-api-server的配置文件:ebuilder-operation-api-server/src/main/resources/bootstrap.yml ```text spring: config: activate: on-profile: dev cloud: inetutils: # 忽略eth1至eth2网卡,不将它们用于服务注册 ignored-interfaces: eth[1-2] # 优先选择该网段的IP地址 preferred-networks: 192.168 # 只使用私有IP地址(如10.x.x.x, 172.16.x.x-172.31.x.x, 192.168.x.x) use-only-site-local-interfaces: true nacos: discovery: server-addr: 127.0.0.1:8848 namespace: 08e24e5c-f1c6-4e43-b210-55ddd357a791 group: ebuilder username: "nacos" password: "nacos" identity-key: VGhpc0lzTXlDdXN0b21TZWNyZXRLZXkwMTIzNDU2Nzg= config: server-addr: ${spring.cloud.nacos.discovery.server-addr} namespace: 08e24e5c-f1c6-4e43-b210-55ddd357a791 group: ebuilder-operation username: "nacos" password: "nacos" identity-key: VGhpc0lzTXlDdXN0b21TZWNyZXRLZXkwMTIzNDU2Nzg= extension-configs: - data-id: application.yaml group: ebuilder-operation refresh: true ``` ebuilder-client-web-server的配置文件:ebuilder-client-web-server/src/main/resources/bootstrap.yml ```text spring: config: activate: on-profile: dev cloud: inetutils: # 忽略eth1至eth2网卡,不将它们用于服务注册 ignored-interfaces: eth[1-2] # 优先选择该网段的IP地址 preferred-networks: 192.168 # 只使用私有IP地址(如10.x.x.x, 172.16.x.x-172.31.x.x, 192.168.x.x) use-only-site-local-interfaces: true nacos: discovery: server-addr: 127.0.0.1:8848 namespace: 08e24e5c-f1c6-4e43-b210-55ddd357a791 group: ebuilder username: "nacos" password: "nacos" identity-key: VGhpc0lzTXlDdXN0b21TZWNyZXRLZXkwMTIzNDU2Nzg= config: server-addr: ${spring.cloud.nacos.discovery.server-addr} namespace: 08e24e5c-f1c6-4e43-b210-55ddd357a791 group: ebuilder-client username: "nacos" password: "nacos" identity-key: VGhpc0lzTXlDdXN0b21TZWNyZXRLZXkwMTIzNDU2Nzg= extension-configs: - data-id: application.yaml group: ebuilder-client refresh: true ``` 13、启动服务,启动时部分先后顺序,但是运行时,ebuilder-client-web-server会请求ebuilder-operation-api-server的接口。 ebuilder-operation-web-server的启动类:ebuilder-operation-web-server/src/main/java/com/geeguo/ebuilder/operation/EbuilderOperationWebApplication.java ebuilder-operation-api-server的启动类:ebuilder-operation-api-server/src/main/java/com/geeguo/ebuilder/operation/EbuilderOperationApiApplication.java ebuilder-client-web-server的启动类:ebuilder-client-web-server/src/main/java/com/geeguo/ebuilder/client/EbuilderClientWebApplication.java 14、启动web端,详见两个web端项目的说明文档。 15、登录。 运营系统默认用户名:manager,密码:123456。 客户系统默认用户名:manager,密码:第一次登录随意输入,做为初始密码。 # 工程结构说明 ```text ebuilder-saas/ ├─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── ├── ebuilder-core/ # 基础公共模块 ├─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── ├── ebuilder-operation/ # 运营中心模块 │ ├── ebuilder-operation-base/ # 运营中心基础模块 │ │ ├── ebuilder-operation-base-core/ # 运营中心基础公共模块 │ │ ├── ebuilder-operation-base-database/ # 运营中心基础数据库模块 │ │ ├── ebuilder-operation-base-log/ # 运营中心基础操作日志模块 │ │ ├── ebuilder-operation-base-redis/ # 运营中心基础Redis模块 │ │ ├── ebuilder-operation-base-security/ # 运营中心基础安全模块 │ │ ├── ebuilder-operation-base-xxxxx/ # 运营中心公基础xxxxx模块(按照自己的需求增加基础模块) │ ├── ebuilder-operation-business/ # 运营中心业务逻辑模块 │ │ ├── ebuilder-operation-business-system/ # 运营中心系统功能业务逻辑模块 │ │ ├── ebuilder-operation-business-tenant/ # 运营中心租户功能业务逻辑模块 │ │ ├── ebuilder-operation-business-xxxxx/ # 运营中心xxxxx功能业务逻辑模块(按照自己的需求增加业务逻辑模块) │ ├── ebuilder-operation-web/ # 运营中心Web接口服务模块 │ │ ├── ebuilder-operation-web-controller/ # 运营中心Web接口控制器模块 │ │ │ └── ebuilder-operation-web-controller-system/ # 运营中心Web接口系统功能控制器模块 │ │ │ └── ebuilder-operation-web-controller-tenant/ # 运营中心Web接口租户功能控制器模块 │ │ │ └── ebuilder-operation-web-controller-xxxxx/ # 运营中心Web接口xxxxx功能控制器模块(按照自己的需求增加控制器模块) │ │ ├── ebuilder-operation-web-server/ # 运营中心Web接口服务启动模块 │ ├── ebuilder-operation-api/ # 运营中心内部接口服务模块 │ │ ├── ebuilder-operation-api-controller/ # 运营中心内部接口控制器模块 │ │ │ └── ebuilder-operation-api-controller-system/ # 运营中心内部接口系统功能控制器模块 │ │ │ └── ebuilder-operation-api-controller-tenant/ # 运营中心内部接口租户功能控制器模块 │ │ │ └── ebuilder-operation-api-controller-xxxxx/ # 运营中心内部接口xxxxx功能控制器模块(按照自己的需求增加控制器模块) │ │ ├── ebuilder-operation-api-server/ # 运营中心内部接口服务启动模块 │ ├── ebuilder-operation-xxxxx/ # 运营中心xxxxx接口服务模块(按照自己的需求增加接口服务模块) │ │ ├── ebuilder-operation-xxxxx-controller/ # 运营中心xxxxx接口控制器模块 │ │ │ └── ebuilder-operation-xxxxx-controller-xxxxx/ # 运营中心xxxxx接口xxxxx功能控制器模块 │ │ ├── ebuilder-operation-xxxxx-server/ # 运营中心xxxxx接口服务启动模块 ├─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── ├── ebuilder-client/ # 客户系统模块 │ ├── ebuilder-client-base/ # 客户系统基础模块 │ │ ├── ebuilder-client-base-core/ # 客户系统基础公共模块 │ │ ├── ebuilder-client-base-database/ # 客户系统基础数据库模块 │ │ ├── ebuilder-client-base-log/ # 客户系统基础操作日志模块 │ │ ├── ebuilder-client-base-redis/ # 客户系统基础Redis模块 │ │ ├── ebuilder-client-base-security/ # 客户系统基础安全模块 │ │ ├── ebuilder-client-base-tenant/ # 客户系统基础租户模块 │ │ ├── ebuilder-client-base-xxxxx/ # 客户系统公基础xxxxx模块(按照自己的需求增加基础模块) │ ├── ebuilder-client-business/ # 客户系统业务逻辑模块 │ │ ├── ebuilder-client-business-system/ # 客户系统系统功能业务逻辑模块 │ │ ├── ebuilder-client-business-xxxxx/ # 客户系统xxxxx功能业务逻辑模块(按照自己的需求增加业务逻辑模块) │ ├── ebuilder-client-web/ # 客户系统Web接口服务模块 │ │ ├── ebuilder-client-web-controller/ # 客户系统Web接口控制器模块 │ │ │ └── ebuilder-client-web-controller-system/ # 客户系统Web接口系统功能控制器模块 │ │ │ └── ebuilder-client-web-controller-xxxxx/ # 客户系统Web接口xxxxx功能控制器模块(按照自己的需求增加控制器模块) │ │ ├── ebuilder-client-web-server/ # 客户系统Web接口服务启动模块 │ ├── ebuilder-client-xxxxx/ # 客户系统xxxxx接口服务模块(按照自己的需求增加接口服务模块) │ │ ├── ebuilder-client-xxxxx-controller/ # 客户系统xxxxx接口控制器模块 │ │ │ └── ebuilder-client-xxxxx-controller-xxxxx/ # 客户系统xxxxx接口xxxxx功能控制器模块 │ │ ├── ebuilder-client-xxxxx-server/ # 客户系统xxxxx接口服务启动模块 ├─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── ``` # 开发规范 ## Business 层规范 ```text service:业务服务包 mapper:数据访问层包 remote:远程调用接口包 producer: 消息生产者 consumer: 消息消费者 model:数据模型包 说明:一个业务模块可以使用以上包任意组合,模块之间可以相互调用,但是mapper原则上其它模块不能调用。 ``` ## Model 使用规范 ```text Entity:用于封装数据库中的数据,对应数据库表。 PO (Persistent Object):用于封装数据库自定义查询返回的结果。 CO (Cache Object):用于封装缓存中的数据,用于缓存。 BO (Business Object):用于封装业务逻辑中的数据。 VO (View Object):用于封装Restful接口展示的数据。 RO (Response Object):用于封装Restful接口返回的数据。 DTO (Data Transfer Object):用于封装远程调用API传递的数据。 Query:与DTO一样,专门用于封装查询条件。 说明:以上知识列举了常用的数据模型,其它模型也可以根据业务需求自行定义。 ```