You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+22-9Lines changed: 22 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -15,33 +15,44 @@
15
15
16
16
</div>
17
17
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). Sponge provides one-stop project development (code generation, development, testing, api documentation, deployment), it greatly improves development efficiency and reduces development difficulty, develop high-quality projects with a "lowcode approach".
18
+
**Sponge** is a powerful development framework that integrates `code generation`, `Gin`, and `gRPC`. It offers a rich set of code generation commands, allowing flexible creation of various functional modules that can be combined into complete services (similar to how scattered sponge cells can reorganize into a new sponge). Sponge provides an all-in-one solution for project development, covering code generation, development, testing, API documentation, and deployment, significantly enhancing development efficiency, reducing complexity, and enabling high-quality projects with a "low-code approach".
19
19
20
20
Sponge is used to quickly and efficiently develop high-performance back-end services for various application scenarios and requirements, including `web` services, `gRPC` services, `http+gRPC` hybrid services, `gRPC gateway API` services.
21
21
22
+
Sponge not only supports code generation based on Sponge's built-in templates but also allows generating code using custom templates and relevant parameters (e.g., JSON, SQL, Protobuf). Through custom templates, users can generate code required for various projects, without being limited to the Go language.
23
+
22
24
<br>
23
25
24
26
### Sponge Core Design Philosophy
25
27
26
-
Sponge's core design concept is to reversely generate modular code through `SQL` or `Protobuf` files. These codes can be flexibly and seamlessly combined into various types of backend services, thus greatly improving development efficiency and simplifying backend service development. Sponge's main goals are as follows:
28
+
Sponge's core design concept is to reversely generate modular code through `SQL` or `Protobuf` files. These codes can be flexibly and seamlessly combined into various types of backend services, thus greatly improving development efficiency and simplifying backend service development. Sponge has implemented three core functions:
27
29
28
-
- If you develop a web or gRPC service with only CRUD API, you don't need to write any go code to compile and deploy it to Linux servers, dockers, k8s, and you just need to connect to the database to automatically generate the complete backend service go code by sponge.
29
-
- If you develop general web, gRPC, http+gRPC, gRPC gateway services, you only need to focus on the three core parts of `define tables in the database`, `define API description information in the protobuf file`, and `fill in business logic code in the generated template file`, and other go codes (including CRUD api) are generated by sponge.
30
+
- If you develop a web or gRPC service with only CRUD API, you don't need to write any go code to compile and deploy it to Linux servers, dockers, k8s, and you just need to connect to the database (e.g., `mysql`, `mongodb`,`postgresql`,`sqlite`) to automatically generate the complete backend service go code by sponge.
31
+
- If you develop general web, gRPC, http+gRPC, gRPC gateway services, you only need to focus on the three parts of `define tables in the database`, `define API description information in the protobuf file`, and `fill in business logic code in the generated template file`, and other go codes (including CRUD api) are generated by sponge.
32
+
- Sponge generates the necessary code for various projects through custom templates and parameters, such as frontend code, backend code, test code, deployment scripts, etc.
30
33
31
34
<br>
32
35
33
36
### Sponge Generates the Code Framework
34
37
35
-
Sponge generation code is mainly based on `SQL` and `Protobuf` files, where `SQL` supports database **mysql** , **mongodb**, **postgresql**, **tidb**, **sqlite**.
36
-
37
38
#### Generate Code Framework
38
39
40
+
The code generation framework based on Sponge's built-in templates is shown below. There are two approaches: SQL and Protobuf.
@@ -52,7 +63,7 @@ Sponge generation code is mainly based on `SQL` and `Protobuf` files, where `SQL
52
63
53
64
### Microservice framework
54
65
55
-
Sponge is also a microservices framework, the framework diagram is shown below, 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.
66
+
The service code generated by sponge is itself a microservice, the framework diagram is shown below, 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.
@@ -94,9 +104,11 @@ Click to view the [**test code**](https://github.com/zhufuyi/microservices_frame
94
104
- Service registration and discovery [etcd](https://github.com/etcd-io/etcd), [consul](https://github.com/hashicorp/consul), [nacos](https://github.com/alibaba/nacos)
@@ -118,6 +130,7 @@ Here is the directory structure for the generated `monolithic application single
118
130
│ ├── cache # Cache directory wrapped around business logic.
119
131
│ ├── config # Directory for Go structure configuration files.
120
132
│ ├── dao # Data access directory.
133
+
│ ├── database # database directory.
121
134
│ ├── ecode # Directory for system error codes and custom business error codes.
122
135
│ ├── handler # Directory for implementing HTTP business functionality (specific to web services).
123
136
│ ├── model # Database model directory.
@@ -179,7 +192,7 @@ Access `http://localhost:24631` in a local browser and manipulate the generated
179
192
180
193
### Sponge Development Documentation
181
194
182
-
Detailed step-by-step, configuration, deployment instructions for developing projects using sponge, Click here to view the [sponge development documentation](https://go-sponge.com/)
195
+
Click to view [the detailed documentation](https://go-sponge.com/) for Sponge development project, including code generation, development, configuration, and deployment instructions, and more.
- 如果开发只有 CRUD api 的 web 或 gRPC 服务,不需要编写任何 go 代码就可以编译并部署到 linux 服务器、docker、k8s 上,只需要连接到数据库就可以一键自动生成完整的后端服务 go 代码。
16
-
- 如果开发通用的 web、gRPC、http+gRPC、gRPC 网关等服务,只需聚焦`在数据库定义表`、`在protobuf文件定义api描述信息`、`在生成的模板文件填写业务逻辑代码`三个核心部分,其他 go 代码(包括CRUD api)都由 sponge 来生成。
17
+
- 如果开发只有 CRUD api 的 web 或 gRPC 服务,不需要编写任何 go 代码就可以编译并部署到 linux 服务器、docker、k8s 上,只需要连接到数据库(例如`mysql`, `mongodb`,`postgresql`,`sqlite`)就可以一键自动生成完整的后端服务 go 代码。
18
+
- 如果开发通用的 web、gRPC、http+gRPC、gRPC 网关等服务,只需聚焦`在数据库定义表`、`在protobuf文件定义api描述信息`、`在生成的模板文件填写业务逻辑代码`这三部分,其他 go 代码(包括CRUD api)都由 sponge 来生成。
0 commit comments