Boilerplate Golang with Clean Architecture
- HOST : http://localhost:3030
- Go version 1.19
# mod
$ go mod tidy
# run
$ ENV=DEV go run main.go
# open
$ Open url http://localhost:3030
This project built in clean architecture that contains some layer :
- Driver
- Factory
- Delivery
- Repository
- Usecase
- Model
This project have some existing driver :
- Http (rest, ws, web)
- Database (postgres, mysql)
- Elasticsearch
- Firebase
- Sentry
- Websocket
- Cron
This project have some example for rest, ws, web :]
- Rest
- Auth
- Login
- Register
- Sample
- Get (+ pagination, sort & filter)
- GetByID
- Create (+ transaction scope)
- Update (+ transaction scope)
- Delete
- Web
- Playground
- Bubble
- Webocket
- Course
Install environment
# get swagger package
$ go install github.com/swaggo/swag/cmd/swag@latest
# move to swagger dir
$ cd $GOPATH/src/github.com/swaggo/swag
# install swagger cmd
$ go install cmd/swag
Generate documentation
# generate swagger doc
$ swag init --propertyStrategy snakecase
to see the results, run app and access {{url}}/swagger/index.html
Muhammad Cholis Malik