This is a backend development of REST API in Go with Clean Architecture pattern.
Explore the docs »
View Demo
Table of Contents
In this project, I aimed to achieve the followings below;
- Refactor the code (see the original code) to follow the clean architecture properly.
- Inspect its testability and maintainability to demonstrate that this architecture is suitable for backend development in Go.
- Create a file generator utility that allows to generate files that follow the clean architecture pattern.
- Build CI, using Github Action to automate some of the testings.
List of game screens:
This is an instruction of how to set up and start the project locally. To get a local copy up and running follow these simple steps.
This is an example of how to list things you need to use the software and how to install them.
-
Install Go
Follow the steps shown in this website
- Clone this repo
git clone https://github.com/daikidev111/clean_arch_go/
- Install goimports and golangci-lint
make local-install
docker-compose up -d
The list of containers should be like this.
Name Command State Ports
-------------------------------------------------------------------------------------------------------
clean_arch_go_mysql_1 docker-entrypoint.sh mysql ... Up 0.0.0.0:3306->3306/tcp, 33060/tcp
clean_arch_go_phpmyadmin_1 /docker-entrypoint.sh apac ... Up 0.0.0.0:4000->80/tcp
clean_arch_go_proxy_1 /docker-entrypoint.sh ngin ... Up 0.0.0.0:3010->3010/tcp, 80/tcp
clean_arch_go_redis_1 docker-entrypoint.sh redis ... Up 0.0.0.0:6379->6379/tcp
clean_arch_go_swagger-ui_1 /docker-entrypoint.sh sh / ... Up 80/tcp, 127.0.0.1:3000->8080/tcpgofmt is a tool that automatically formats the Go source code.
make fmtgolangci-lint is a tool that checks if the source code follows the coding standard.
make lintgo run ./cmd/main.gocurl -X 'POST' \
'http://localhost:8080/user/create' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"name": "Joji"
}'Distributed under the MIT License. See LICENSE.txt for more information.
Daiki Kubo - LinkedIn
Project Link: https://github.com/daikidev111/clean_arch_go/

