Gorilla
I hope that by using Gorilla, you will be able to develop your projects more efficiently and speedily. - dj-hirrot -
About
The Gorilla Template is a REST API template for efficient personal development, implemented based on the CleanArchitecture design philosophy.
Features
- It's implemented with the CleanArchitecture design philosophy.
- By annotating the functions, Swagger documentation can be generated automatically.
- Mocks can be generated automatically based on the abstracted class.
- It runs on a Docker container, and hot reloading by "fresh" is applied.
- (CI has been introduced in GitHub Workflow).
Layer | Description |
---|---|
./docker/api/* |
API Container |
./docker/db/* |
DB Container. In this project, MySQL is used, but the hierarchy is divided so that other databases can be supported. |
./docker/db/init.sql |
It will be placed and executed /docker-entrypoint-initdb.d when the container is started. |
./docs/* |
Swagger Docs will be generated here. You can view it by accessing http://localhost:8080/swagger/index.html with your browser. |
./mocks/* |
The file generated by mockgen will be placed here. You can run tests on abstract classes. |
./src/* |
The application |
./src/domain/* |
Enterprise Business Rules |
./src/usecase/* |
Application Business Rules |
./src/interface/* |
Interface Adapters |
./src/infrastructure/* |
Frameworks & Drivers |
Swagger Preview
http://localhost:8080/swagger/index.html
Depends on:
Installation
Getting started
// The following commands will launch the API and DB containers respectively.
$ make run
// The following commands will stop the API and DB containers respectively.
$ make stop
// If you want to delete the mounted volume as well, execute the following command.
$ make remove
// Run the following command to test.
$ make test
// The following command will automatically generate the Swagger document.
$ make gswag