|
15 | 15 |
|
16 | 16 | </div>
|
17 | 17 |
|
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". |
19 | 19 |
|
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. |
21 | 31 |
|
22 | 32 | <br>
|
23 | 33 |
|
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. |
25 | 38 |
|
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. |
27 | 44 |
|
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. |
31 | 54 |
|
32 | 55 | <br>
|
33 | 56 |
|
34 |
| -### Sponge Generates the Code Framework |
| 57 | +### Quick Start |
35 | 58 |
|
36 |
| -#### Generate Code Framework |
| 59 | +1. **Install sponge** |
37 | 60 |
|
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). |
39 | 62 |
|
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). |
43 | 78 |
|
44 | 79 | <br>
|
45 | 80 |
|
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. |
47 | 86 |
|
48 | 87 | <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"> |
50 | 89 | </p>
|
51 | 90 |
|
52 | 91 | <br>
|
53 | 92 |
|
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. |
55 | 94 |
|
56 | 95 | <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"> |
58 | 97 | </p>
|
59 | 98 |
|
60 | 99 | <br>
|
61 | 100 |
|
62 | 101 | ### Microservice framework
|
63 | 102 |
|
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. |
65 | 104 |
|
66 | 105 | <p align="center">
|
67 | 106 | <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
|
168 | 207 |
|
169 | 208 | <br>
|
170 | 209 |
|
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 |
| - |
191 | 210 | ### Sponge Development Documentation
|
192 | 211 |
|
193 | 212 | Click to view [the detailed documentation](https://go-sponge.com/) for Sponge development project, including code generation, development, configuration, and deployment instructions, and more.
|
|
0 commit comments