Project generator for go backend architecture using goserve framework
Check out goserve framework github.com/unusualcodeorg/goserve
-
Download the goservegen binary for your operating system from the goservegen latest release: github.com/unusualcodeorg/goservegen/releases
-
Expand the compressed file (Example: Apple Mac M2: goservegen_Darwin_arm64.tar.gz)
-
Run the binary
cd ~/Downloads/goservegen_Darwin_arm64
# ./goservegen [project directory path] [project module]
./goservegen ~/Downloads/example github.com/yourusername/exampleNote:
./goservegen ~/Downloads/example github.com/yourusername/examplewill generate project namedexamplelocated at~/Downloadsand modulegit.colasdn.top/yourusername/example
-
Open the generated project in your IDE/editor of choice
-
Have fun developing your REST API server!
.
├── .extra
│ └── setup
│ └── init-mongo.js
├── api
│ └── sample
│ ├── dto
│ │ └── create_sample.go
│ ├── model
│ │ └── sample.go
│ ├── controller.go
│ └── service.go
├── cmd
│ └── main.go
├── config
│ └── env.go
├── keys
│ ├── private.pem
│ └── public.pem
├── startup
│ ├── indexes.go
│ ├── module.go
│ ├── server.go
│ └── testserver.go
├── utils
│ └── convertor.go
├── .env
├── .test.env
├── .gitignore
├── .dockerignore
├── Dockerfile
├── docker-compose.yml
├── go.mod
└── go.sum
docker-compose up --buildcurl --location 'http://localhost:8080/sample/ping'
Response
{
"code": "10000",
"status": 200,
"message": "pong!"
}
You can read about using this framework here github.com/unusualcodeorg/goserve
How to Architect Good Go Backend REST API Services
Sometimes your operating system will block the binary from execution, you will have to provide permission to run it.
In Mac you have to go System Settings > Privacy & Security > Allow goservegen