Creating Your First Project
5/14/25About 1 minGetting StartedSQLCode Generationsponge
Sponge supports creating various types of backend service projects. Below, we take creating a Web service project with CRUD API as an example. This is one of the simplest ways to create a project, requiring no Go code writing. You only need to connect to a MySQL database to generate a complete, ready-to-deploy Web service project.
Prerequisites
- Ensure MySQL service is installed (you can use the docker-compose script for quick deployment).
- Prepare a MySQL table, e.g., the example User Table SQL.
Operation Steps
- Click on the left menu bar [SQL] → [Create Web Server];
- Select database
mysql
, fill indatabase dsn
, then click the buttonGet table names
, select table name(s) (multiple selections allowed); - Fill in other parameters. Hover the mouse over the question mark
?
to view parameter descriptions;
After filling in the parameters, click the button Download Code
to generate the complete web service project code, as shown in the figure below:

Project Directory Structure
.
├─ cmd
│ └─ user
│ ├─ initial
│ └─ main.go
├─ configs
├─ deployments
│ ├─ binary
│ ├─ docker-compose
│ └─ kubernetes
├─ docs
├─ internal
│ ├─ cache
│ ├─ config
│ ├─ dao
│ ├─ ecode
│ ├─ handler
│ ├─ model
│ ├─ routers
│ ├─ server
│ └─ types
└─ scripts
Project Features
- Technology stack based on Gin + Gorm frameworks
- Includes standardized CRUD APIs
- Supports custom conditional pagination queries
- Integrates Swagger documentation generation tool
- Integrates various out-of-the-box components (can be turned on/off in the configuration file
configs/xxx.yml
)
Running the Project
# Generate API documentation
make docs
# Compile and start the service
make run
Visit http://localhost:8080/swagger/index.html to test the API interface:

Tips
For a detailed tutorial on development after creating the service, please refer to the Web Service Development Guide chapter.