go-qwik
Scaffold production-ready Go backends in seconds — the same “just start coding” feeling as create-next-app, for APIs.
go install github.com/Dali125/go-qwik/cmd/go-qwik@latest
go-qwik new myapp
What you get
| Choice |
Options |
| Router |
Gin, Chi, Echo, or stdlib (net/http only) |
| Logger |
zerolog, zap (Uber), or standard log |
| Database |
PostgreSQL, MySQL, SQLite, SQL Server (GORM) |
| Auth |
JWT (access + refresh), session cookies, or none |
| Migrations |
Goose SQL + standard users table |
| Docker |
Multi-stage distroless non-root Dockerfile |
| Compose |
Optional docker-compose.yml + optional DB |
Generated apps use an MVC-style layout:
internal/models/user.model.go # struct + tags
internal/models/user.func.go # methods (validation + config.GormDB)
internal/controllers/ # thin HTTP controllers
internal/utils/ # JsonHandler, ErrorHandler, JsonResp
Controllers look like:
func GetUserByIDController(c *gin.Context) {
userID, err := strconv.Atoi(c.Param("id"))
// ...
user := models.User{ID: uint(userID)}
resp, err := user.GetUserByID()
if err != nil {
logger.Debug(err.Error())
utils.ErrorHandler(c.Writer, status, err, resp)
return
}
utils.JsonHandler(c.Writer, http.StatusOK, resp)
}
Usage
Interactive (recommended)
# from the repo
make build
cd ~/Documents/code
./go-qwik/bin/go-qwik new
Non-interactive
./go-qwik/bin/go-qwik new myapi \
--module github.com/you/myapi \
--router gin \
--logger zerolog \
--db postgres \
--auth jwt \
--compose \
--compose-db \
--yes
| Flag |
Description |
-m, --module |
Go module path |
-r, --router |
gin | chi | echo | stdlib |
-l, --logger |
zerolog | zap | stdlog |
-d, --db |
postgres | mysql | sqlite | sqlserver |
-a, --auth |
jwt | session | none |
--compose |
Write docker-compose.yml |
--compose-db |
Include a DB service in Compose |
-y, --yes |
Skip prompts; use flags/defaults |
After scaffolding
cd myapp
cp .env.example .env
go mod tidy
make run # GORM AutoMigrate runs on startup (needs a running DB)
Development (this repo)
make build
make test
./bin/go-qwik new demo -y \
-m github.com/example/demo \
-r gin -l zerolog -d sqlite -a jwt
License
MIT