Skip to content

Commit 4283ee0

Browse files
committed
docs: update README
1 parent c56f561 commit 4283ee0

10 files changed

+124
-84
lines changed

README.md

Lines changed: 57 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -15,53 +15,92 @@
1515

1616
</div>
1717

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".
18+
**sponge** is a powerful `Go` development framework. Its core concept revolves around reverse-engineering modular code by parsing `JSON`, `SQL`, or `Protobuf` files. The generated code can be flexibly and seamlessly assembled into various types of complete backend services (similar to the characteristics of sponge cells, where disassembled sponge cells can automatically recombine 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".
1919

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. Sponge not only supports code generation based on its built-in templates but also allows you to generate the necessary code for your project using custom templates and related parameters.
20+
<br>
21+
22+
### Use Cases
23+
24+
sponge is suitable for quickly developing various high-performance backend services, including but not limited to:
25+
- `Web` services;
26+
- `gRPC` services;
27+
- `HTTP+gRPC` hybrid services;
28+
- `gRPC Gateway API` services.
29+
30+
Additionally, developers can use custom templates to generate various types of code to meet specific business needs.
2131

2232
<br>
2333

24-
### Sponge Core Design Philosophy
34+
### Core Highlights
35+
36+
1. **One-click generation of complete backend service code**
37+
For `Web` or `gRPC` services that only require `CRUD APIs`, no `Go` code needs to be written. Simply connect to a database (e.g., `MySQL`, `MongoDB`, `PostgreSQL`, `SQLite`) to one-click generate complete backend service code and easily deploy it to Linux servers, Docker, or Kubernetes.
2538

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 simplifies the backend service development process:
39+
2. **Efficient development of general-purpose services**
40+
When developing general-purpose `Web`, `gRPC`, `HTTP+gRPC`, or `gRPC Gateway` services, you only need to focus on three aspects:
41+
- Defining database tables;
42+
- Defining API descriptions in Protobuf files;
43+
- Writing business logic code in the generated templates.
2744

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 (e.g., `mysql`, `mongodb`,`postgresql`,`sqlite`) 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 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-
- Generate the necessary code for your project (not limited to Go language) through custom templates and parameters (such as JSON, SQL, Protobuf), such as backend code, frontend code, configuration files, test code, build and deployment scripts, etc.
45+
The framework code and CRUD API code are all automatically generated by sponge.
46+
47+
3. **Support for custom templates, offering flexible extensibility**
48+
sponge supports generating various types of project-specific code using custom templates, not limited to the `Go` language. For example:
49+
- Backend code;
50+
- Frontend code;
51+
- Configuration files;
52+
- Test code;
53+
- Build and deployment scripts, etc.
3154

3255
<br>
3356

34-
### Sponge Generates the Code Framework
57+
### Quick Start
3558

36-
#### Generate Code Framework
59+
1. **Install sponge**
3760

38-
The code generation framework based on Sponge's built-in templates is shown below. There are two approaches: SQL and Protobuf.
61+
sponge supports installation on Windows, macOS, and Linux. Click to view the [**sponge installation guide**](https://github.com/zhufuyi/sponge/blob/main/assets/install-cn.md).
3962

40-
<p align="center">
41-
<img width="1500px" src="https://raw.githubusercontent.com/zhufuyi/sponge/main/assets/sponge-framework.png">
42-
</p>
63+
2. **Open the code generation UI**
64+
65+
After installation, run the following command to open the sponge UI:
66+
67+
```bash
68+
sponge run
69+
```
70+
71+
Access `http://localhost:24631` in a local browser to generate code through the UI interface, as shown below:
72+
73+
<p align="center">
74+
<img width="1500px" src="https://raw.githubusercontent.com/zhufuyi/sponge/main/assets/en_sponge-ui.png">
75+
</p>
76+
77+
> To access from a browser on a different host, specify the host IP or domain when starting the UI, e.g., `sponge run -a http://your_host_ip:24631`. Alternatively, you can run the UI service in Docker to support cross-host access. Click to view the guide on [running the sponge UI service in Docker](https://github.com/zhufuyi/sponge/blob/main/assets/install-cn.md#Docker%E7%8E%AF%E5%A2%83).
4378
4479
<br>
4580

46-
The code generation framework based on custom templates is shown below. There are three approaches: JSON, SQL, and Protobuf.
81+
### Sponge Generates the Code Framework
82+
83+
Sponge supports generating code using both built-in templates and custom templates, as shown in the diagrams below.
84+
85+
1. The code generation framework based on Sponge's built-in templates is shown below. There are two approaches: SQL and Protobuf.
4786

4887
<p align="center">
49-
<img width="1200px" src="https://raw.githubusercontent.com/zhufuyi/sponge/main/assets/template-framework.png">
88+
<img width="1500px" src="https://raw.githubusercontent.com/zhufuyi/sponge/main/assets/sponge-framework.png">
5089
</p>
5190

5291
<br>
5392

54-
#### Generate Code Framework Corresponding UI Interface
93+
2. The code generation framework based on custom templates is shown below. There are three approaches: JSON, SQL, and Protobuf.
5594

5695
<p align="center">
57-
<img width="1200px" src="https://raw.githubusercontent.com/zhufuyi/sponge/main/assets/en_sponge-ui.png">
96+
<img width="1200px" src="https://raw.githubusercontent.com/zhufuyi/sponge/main/assets/template-framework.png">
5897
</p>
5998

6099
<br>
61100

62101
### Microservice framework
63102

64-
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.
103+
Sponge supports creating six types of backend services, all based on microservice architecture. The diagram below illustrates a typical layered microservice structure, featuring high performance, scalability, and built-in service governance capabilities.
65104

66105
<p align="center">
67106
<img width="1000px" src="https://raw.githubusercontent.com/zhufuyi/sponge/main/assets/microservices-framework.png">
@@ -168,26 +207,6 @@ Here is the directory structure for the generated `microservice monolithic repos
168207

169208
<br>
170209

171-
### Quick start
172-
173-
#### Installation sponge
174-
175-
Sponge can be installed on Windows, macOS, Linux and Docker environments. Click here for [instructions on installing sponge](https://github.com/zhufuyi/sponge/blob/main/assets/install-en.md).
176-
177-
#### Starting UI service
178-
179-
After installing the sponge, start the UI service:
180-
181-
```bash
182-
sponge run
183-
```
184-
185-
Access `http://localhost:24631` in a local browser and manipulate the generated code on the UI page.
186-
187-
> If you want to access it on a cross-host browser, you need to specify the host ip or domain name when starting the UI, example `sponge run -a http://your_host_ip:24631`. It is also possible to start the UI service on docker to support cross-host access, Click for instructions on [starting the sponge UI service in docker](https://github.com/zhufuyi/sponge/blob/main/assets/install-en.md#docker-environment).
188-
189-
<br>
190-
191210
### Sponge Development Documentation
192211

193212
Click to view [the detailed documentation](https://go-sponge.com/) for Sponge development project, including code generation, development, configuration, and deployment instructions, and more.

assets/readme-cn.md

Lines changed: 58 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -2,51 +2,92 @@
22

33
<br>
44

5-
**sponge** 是一个集成了`代码生成``Gin``gRPC` 的强大开发框架,提供丰富的代码生成命令,可灵活生成各类功能模块,并组合成完整的服务(类似打散的海绵细胞能重新组合成新的海绵)。sponge 提供一站式项目开发解决方案,涵盖代码生成、开发、测试、API 文档生成和部署,大幅提升开发效率,降低开发难度,实现以"低代码"方式构建高质量项目。
5+
**sponge** 是一个强大的 `Go` 开发框架,其核心理念是通过解析 `JSON``SQL``Protobuf` 文件逆向生成模块化的代码,这些代码可以灵活、无缝地组合成多种类型的完整后端服务(类似海绵细胞的特性,打散的海绵细胞能自动重新组合成新的海绵)。sponge 提供一站式项目开发解决方案,涵盖代码生成、开发、测试、API 文档生成和部署,大幅提升开发效率,降低开发难度,实现以"低代码"方式构建高质量项目。
66

7-
sponge 用来快速高效开发各种应用场景的高性能后端服务,包括 `web` 服务、`gRPC` 服务、`http+gRPC` 混合服务、 `gRPC网关API`服务等。sponge 不仅支持基于自带的模板生成代码,还支持基于自定义模板和相关参数生成你的项目所需的代码。
7+
<br>
8+
9+
### 适用场景
10+
11+
sponge 适用于快速开发各种高性能后端服务,包括但不限于:
12+
- `Web` 服务;
13+
- `gRPC` 服务;
14+
- `HTTP+gRPC` 混合服务;
15+
- `gRPC Gateway API` 服务。
16+
17+
此外,开发者还可以通过自定义模板,生成满足业务需求的各类代码。
818

919
<br>
1020

11-
### sponge 核心设计理念
21+
### 核心亮点
22+
23+
1. **一键生成完整后端服务代码**
24+
对于仅需 `CRUD API``Web``gRPC` 服务,无需编写任何 `Go` 代码。只需连接数据库(如 `MySQL``MongoDB``PostgreSQL``SQLite`),即可一键生成完整后端服务代码,并轻松部署到 Linux 服务器、Docker 或 Kubernetes 上。
1225

13-
sponge 的核心设计理念是通过 `SQL``Protobuf` 文件逆向生成模块化的代码,这些代码可以灵活、无缝地组合成多种类型的后端服务,从而大幅大提升开发效率,简化后端服务开发流程:
26+
2. **高效开发通用服务**
27+
开发通用的 `Web``gRPC``HTTP+gRPC``gRPC Gateway` 服务,只需专注于以下三部分:
28+
- 数据库表的定义;
29+
- 在 Protobuf 文件中定义 API 描述信息;
30+
- 在生成的模板中编写业务逻辑代码。
1431

15-
- 如果开发只有 CRUD api 的 web 或 gRPC 服务,不需要编写任何 go 代码就可以编译并部署到 linux 服务器、docker、k8s 上,只需要连接到数据库(例如`mysql`, `mongodb`,`postgresql`,`sqlite`)就可以一键自动生成完整的后端服务 go 代码。
16-
- 如果开发通用的 web、gRPC、http+gRPC、gRPC 网关等服务,只需聚焦`在数据库定义表``在protobuf文件定义api描述信息``在生成的模板文件填写业务逻辑代码`这三部分,其他 go 代码(包括CRUD api)都由 sponge 来生成。
17-
- 通过自定义模板和参数(如 json、sql、protobuf)生成你的项目所需的代码(不局限于 Go 语言),例如后端代码、前端代码、配置文件、测试代码、构建和部署脚本等。
32+
服务的框架代码和 CRUD API 代码均由 sponge 自动生成。
33+
34+
3. **支持自定义模板,灵活扩展**
35+
sponge 支持通过自定义模板生成项目所需的多种代码类型,不局限于 `Go` 语言。例如:
36+
- 后端代码;
37+
- 前端代码;
38+
- 配置文件;
39+
- 测试代码;
40+
- 构建和部署脚本等。
1841

1942
<br>
2043

21-
#### 生成代码的框架图
44+
### 快速开始
2245

23-
sponge 基于自带模板生成代码框架如下图所示,共有 sql 和 protobuf 两种方式生成代码。
46+
1. **安装 sponge**
2447

25-
<p align="center">
26-
<img width="1500px" src="https://raw.githubusercontent.com/zhufuyi/sponge/main/assets/sponge-framework.png">
27-
</p>
48+
支持在 windows、mac、linux 环境下安装 sponge,点击查看 [**安装 sponge 说明**](https://github.com/zhufuyi/sponge/blob/main/assets/install-cn.md)
49+
50+
2. **打开生成代码 UI 页面**
51+
52+
安装完成后,执行命令打开 sponge UI 页面:
53+
54+
```bash
55+
sponge run
56+
```
57+
58+
在本地浏览器访问 `http://localhost:24631`,在页面上操作生成代码,如下图所示:
59+
60+
<p align="center">
61+
<img width="1500px" src="https://raw.githubusercontent.com/zhufuyi/sponge/main/assets/sponge-ui.png">
62+
</p>
63+
64+
> 如果想要在跨主机的浏览器上访问,启动UI时需要指定宿主机ip或域名,示例 `sponge run -a http://your_host_ip:24631`。 也可以在 docker 上启动UI服务来支持跨主机访问,点击查看 [在 docker 运行 sponge UI 服务说明](https://github.com/zhufuyi/sponge/blob/main/assets/install-cn.md#Docker%E7%8E%AF%E5%A2%83)
2865
2966
<br>
3067

31-
sponge 基于自定义模板生成代码框架如下图所示,共有 json、sql、protobuf 三种方式生成代码。
68+
### 生成代码的框架图
69+
70+
sponge 支持基于自带模板和自定义模板两种方式生成你的项目所需的代码,下面是两种生成代码的框架图。
71+
72+
1. sponge 基于自带模板生成代码框架如下图所示,共有 sql 和 protobuf 两种方式生成代码。
3273

3374
<p align="center">
34-
<img width="1200px" src="https://raw.githubusercontent.com/zhufuyi/sponge/main/assets/template-framework.png">
75+
<img width="1500px" src="https://raw.githubusercontent.com/zhufuyi/sponge/main/assets/sponge-framework.png">
3576
</p>
3677

3778
<br>
3879

39-
#### 生成代码框架对应的UI界面
80+
2. sponge 基于自定义模板生成代码框架如下图所示,共有 json、sql、protobuf 三种方式生成代码。
4081

4182
<p align="center">
42-
<img width="1500px" src="https://raw.githubusercontent.com/zhufuyi/sponge/main/assets/sponge-ui.png">
83+
<img width="1200px" src="https://raw.githubusercontent.com/zhufuyi/sponge/main/assets/template-framework.png">
4384
</p>
4485

4586
<br>
4687

4788
### 微服务框架
4889

49-
sponge 生成的服务代码本身是一个微服务,框架图如下图所示,这是典型的微服务分层结构,具有高性能,高扩展性,包含了常用的服务治理功能
90+
sponge 支持创建 6 种类型的后端服务,均为微服务架构。下图展示了典型的微服务分层结构,具备高性能、高扩展性,并内置常用的服务治理功能
5091

5192
<p align="center">
5293
<img width="1000px" src="https://raw.githubusercontent.com/zhufuyi/sponge/main/assets/microservices-framework.png">
@@ -155,26 +196,6 @@ sponge包含丰富的组件(按需使用):
155196

156197
<br>
157198

158-
### 快速开始
159-
160-
#### 安装 sponge
161-
162-
支持在windows、mac、linux环境下安装sponge,点击查看[安装sponge说明](https://github.com/zhufuyi/sponge/blob/main/assets/install-cn.md)
163-
164-
#### 启动UI服务
165-
166-
安装完成后,启动sponge UI服务:
167-
168-
```bash
169-
sponge run
170-
```
171-
172-
在本地浏览器访问 `http://localhost:24631`,在UI页面上操作生成代码。
173-
174-
> 如果想要在跨主机的浏览器上访问,启动UI时需要指定宿主机ip或域名,示例 `sponge run -a http://your_host_ip:24631`。 也可以在docker上启动UI服务来支持跨主机访问,点击查看[docker启动sponge UI服务说明](https://github.com/zhufuyi/sponge/blob/main/assets/install-cn.md#Docker%E7%8E%AF%E5%A2%83)
175-
176-
<br>
177-
178199
### sponge 开发文档
179200

180201
点击查看 [sponge 开发项目的详细文档](https://go-sponge.com/zh-cn/),包括代码生成、开发、配置、部署说明等。

cmd/sponge/server/static/css/app.2fadb537257f44b2192f8ffe1ce19370.css renamed to cmd/sponge/server/static/css/app.af35d52ad7ed1b648a48982c04365a8f.css

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cmd/sponge/server/static/css/app.2fadb537257f44b2192f8ffe1ce19370.css.map renamed to cmd/sponge/server/static/css/app.af35d52ad7ed1b648a48982c04365a8f.css.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cmd/sponge/server/static/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
<!DOCTYPE html><html><head><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1"><title>Sponge Generate Code</title><link rel=icon type=image/png sizes=32x32 href="/static/favicon.png?v=1.0"><script type=text/javascript src=/static/appConfig.js async></script><link href=/static/css/app.2fadb537257f44b2192f8ffe1ce19370.css rel=stylesheet></head><body style="margin: 0px; padding: 0px;"><style>.el-tooltip__popper {box-shadow: 3px 3px 10px 5px #d3d3d6;border-width: 0px !important;}
2-
.el-tooltip__popper[x-placement^="top"] .popper__arrow:after {border-top-color: #dcdfe6 !important;}</style><div id=app></div><script type=text/javascript src=/static/js/manifest.2ae2e69a05c33dfc65f8.js></script><script type=text/javascript src=/static/js/vendor.d8cdb3748af43d2ae51a.js></script><script type=text/javascript src=/static/js/app.673ef5316b942a28ecac.js></script></body></html>
1+
<!DOCTYPE html><html><head><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1"><title>Sponge Generate Code</title><link rel=icon type=image/png sizes=32x32 href="/static/favicon.png?v=1.0"><script type=text/javascript src=/static/appConfig.js async></script><link href=/static/css/app.af35d52ad7ed1b648a48982c04365a8f.css rel=stylesheet></head><body style="margin: 0px; padding: 0px;"><style>.el-tooltip__popper {box-shadow: 3px 3px 10px 5px #d3d3d6;border-width: 0px !important;}
2+
.el-tooltip__popper[x-placement^="top"] .popper__arrow:after {border-top-color: #dcdfe6 !important;}</style><div id=app></div><script type=text/javascript src=/static/js/manifest.2ae2e69a05c33dfc65f8.js></script><script type=text/javascript src=/static/js/vendor.d8cdb3748af43d2ae51a.js></script><script type=text/javascript src=/static/js/app.c74918db0619020dd335.js></script></body></html>

cmd/sponge/server/static/js/app.673ef5316b942a28ecac.js

Lines changed: 0 additions & 2 deletions
This file was deleted.

cmd/sponge/server/static/js/app.673ef5316b942a28ecac.js.map

Lines changed: 0 additions & 1 deletion
This file was deleted.

cmd/sponge/server/static/js/app.c74918db0619020dd335.js

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cmd/sponge/server/static/js/app.c74918db0619020dd335.js.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)