|
19 | 19 |
|
20 | 20 | <br>
|
21 | 21 |
|
22 |
| -If you are developing a RESTful web service or microservice with a simple CRUD API interface, you don't need to write a single line of golang code to compile and deploy to servers, dockers, k8s, and the complete service code is generated by sponge. |
| 22 | +If you are developing a RESTful web service or microservice with a simple CRUD API interface, you don't need to write a single line of Go code to compile and deploy to servers, dockers, k8s, and the complete service code is generated by sponge. |
23 | 23 |
|
24 |
| -If you develop a generic RESTful web service or microservice, you need to manually write code in addition to defining the data table, defining the api interface in the proto file, and filling in the specific business logic code in the generated template file. Other golang codes are generated by sponge. |
| 24 | +If you develop a generic RESTful web service or microservice, you need to manually write code in addition to defining the data table, defining the api interface in the proto file, and filling in the specific business logic code in the generated template file. Other Go codes are generated by sponge. |
25 | 25 |
|
26 | 26 | <br>
|
27 | 27 |
|
28 |
| -### sponge generates the code framework |
| 28 | +### Sponge Generates the Code Framework |
29 | 29 |
|
30 |
| -sponge is mainly based on **SQL** and **Protobuf** two ways to generate code, each way has to generate code for different functions. |
| 30 | +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**, **postgresql**, **tidb**, **sqlite**. |
31 | 31 |
|
32 |
| -**Generate code framework:** |
| 32 | +#### Generate Code Framework |
33 | 33 |
|
34 | 34 | <p align="center">
|
35 | 35 | <img width="1500px" src="https://raw.githubusercontent.com/zhufuyi/sponge/main/assets/sponge-framework.png">
|
36 | 36 | </p>
|
37 | 37 |
|
38 | 38 | <br>
|
39 | 39 |
|
40 |
| -**Generate code framework corresponding UI interface:** |
| 40 | +#### Generate Code Framework Corresponding UI Interface |
41 | 41 |
|
42 | 42 | <p align="center">
|
43 | 43 | <img width="1200px" src="https://raw.githubusercontent.com/zhufuyi/sponge/main/assets/en_sponge-ui.png">
|
44 | 44 | </p>
|
45 | 45 |
|
46 | 46 | <br>
|
47 | 47 |
|
48 |
| -### Services framework |
| 48 | +#### Generate Code for Egg Model |
| 49 | + |
| 50 | +The sponge code generation process strips away the business logic and non-business logic of the two major parts of the code, sponge generated a complete web service back-end code as a complete egg: |
| 51 | + |
| 52 | +- `Eggshell` represents the web service framework code, `yolk` and `Albumen` both represent the business logic code. |
| 53 | +- `Yolk` is the core of business logic. For example, defining mysql tables, defining api interfaces, and writing specific logic codes all belong to yolk (code that needs to be written manually). |
| 54 | +- `Albumen` is a bridge connecting the core code of business logic and the web framework code. For example, the registration route code, handler code, parameter verification code, error code, and swagger document generated according to the proto file belong to the albumen (code that automatically generated without manual writing). |
49 | 55 |
|
50 |
| -Sponge is essentially a microservice framework that includes code generation and deployment 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. |
| 56 | +Here is egg model profiling diagram for `⓷Create web service based on protobuf`: |
51 | 57 |
|
52 | 58 | <p align="center">
|
53 |
| -<img width="1000px" src="https://raw.githubusercontent.com/zhufuyi/sponge/main/assets/microservices-framework.png"> |
| 59 | +<img width="1200px" src="https://raw.githubusercontent.com/zhufuyi/sponge_examples/main/assets/en_web-http-pb-anatomy.png"> |
54 | 60 | </p>
|
55 | 61 |
|
56 |
| -<br> |
| 62 | +In addition to the egg model of web service backend code, there are egg models of grpc service code and grpc gateway service code described in [sponge documentation](https://go-sponge.com/learn-about-sponge?id=%f0%9f%8f%b7project-code-egg-model). |
57 | 63 |
|
58 |
| -### Egg model of a web service code generated by sponge |
| 64 | +<br> |
59 | 65 |
|
60 |
| -The sponge separates the two major parts of code during the process of generating web service code. It isolates the business logic from the non-business logic. For example, consider the entire web service code as an egg. The eggshell represents the web service framework code, while both the albumen and yolk represent the business logic code. The yolk is the core of the business logic (manually written code). It includes defining MySQL tables, defining API interfaces, and writing specific logic code.On the other hand, the albumen acts as a bridge connecting the core business logic code to the web framework code (automatically generated, no manual writing needed). This includes the registration of route code generated from proto files, handler method function code, parameter validation code, error codes, Swagger documentation, and more. |
| 66 | +### Services framework |
61 | 67 |
|
62 |
| -Egg model profiling diagram for `⓷Web services created based on protobuf`: |
| 68 | +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. |
63 | 69 |
|
64 | 70 | <p align="center">
|
65 |
| -<img width="1200px" src="https://raw.githubusercontent.com/zhufuyi/sponge_examples/main/assets/en_web-http-pb-anatomy.png"> |
| 71 | +<img width="1000px" src="https://raw.githubusercontent.com/zhufuyi/sponge/main/assets/microservices-framework.png"> |
66 | 72 | </p>
|
67 | 73 |
|
68 |
| -This is the egg model for web service code, and there are egg models for grpc service code, and grpc gateway service code described in [sponge documentation](https://go-sponge.com/learn-about-sponge?id=%f0%9f%8f%b7project-code-egg-model). |
69 |
| - |
70 | 74 | <br>
|
71 | 75 |
|
72 | 76 | ### Key Features
|
73 | 77 |
|
74 | 78 | - User-friendly UI for code generation commands.
|
75 |
| -- Automatic merging of template code for "low-code development" of API interfaces. |
| 79 | +- Not only generate code template examples, but also automatically merge the new template code to achieve api interface "low-code development". |
76 | 80 | - Modular and decoupled code design with rich functional components readily available, you can also easily use their own components.
|
77 | 81 | - Web framework [gin](https://github.com/gin-gonic/gin)
|
78 | 82 | - RPC framework [grpc](https://github.com/grpc/grpc-go)
|
|
0 commit comments