- This is a sample API built by Go(Echo) and SQLBoiler according to Clean Architecture.
git clone [email protected]:yagikota/clean-architecture-with-go.git
cd clean_architecture-with-go
$ go install github.com/volatiletech/sqlboiler/v4@latest
# install driver for MySQL
$ go install github.com/volatiletech/sqlboiler/v4/drivers/sqlboiler-mysql@latest
brew install golang-migrate
echo "PORT=8080
MYSQL_USER=root
MYSQL_ROOT_PASSWORD=
MYSQL_ALLOW_EMPTY_PASSWORD=true
MYSQL_PORT=3306
MYSQL_ADDR=mysql:3306
MYSQL_DATABASE=sample" > .env
make run-db
make migrate
make seed
make migrate
command may fail, but try some time.
make run-go
and accesslocalhost:8080/health_check
.
You will get the following response.
{
"message": "Hello! you've requested: /health_check"
}
Then, you have fully prepared for running API.
- Please copy and paste this file on https://editor.swagger.io/ .
🐶 I hope this repository helps you studying Clean Architecture with Go.