Skip to content

Commit aa19227

Browse files
committed
update docs
1 parent c5781b3 commit aa19227

File tree

6 files changed

+38
-89
lines changed

6 files changed

+38
-89
lines changed

.github/RELEASE.md

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
11
## Change log
22

3-
- Code generation supports multiple types of code repositories, you can choose to use `monolithic application single repository (monolith)`, `microservice multi-repository (multi-repo)`, or `microservice single repository (mono-repo)` according to your project needs.
4-
- Added automated testing scripts for code generation commands.
5-
- Based on protobuf to generate web services, the generated template code and documentation must meet the following conditions:
6-
- rpc cannot be set as stream type.
7-
- rpc must set http related information (router and method).
8-
- RPC stream based on protobuf supports generating corresponding template code and client testing code.
9-
- The generated code based on protobuf supports some common special types, such as Empty, Any, Timestamp, etc.
10-
- Fixed known bugs.
3+
- Add generate grpc+http service code
4+
- Add generate service+handler CRUD code

README.md

Lines changed: 13 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
</div>
1717

18-
**Sponge** is a powerful development framework that integrates `automatic code generation`, `Gin and GRPC`. Sponge has a rich set of code generation commands, and the generated different functional codes can be combined into a complete service (similar to how artificially broken sponge cells can automatically reassemble into a new complete sponge). From development, testing, API documentation to deployment, one-stop project development greatly improves development efficiency and reduces development difficulty, you can also use the go language to develop projects using the "low-code way".
18+
**Sponge** is a powerful development framework that integrates `automatic code generation`, `Gin and GRPC`. Sponge has a rich set of code generation commands, and the generated different functional codes can be combined into a complete service (similar to how artificially broken sponge cells can automatically reassemble into a new complete sponge). From development, testing, API documentation to deployment, one-stop project development greatly improves development efficiency and reduces development difficulty, implementation of "low-code way" development projects.
1919

2020
<br>
2121

@@ -27,14 +27,6 @@ If you develop generic web or microservices, just focus on the three core parts
2727

2828
### Sponge Generates the Code Framework
2929

30-
Sponge generated service code supports two types of code repositories:
31-
32-
1. **Monolithic application single repository (monolith) or microservice multi-repository (multi-repo)**: Each service code has its own Git repository. Even if all services are placed in the same Git repository, the code between services cannot be reused. This is the default type generated.
33-
34-
2. **Microservice single repository (mono-repo)**: All services are in the same Git repository, and the code between different services can be reused.
35-
36-
<br>
37-
3830
Sponge is mainly based on `SQL` and `Protobuf` two ways to generate code, each way has to generate code for different functions. `SQL` supports databases **mysql**, **mongodb**, **postgresql**, **tidb**, **sqlite**.
3931

4032
#### Generate Code Framework
@@ -53,19 +45,7 @@ Sponge is mainly based on `SQL` and `Protobuf` two ways to generate code, each w
5345

5446
<br>
5547

56-
#### Generate Service Code for Egg Model
57-
58-
The sponge code generation process strips away the business logic and non-business logic of the two major parts of the code. The code generation function of Sponge can be seen as a hen, and the service code generated by sponge can be seen as eggs. Currently, it supports the generation of 5 common types of service code, Take the generated web service backend code as an example, egg model profiling diagram:
59-
60-
<p align="center">
61-
<img width="1200px" src="https://raw.githubusercontent.com/zhufuyi/sponge_examples/main/assets/en_web-http-pb-anatomy.png">
62-
</p>
63-
64-
In addition to the egg model of web service backend code, there are egg models of grpc service code and grpc gateway service code, [click here to view](https://go-sponge.com/learn-about-sponge?id=%f0%9f%8f%b7egg-model-for-generate-service-code).
65-
66-
<br>
67-
68-
### Services framework
48+
### Microservice framework
6949

7050
Sponge is essentially a microservice framework that includes code generation capabilities. The microservice framework is shown in the following figure, which is a typical microservice hierarchical structure, with high performance, high scalability, contains commonly used service governance features, you can easily replace or add their own service governance features.
7151

@@ -164,25 +144,23 @@ Detailed instructions for operating, configuring, and deploying a project using
164144

165145
### Examples of use
166146

167-
#### Simple examples
168-
169-
No specific business logic code is included.
147+
#### Examples of creating a service using sponge
170148

171-
- [1_web-gin-CRUD](https://github.com/zhufuyi/sponge_examples/tree/main/1_web-gin-CRUD)
172-
- [2_micro-grpc-CRUD](https://github.com/zhufuyi/sponge_examples/tree/main/2_micro-grpc-CRUD)
173-
- [3_web-gin-protobuf](https://github.com/zhufuyi/sponge_examples/tree/main/3_web-gin-protobuf)
174-
- [4_micro-grpc-protobuf](https://github.com/zhufuyi/sponge_examples/tree/main/4_micro-grpc-protobuf)
175-
- [5_micro-gin-rpc-gateway](https://github.com/zhufuyi/sponge_examples/tree/main/5_micro-gin-rpc-gateway)
176-
- [6_micro-cluster-demo](https://github.com/zhufuyi/sponge_examples/tree/main/6_micro-cluster)
149+
- [Create **web** service based on **sql** (including CRUD)](https://github.com/zhufuyi/sponge_examples/tree/main/1_web-gin-CRUD)
150+
- [Create **grpc** service based on **sql** (including CRUD)](https://github.com/zhufuyi/sponge_examples/tree/main/2_micro-grpc-CRUD)
151+
- [Create **web** service based on **protobuf**](https://github.com/zhufuyi/sponge_examples/tree/main/3_web-gin-protobuf)
152+
- [Create **grpc** service based on **protobuf** ](https://github.com/zhufuyi/sponge_examples/tree/main/4_micro-grpc-protobuf)
153+
- [Create **grpc gateway** service based on **protobuf**](https://github.com/zhufuyi/sponge_examples/tree/main/5_micro-gin-rpc-gateway)
154+
- [Create **grpc+http** service based on **protobuf**](https://github.com/zhufuyi/sponge_examples/tree/main/a_micro-grpc-http-protobuf)
177155

178-
#### Complete project examples
156+
#### Examples of developing a complete project using sponge
179157

180-
- [7_community-single](https://github.com/zhufuyi/sponge_examples/tree/main/7_community-single)
181-
- [8_community-cluster](https://github.com/zhufuyi/sponge_examples/tree/main/8_community-cluster)
158+
- [Simple community web backend service](https://github.com/zhufuyi/sponge_examples/tree/main/7_community-single)
159+
- [Simple community web service broken down into microservice](https://github.com/zhufuyi/sponge_examples/tree/main/8_community-cluster)
182160

183161
#### Distributed transaction examples
184162

185-
- [9_order-system](https://github.com/zhufuyi/sponge_examples/tree/main/9_order-grpc-distributed-transaction)
163+
- [Simple distributed order system](https://github.com/zhufuyi/sponge_examples/tree/main/9_order-grpc-distributed-transaction)
186164

187165
<br>
188166

assets/en_sponge-ui.png

2.11 KB
Loading

assets/readme-cn.md

Lines changed: 23 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<br>
44

5-
[sponge](https://github.com/zhufuyi/sponge) 是一个集成了 `自动生成代码``Gin和GRPC` 的强大的开发框架。sponge拥有丰富的生成代码命令,生成不同的功能代码可以组合成完整的服务(类似人为打散的海绵细胞可以自动重组成一个新的海绵)。从开发、测试、api文档到部署一站式项目开发,大幅提高了开发效率和降低了开发难度,使用go也可以使用"低代码方式"开发项目。
5+
[sponge](https://github.com/zhufuyi/sponge) 是一个集成了 `自动生成代码``Gin和GRPC` 的强大的开发框架。sponge拥有丰富的生成代码命令,生成不同的功能代码可以组合成完整的服务(类似人为打散的海绵细胞可以自动重组成一个新的海绵)。从开发、测试、api文档到部署一站式项目开发,大幅提高了开发效率和降低了开发难度,实现"低代码方式"开发项目。
66

77
<br>
88

@@ -14,13 +14,6 @@
1414

1515
### 生成代码框架
1616

17-
sponge生成的服务代码支持两种类型代码仓库:
18-
19-
1. **单体应用单体仓库(monolith)或微服务多仓库(multi-repo)**:每个服务代码都有自己的git仓库,即使把所有服务放在同一个git仓库下,服务之间代码不可以复用,默认是生成这种类型。
20-
2. **微服务单体仓库(mono-repo)**:所有服务都在同一个git仓库下,不同服务之间的代码可以复用,这种类型代码仓库也叫大仓库类型。
21-
22-
<br>
23-
2417
sponge主要基于`SQL``Protobuf`两种方式生成代码,每种方式拥有生成不同用途的代码。其中`SQL`支持数据库**mysql****mongodb****postgresql****tidb****sqlite**
2518

2619
#### 生成代码的框架图
@@ -39,21 +32,9 @@ sponge主要基于`SQL`和`Protobuf`两种方式生成代码,每种方式拥
3932

4033
<br>
4134

42-
#### 生成服务代码的鸡蛋模型
43-
44-
sponge生成代码过程中剥离了业务逻辑与非业务逻辑两大部分代码,把sponge的生成代码功能看作是一个母鸡,sponge生成的服务代码看作是鸡蛋,目前支持生成常见的5种类型服务代码,以生成的一个web服务后端代码为例,鸡蛋模型剖析图:
45-
46-
<p align="center">
47-
<img width="1200px" src="https://raw.githubusercontent.com/zhufuyi/sponge_examples/main/assets/web-http-pb-anatomy.png">
48-
</p>
49-
50-
除了web服务后端代码鸡蛋模型,还有grpc服务代码和grpc网关服务代码的鸡蛋模型,点击[这里查看](https://go-sponge.com/zh-cn/learn-about-sponge?id=%f0%9f%8f%b7%e7%94%9f%e6%88%90%e6%9c%8d%e5%8a%a1%e4%bb%a3%e7%a0%81%e7%9a%84%e9%b8%a1%e8%9b%8b%e6%a8%a1%e5%9e%8b)
51-
52-
<br>
53-
5435
### 微服务框架
5536

56-
sponge本质是一个包含了生成代码功能的微服务框架,微服务框架如下图所示,这是典型的微服务分层结构,具有高性能,高扩展性,包含了常用的服务治理功能,可以很方便替换或添加自己的服务治理功能。
37+
sponge本质是一个包含了自动生成代码功能的微服务框架,微服务框架如下图所示,这是典型的微服务分层结构,具有高性能,高扩展性,包含了常用的服务治理功能,可以很方便替换或添加自己的服务治理功能。
5738

5839
<p align="center">
5940
<img width="1000px" src="https://raw.githubusercontent.com/zhufuyi/sponge/main/assets/microservices-framework.png">
@@ -149,46 +130,42 @@ sponge run
149130

150131
### 使用示例
151132

152-
#### 简单示例
153-
154-
不包含具体业务逻辑代码。
155-
156-
- [1_web-gin-CRUD](https://github.com/zhufuyi/sponge_examples/tree/main/1_web-gin-CRUD)
157-
- [2_micro-grpc-CRUD](https://github.com/zhufuyi/sponge_examples/tree/main/2_micro-grpc-CRUD)
158-
- [3_web-gin-protobuf](https://github.com/zhufuyi/sponge_examples/tree/main/3_web-gin-protobuf)
159-
- [4_micro-grpc-protobuf](https://github.com/zhufuyi/sponge_examples/tree/main/4_micro-grpc-protobuf)
160-
- [5_micro-gin-rpc-gateway](https://github.com/zhufuyi/sponge_examples/tree/main/5_micro-gin-rpc-gateway)
161-
- [6_micro-cluster](https://github.com/zhufuyi/sponge_examples/tree/main/6_micro-cluster)
133+
#### 使用sponge创建服务示例
162134

163-
#### 完整项目示例
135+
- [基于sql创建web服务(包括CRUD)](https://github.com/zhufuyi/sponge_examples/tree/main/1_web-gin-CRUD)
136+
- [基于sql创建grpc服务(包括CRUD)](https://github.com/zhufuyi/sponge_examples/tree/main/2_micro-grpc-CRUD)
137+
- [基于protobuf创建web服务](https://github.com/zhufuyi/sponge_examples/tree/main/3_web-gin-protobuf)
138+
- [基于protobuf创建grpc服务](https://github.com/zhufuyi/sponge_examples/tree/main/4_micro-grpc-protobuf)
139+
- [基于protobuf创建grpc网关服务](https://github.com/zhufuyi/sponge_examples/tree/main/5_micro-gin-rpc-gateway)
140+
- [基于protobuf创建grpc+http服务](https://github.com/zhufuyi/sponge_examples/tree/main/a_micro-grpc-http-protobuf)
164141

165-
包括具体业务逻辑代码。
142+
#### 使用sponge开发完整项目示例
166143

167-
- [7_community-single](https://github.com/zhufuyi/sponge_examples/tree/main/7_community-single)
168-
- [8_community-cluster](https://github.com/zhufuyi/sponge_examples/tree/main/8_community-cluster)
144+
- [简单的社区web后端服务](https://github.com/zhufuyi/sponge_examples/tree/main/7_community-single)
145+
- [简单的社区web后端服务拆分为微服务](https://github.com/zhufuyi/sponge_examples/tree/main/8_community-cluster)
169146

170147
#### 分布式事务示例
171148

172-
- [9_order-system](https://github.com/zhufuyi/sponge_examples/tree/main/9_order-grpc-distributed-transaction)
149+
- [简单的分布式订单系统](https://github.com/zhufuyi/sponge_examples/tree/main/9_order-grpc-distributed-transaction)
173150

174151
<br>
175152

176153
### 视频介绍
177154

178-
> 视频教程演示使用sponge v1.3.12版本,新版本增加了一些自动化功能、调整了一些UI界面和菜单,建议结合[文档教程](https://go-sponge.com/zh-cn/)使用。
155+
> 视频教程演示使用sponge v1.3.12版本,后续的版本增加了一些自动化功能、调整了一些UI界面和菜单,建议结合[文档教程](https://go-sponge.com/zh-cn/)使用。
179156
180157
- [01 sponge的形成过程](https://www.bilibili.com/video/BV1s14y1F7Fz/)
181158
- [02 sponge的框架介绍](https://www.bilibili.com/video/BV13u4y1F7EU/)
182-
- [03 一键生成web服务完整项目代码](https://www.bilibili.com/video/BV1RY411k7SE/)
183-
- [04 批量生成CRUD接口代码到web服务](https://www.bilibili.com/video/BV1AY411C7J7/)
184-
- [05 一键生成通用的web服务项目代码](https://www.bilibili.com/video/BV1CX4y1D7xj/)
185-
- [06 批量生成任意API接口代码到web服务](https://www.bilibili.com/video/BV1P54y1g7J9/)
186-
- [07 一键生成微服务(grpc)完整项目代码](https://www.bilibili.com/video/BV1Tg4y1b79U/)
187-
- [08 批量生成CRUD代码到微服务项目代码](https://www.bilibili.com/video/BV1TY411z7rY/)
188-
- [09 一键生成通用的微服务(grpc)项目代码](https://www.bilibili.com/video/BV1WY4y1X7zH/)
189-
- [10 批量生成grpc方法代码到微服务](https://www.bilibili.com/video/BV1Yo4y1q76o/)
159+
- [03 一键生成完整的web服务代码](https://www.bilibili.com/video/BV1RY411k7SE/)
160+
- [04 批量生成CRUD api代码到web服务](https://www.bilibili.com/video/BV1AY411C7J7/)
161+
- [05 一键生成通用的web服务代码](https://www.bilibili.com/video/BV1CX4y1D7xj/)
162+
- [06 批量生成任意api模板代码到web服务](https://www.bilibili.com/video/BV1P54y1g7J9/)
163+
- [07 一键生成完整的grpc服务代码](https://www.bilibili.com/video/BV1Tg4y1b79U/)
164+
- [08 批量生成CRUD api代码到grpc服务](https://www.bilibili.com/video/BV1TY411z7rY/)
165+
- [09 一键生成通用的grpc微服务代码](https://www.bilibili.com/video/BV1WY4y1X7zH/)
166+
- [10 批量生成grpc api代码到grpc服务](https://www.bilibili.com/video/BV1Yo4y1q76o/)
190167
- [11 grpc测试神器,简单便捷](https://www.bilibili.com/video/BV1VT411z7oj/)
191-
- [12 一键生成grpc网关服务项目代码](https://www.bilibili.com/video/BV1mV4y1D7k9/)
168+
- [12 一键生成grpc网关服务代码](https://www.bilibili.com/video/BV1mV4y1D7k9/)
192169
- [13 十分钟搭建一个微服务集群示例](https://www.bilibili.com/video/BV1YM4y127YK/)
193170

194171
<br>

assets/sponge-framework.png

31.1 KB
Loading

assets/sponge-ui.png

5.04 KB
Loading

0 commit comments

Comments
 (0)