ProductPromotion
Logo

Go.Lang

made by https://0x3d.site

GitHub - zhufuyi/sponge: Sponge is a powerful Go development framework, it's easy to develop web and microservice projects.
Sponge is a powerful Go development framework, it's easy to develop web and microservice projects. - zhufuyi/sponge
Visit Site

GitHub - zhufuyi/sponge: Sponge is a powerful Go development framework, it's easy to develop web and microservice projects.

GitHub - zhufuyi/sponge: Sponge is a powerful Go development framework, it's easy to develop web and microservice projects.

English | 简体中文

Go Report codecov Go Reference Go Awesome Go License: MIT

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 "low code approach".

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 Core Design Philosophy

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:

  • 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.
  • 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.

Sponge Generates the Code Framework

Sponge generation code is mainly based on SQL and Protobuf files, where SQL supports database mysql , mongodb, postgresql, tidb, sqlite.

Generate Code Framework

Generate Code Framework Corresponding UI Interface

Microservice framework

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.

Performance testing of http and grpc service code created by the microservices framework: 50 concurrent, 1 million total requests.

http-server

grpc-server

Click to view the test code.

Key Features

Project Code Directory Structure

The project code directory structure created by sponge follows the project-layout.

Here is the directory structure for the generated monolithic application single repository (monolith) or microservice multi-repository (multi-repo) code:

.
├── api            # Protobuf files and generated * pb.go directory
├── assets         # Store various static resources, such as images, markdown files, etc.
├── cmd            # Program entry directory
├── configs        # Directory for configuration files
├── deployments    # Bare metal, docker, k8s deployment script directory.
├── docs           # Directory for API interface Swagger documentation.
├── internal       # Directory for business logic code.
│    ├── cache        # Cache directory wrapped around business logic.
│    ├── config       # Directory for Go structure configuration files.
│    ├── dao          # Data access directory.
│    ├── ecode        # Directory for system error codes and custom business error codes.
│    ├── handler      # Directory for implementing HTTP business functionality (specific to web services).
│    ├── model        # Database model directory.
│    ├── routers      # HTTP routing directory.
│    ├── rpcclient    # Directory for client-side code that connects to grpc services.
│    ├── server       # Directory for creating services, including HTTP and grpc.
│    ├── service      # Directory for implementing grpc business functionality (specific to grpc services).
│    └── types        # Directory for defining request and response parameter structures for HTTP.
├── pkg            # Directory for shared libraries.
├── scripts        # Directory for scripts.
├── test           # Directory for scripts required for testing services  and test SQL.
├── third_party    # Directory for third-party protobuf files or external helper programs.
├── Makefile       # Develop, test, deploy related command sets .
├── go.mod         # Go module dependencies and version control file.
└── go.sum         # Go module dependencies key and checksum file.

Here is the directory structure for the generated microservice monolithic repository (mono-repo) code (also known as large repository directory structure):

.
├── api
│    ├── server1       # Protobuf files and generated *pb.go directory for service 1.
│    ├── server2       # Protobuf files and generated *pb.go directory for service 2.
│    ├── server3       # Protobuf files and generated *pb.go directory for service 3.
│    └── ...
├── server1        # Code directory for Service 1, it has a similar structure to the microservice multi repo directory.
├── server2        # Code directory for Service 2, it has a similar structure to the microservice multi repo directory.
├── server3        # Code directory for Service 3, it has a similar structure to the microservice multi repo directory.
├── ...
├── third_party    # Third-party protobuf files.
├── go.mod         # Go module dependencies and version control file.
└── go.sum         # Go module dependencies' checksums and hash keys.

Quick start

Installation sponge

Sponge can be installed on Windows, macOS, Linux and Docker environments. Click here for instructions on installing sponge.

Starting UI service

After installing the sponge, start the UI service:

sponge run

Access http://localhost:24631 in a local browser and manipulate the generated code on the UI page.

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.

Sponge Development Documentation

Detailed step-by-step, configuration, deployment instructions for developing projects using sponge, Click here to view the sponge development documentation

Examples of use

Examples of create services

Examples of develop complete project

Distributed transaction examples

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

Articles
to learn more about the golang concepts.

Resources
which are currently available to browse on.

mail [email protected] to add your project or resources here 🔥.

FAQ's
to know more about the topic.

mail [email protected] to add your project or resources here 🔥.

Queries
or most google FAQ's about GoLang.

mail [email protected] to add more queries here 🔍.

More Sites
to check out once you're finished browsing here.

0x3d
https://www.0x3d.site/
0x3d is designed for aggregating information.
NodeJS
https://nodejs.0x3d.site/
NodeJS Online Directory
Cross Platform
https://cross-platform.0x3d.site/
Cross Platform Online Directory
Open Source
https://open-source.0x3d.site/
Open Source Online Directory
Analytics
https://analytics.0x3d.site/
Analytics Online Directory
JavaScript
https://javascript.0x3d.site/
JavaScript Online Directory
GoLang
https://golang.0x3d.site/
GoLang Online Directory
Python
https://python.0x3d.site/
Python Online Directory
Swift
https://swift.0x3d.site/
Swift Online Directory
Rust
https://rust.0x3d.site/
Rust Online Directory
Scala
https://scala.0x3d.site/
Scala Online Directory
Ruby
https://ruby.0x3d.site/
Ruby Online Directory
Clojure
https://clojure.0x3d.site/
Clojure Online Directory
Elixir
https://elixir.0x3d.site/
Elixir Online Directory
Elm
https://elm.0x3d.site/
Elm Online Directory
Lua
https://lua.0x3d.site/
Lua Online Directory
C Programming
https://c-programming.0x3d.site/
C Programming Online Directory
C++ Programming
https://cpp-programming.0x3d.site/
C++ Programming Online Directory
R Programming
https://r-programming.0x3d.site/
R Programming Online Directory
Perl
https://perl.0x3d.site/
Perl Online Directory
Java
https://java.0x3d.site/
Java Online Directory
Kotlin
https://kotlin.0x3d.site/
Kotlin Online Directory
PHP
https://php.0x3d.site/
PHP Online Directory
React JS
https://react.0x3d.site/
React JS Online Directory
Angular
https://angular.0x3d.site/
Angular JS Online Directory