Introduction to Sponge
What is Sponge?
Sponge is a powerful and easy-to-use Go development framework. Its core philosophy is "Definition is Code", means generating modular Go code by parsing SQL
, Protobuf
, and JSON
files. These code modules can be flexibly combined to build various types of complete backend services.
Sponge provides a one-stop project development solution that covers code generation, development, testing, API documentation, and deployment. It helps developers easily build stable, reliable, and high-performance backend service (including RESTful APIs, gRPC, HTTP+gRPC, gRPC Gateway, etc.) in a "low-code" approach, greatly improve the efficiency and quality of project development.
Origin of the project name sponge
The modular code generated by sponge
can be flexibly combined to form a complete backend service. This process is similar to the characteristics of sponge cells: dissociated sponge cells can automatically reaggregate into a new sponge.
- Modular code ⟷ Sponge cells
- Complete service code ⟷ New sponge
What problems does sponge solve?
Sponge aims to address the following common issues in traditional Go development:
Building a framework from scratch is time-consuming and labor-intensive: One click on the sponge UI page generates compilable and runnable complete backend service code.
Repeatedly writing large amounts of boilerplate code: The code generation engine handles this; developers only need to manually fill in or use the built-in AI assistant to generate business logic code, allowing them to focus on business logic implementation.
Inconsistent project structure, difficult to maintain: Sponge provides a standardized project structure, reducing maintenance costs and promoting collaboration among team members.
Complex infrastructure integration: Sponge pre-integrates common components, simplifying configuration and usage.
Difficulty in learning and applying Go best practices: The generated code itself serves as a learnable example, significantly reducing the learning curve.
Difficulty refactoring projects: Standardized layered architecture design and modular programming mode can effectively reduce the complexity of system reconfiguration. Based on the existing project data table structure SQL or Protobuf protocol definition, you can achieve: 1. rapid project restructuring, 2. seamless migration of business logic to the new system.
Splitting monolithic services into microservices: Built-in microservice architecture templates and dependency decoupling design make it easy to split monoliths into independent services, compatible with service governance ecosystems.
Why Choose Sponge?
The main reason to choose sponge is its ability to significantly improve development efficiency and project quality:
Extremely fast development: Using the code generation engine, you can generate complete backend service code (
RESTFul API
,gRPC
,HTTP+gRPC
services) with one click on the page. If your service only requiresCRUD APIs
, there's no need to write anyGo
code at all.Reduce repetitive work: Automatically generate CRUD code, API interfaces, protobuf files, etc., avoiding writing large amounts of repetitive code manually. Built-in AI assistants (like DeepSeek, ChatGPT, Gemini) automatically generate and merge business logic code, further improving development efficiency.
One-stop engineering solution: Provides full-process support from code generation, development, testing, API documentation generation to deployment.
Follows best practices: The generated code is based on common patterns in the Go community and sponge's preset best practices, helping to build projects with clear structures that are easy to maintain.
Unified development standards: Provides consistent project structure and coding style, which is especially important for team collaboration.
Built-in common components: Integrates common functionalities like Gin (middleware), gRPC (interceptors), Zap, Error handling, GORM, MongoDB, Redis, Swagger, JWT, WebSocket, RabbitMQ, Kafka, DTM (Distributed Transaction Manager), Distributed locks, etc., ready to use out of the box.
Easy to extend and customize: Supports generating code using custom templates, allowing developers to modify and extend according to their own needs.
Quick Start for Developers Transitioning from Other Languages to Go: Sponge provides clear documentation, code examples, and best practice guides to help developers from Java, Python, PHP, and other backgrounds transition seamlessly. It encourages API design that aligns with Go conventions, reduces the learning curve, and enables you to quickly build production-grade applications.
Key Features
Generate code on the page, simple and easy to use
Sponge provides code generation on a web page, avoiding complex command-line operations. Just fill in parameters on the page to generate code with one click.One-click generation of complete backend service code
ForWeb
,gRPC
orHTTP+gRPC
services that only requireCRUD API
, noGo
code needs to be written. Just connect to a database (such asMySQL
,MongoDB
,PostgreSQL
,SQLite
), and a complete backend service code can be generated with one click, and easily deployed to Linux servers, Docker, or Kubernetes.Efficient development of common services
To develop commonWeb
,gRPC
,HTTP+gRPC
, orgRPC Gateway
services, you only need to focus on the following three parts:- Database table definitions;
- Defining API description information in Protobuf files;
- Manually writing or using the built-in AI assistant to generate business logic code in the generated templates.
The service framework code and CRUD API code are automatically generated by sponge.
Rich built-in components
Built-in rich components such as Gin (middleware), gRPC (interceptors), Zap, GORM, MongoDB, Redis, Swagger, JWT, WebSocket, RabbitMQ, Kafka, DTM, distributed locks, etc., to meet various development needs.Supports custom templates, flexible extension
Sponge supports generating various types of code required for projects through custom templates, not limited to theGo
language. For example:- Backend code;
- Frontend code;
- Configuration files;
- Test code;
- Build and deployment scripts, etc.
Sponge and AI Assistant Collaborative Development to Form a Closed-Loop Workflow
Sponge, combined with built-in AI assistants (DeepSeek, ChatGPT, Gemini), forms a complete and efficient development solution:- sponge: Responsible for infrastructure code generation, including
service framework
,CRUD API
,custom API (lacking business logic)
, etc. - AI Assistant: Focuses on business logic implementation, including
table structure DDL design
,custom API design
,business logic
, etc.
- sponge: Responsible for infrastructure code generation, including
Applicable Scenarios
Sponge is suitable for quickly building various types of high-performance backend services, applicable scenarios are as follows:
Developing RESTful API services
Building microservices projects
Cloud-native development
Refactoring old projects
Serving as a starting point for Go beginners or teams to learn Go project structure and best practices
Furthermore, developers can generate various types of code that meet business needs through custom templates.