An boilerplate for golang project that boot you up.
- Using DDD Pattern as:
- Application layer:
transport
- Domain layer:
domain
,services
- Infrastructure layer:
provider
,repository
- Application layer:
.
├── cmd
│ └── app
│ └── main.go
├── configs
│ ├── storage.go
│ ├── server.go
│ ├── config.go
│ └── auth.go
├── internal
│ ├── transport # Contain server interface and HTTP transport implement
│ │ ├── server.go
│ │ └── http
│ │ └── ...
│ ├── services # Contain domain services
│ │ ├── user.go
│ │ └── auth.go
│ ├── domain # Contain business models and service interfaces
│ │ ├── user.go
│ │ └── auth.go
│ ├── provider # Contain interfaces and implements for library provider
│ │ ├── token_provider.go
│ │ ├── password_hash_provider.go
│ │ └── jwt
│ └── repository # Contain repository interfaces and implements
│ ├── user.go
│ └── gormrepo
│ └── ...
├── tests # Contain integration tests
│ └── ...
├── go.sum
├── go.mod
├── docker.env
├── docker-compose.yml
├── REQUIREMENT.md
├── README.md
├── Makefile
├── LICENSE
└── Dockerfile
Make sure you have Go installed (download). Version 1.17
or higher is required.
Make sure you have Docker installed (instructions).
Make sure you have make
installed for running the scripts.
For Linux:
sudo apt install make
For MacOS:
brew install make
Using command bellow to build and run on Docker Compose
make start
Togo
app will available on127.0.0.1:4000
Redis
will available on127.0.0.1:56379
PostgreSQL
will available on127.0.0.1:55432
Using command bellow to run unit tests
make run-unit-test
Make sure Togo server build and start successfully then use the command bellow to run integration tests.
make run-unit-test
MIT