sponge is a powerful code generation tool, a microservices framework based on gin and gRPC.
Go to file
2023-12-15 13:32:33 +08:00
.github add a list api for GET methods 2023-12-09 22:14:23 +08:00
api optimised code 2023-12-14 19:50:41 +08:00
assets add a list api for GET methods 2023-12-09 22:14:23 +08:00
cmd copy specified proto 2023-12-15 13:32:33 +08:00
configs add a list api for GET methods 2023-12-09 22:14:23 +08:00
deployments update deployment 2023-09-02 22:18:32 +08:00
docs add a list api for GET methods 2023-12-09 22:14:23 +08:00
examples add a list api for GET methods 2023-12-09 22:14:23 +08:00
internal add a list api for GET methods 2023-12-09 22:14:23 +08:00
pkg wrap grpc 2023-12-14 23:41:07 +08:00
scripts supports for a given proto file 2023-09-24 16:56:36 +08:00
test update docs 2023-11-08 21:57:24 +08:00
third_party adjustment option code 2023-11-26 18:25:37 +08:00
.gitignore adjust command parameters 2022-11-14 23:51:09 +08:00
.golangci.yml change revive rule 2023-08-06 18:46:36 +08:00
codecov.yml additional test code 2023-10-15 18:55:58 +08:00
doc.go change names 2023-09-03 00:33:04 +08:00
go.mod optimised code 2023-12-14 19:50:41 +08:00
go.sum update doc 2023-10-29 13:15:20 +08:00
Jenkinsfile adjustment code 2022-12-12 23:34:00 +08:00
LICENSE Initial commit 2022-09-19 23:18:08 +08:00
Makefile copy specified proto 2023-12-15 13:32:33 +08:00
Makefile-for-http copy specified proto 2023-12-15 13:32:33 +08:00
README.md add a list api for GET methods 2023-12-09 22:14:23 +08:00

English | 简体中文

Go Report codecov Go Reference Go License: MIT

sponge is a powerful golang productivity tool that integrates automatic code generation, web and microservices frameworks, basic development framework. sponge has a wealth of generating code commands, generating different functional code can be combined into a complete service (similar to the way that artificially broken sponge cells can automatically recombine into a new sponge). The code is decoupled and modularly designed, it is easy to build a complete project from development to deployment, so that you develop web or microservices project easily, golang can also be "low-code development".


If you are developing a RESTful web 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.

If you develop a generic RESTful web 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.


sponge generates the code framework

sponge is mainly based on SQL and Protobuf two ways to generate code, each way has to generate code for different functions.

Generate code framework:


Generate code framework corresponding UI interface:


Services framework

sponge generated microservice code framework is shown in the figure 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.


Egg model for complete service code

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.

Egg model profiling diagram for ⓷Web services created based on protobuf:

This is the egg model for web service code, and there are egg models for microservice (grpc) code, and grpc gateway service code described in sponge documentation.


Quick start

Installation sponge:

sponge can be installed on Windows, macOS, and Linux environments. Click here to view Installation Instructions.

After installing the sponge, start the UI service:

sponge run

Visit http://localhost:24631 in your browser, generate code by manipulating it on the page.


Documentation

sponge documentation


Examples of use

Simple examples

No specific business logic code is included.

Complete project examples

Distributed transaction examples


If it's help to you, give it a star .


License

See the LICENSE file for licensing information.


How to contribute

You are more than welcome to join us, raise an Issue or Pull Request.

Pull Request instructions.

  1. Fork the code
  2. Create your own branch: git checkout -b feat/xxxx
  3. Commit your changes: git commit -am 'feat: add xxxxx'
  4. Push your branch: git push origin feat/xxxx
  5. Commit your pull request